Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By Bin-HuangApache-2.0In 1 marketplace
Runs GA4 custom reports, realtime active-user checks and property admin queries from the command line, returning JSON for agents. Needs a Google Cloud service account JSON key with access to the GA4 Admin and Data APIs.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
google-analytics, ga4, analytics, reporting, realtime-users, service-account, google-cloud, cli
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Google Analytics CLI & Skills for AI agents (and humans). Run custom reports with flexible dimensions and date ranges, monitor realtime active users, manage custom metrics from the GA4 API, and more.
Works with: OpenClaw, Claude Code, Cursor, Codex, and any agent that can run shell commands.
Tell your AI agent (e.g. OpenClaw):
Install this CLI and skills from https://github.com/Bin-Huang/google-analytics-cli
Or install manually:
npm install -g google-analytics-cli
# Add skills for AI agents (Claude Code, Cursor, Codex, etc.)
npx skills add Bin-Huang/google-analytics-cli
Or run directly: npx google-analytics-cli --help
For development:
pnpm install
pnpm build
Built on Google's official APIs. Handles service account authentication and request signing. Every command outputs structured JSON to stdout, ready for agents to parse without extra processing.
Under the hood it uses the official Node.js client libraries @google-analytics/admin and @google-analytics/data. All API responses are passed through as JSON — no transformation or aggregation.
accounts, property, properties, change-history, access-report, and other admin commands.report, realtime, metadata, audience exports, and other reporting commands.analytics-reader), and click Done.[!NOTE] Key creation blocked? Your organization can block service account key creation with the
constraints/iam.managed.disableServiceAccountKeyCreationpolicy. Organizations created on or after May 3, 2024 enforce this policy by default. See Secure-by-default organizations and Create and delete service account keys.To fix this, ask your organization admin to override the policy for this project. Or use Application Default Credentials instead of a key.
The CLI looks for credentials in this order and uses the first one it finds:
--credentials <path> flag--profile <name> flag (or GA_CLI_PROFILE env var) → ~/.config/google-analytics-cli/profiles/<name>.json (see Managing multiple GA accounts)GOOGLE_APPLICATION_CREDENTIALS env var~/.config/google-analytics-cli/credentials.json (default path)Choose one of these options:
# Option A: Default path (recommended)
mkdir -p ~/.config/google-analytics-cli
cp ~/Downloads/your-key-file.json ~/.config/google-analytics-cli/credentials.json
# Option B: Environment variable
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your-key-file.json"
# Option C: Pass per command
google-analytics-cli accounts --credentials /path/to/your-key-file.json
--credentials and --profile cannot be used together; --credentials overrides GA_CLI_PROFILE.
The service account needs a role on each Google Analytics account or property. You must be an Administrator of the account or property to add users to it.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub bin-huang/google-analytics-cli --plugin google-analytics-cliPlugins from other owners that cover similar ground