Gtm Ga4 MCP server
GTM + GA4 MCP: tag management, consent auditing, workspace versioning, reports.
2 stars51 downloads/wk
Reviews
Write oneNobody has reviewed Gtm Ga4 yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Gtm Ga4 tools (13, 5 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
ga4_create_custom_dimensionwrite actionRegister a new custom dimension in the GA4 property.
ga4_list_custom_dimensionsList all registered custom dimensions for the GA4 property.
ga4_realtime_reportQuery GA4 Realtime Report (last 30 minutes).
ga4_run_reportwrite actionQuery GA4 historical report.
gtm_audit_consentScan all tags in the sandbox workspace and report consent compliance. Returns tags with no consent, NOT_NEEDED tags, properly configured tags, and recommendations.
gtm_create_tagwrite actionCreate a new tag in the sandbox workspace. Safety: only operates on sandbox workspace.
gtm_create_versionwrite actionCreate a version (snapshot) of the sandbox workspace. Does NOT publish.
gtm_get_tagGet full details of a single tag by ID from the sandbox workspace.
gtm_list_tagsList all tags in the sandbox GTM workspace with name, type, consent status, and firing triggers.
gtm_list_triggersList all triggers in the sandbox GTM workspace.
gtm_list_variablesList all variables in the sandbox GTM workspace.
gtm_previewGenerate a GTM Preview URL for the sandbox workspace.
gtm_update_tagwrite actionUpdate a tag in the sandbox workspace. Fetches current tag, merges updates, then saves. Safety: only operates on sandbox workspace.
Public scan report
scanner v0.1.9 · 2026-09-27 · same rubric, same numbers if you re-run it
- Code scan13 source files scanned13/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 23 days ago15/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
Findings (1)
- highShell command built from a string (injection risk)
exec.shell-concatdist/index.js: … import("child_process").then(cp => cp.exec(`${open} "${authUrl}"`)); }); }); } // H…
How Gtm Ga4 compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 74/100
- higher than 40% of 48,255 servers
- Tools
- 13
- the typical server has 7
- Tools that change things
- 38%
- typical: 0%. Fewer write tools means less an agent can break
- GitHub stars
- 2
- more than 75% of 28,688 servers
- Downloads a week
- 51
- more than 43% of 12,191 servers with a package
What its tools let an agent do: 8 read · 5 change
Install Gtm Ga4 in Claude Code, Cursor or VS Code
Runs npx -y mcp-gtm-ga4 on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add gtm-ga4 -- npx -y mcp-gtm-ga4
What the publisher says
From the Gtm Ga4 repository's README, as published. We do not edit it. Read it on GitHub
mcp-gtm-ga4
MCP server for Google Tag Manager and GA4 -- tag management, consent auditing, workspace versioning, and analytics reporting via Claude.
Features
- 14 tools spanning GTM workspace management (tags, triggers, variables), consent compliance auditing, workspace preview/versioning, and GA4 reporting
- Sandbox safety -- all write operations verify they target the resolved workspace, refusing to write to non-sandbox workspaces
- Multi-client support -- configure per-client via environment variables
- Auto-detects Default Workspace ID -- no need to manually specify workspace IDs unless using a custom sandbox
Installation
npm install mcp-gtm-ga4Or clone and build:
git clone https://github.com/mharnett/mcp-gtm-ga4.git
cd mcp-gtm-ga4
npm install
npm run buildConfiguration
Security: Never share your .mcp.json file or commit it to git -- it may contain API credentials. Add .mcp.json to your .gitignore.
Runtime configuration is via environment variables.
See config.example.json for a reference template. The only value read from disk is oauth.scope (in an optional config.json) — the single source of truth for the OAuth scope the onboarding paths request. If no config.json is present, the committed minimum scope is used.
Authentication
This MCP supports two auth models. Both feed the same GOOGLEAPPLICATIONCREDENTIALS runtime path.
Precedence & mechanism
There is no runtime service-account-vs-OAuth toggle. Both models converge on a single slot — GOOGLEAPPLICATIONCREDENTIALS — which the runtime hands to GoogleAuth({ keyFile }). Whichever file you point that env var at is the credential:
file that plugs into the exact same slot.
- a service-account JSON key (option 1 below), or
- the authorizeduser keyfile** the auth subcommand writes (option 2) — a
So the only real precedence rule is failure handling: an explicitly-configured keyfile is used; when GOOGLEAPPLICATIONCREDENTIALS is unset the server fails loudly at startup with an onboarding error naming both the service-account path and the auth OAuth helper. It deliberately does not fall back to Google's Application Default Credentials (gcloud user creds / GCE metadata server) — no silent machine-local default, no silent runtime failover.
1. Service account (primary, recommended for unattended/server use)
Create a service account in your GCP project, download its JSON key, grant it the GTM container role (on the target GTM container) and GA4 property access, and point GOOGLEAPPLICATIONCREDENTIALS at the key file. No OAuth flow, no browser, no refresh token. This is the recommended path for headless/server/unattended deployments.
2. User OAuth (interactive, for users without a service account)
If you can't use a service account, mint a user credential with your own Google OAuth client (a "Desktop app" OAuth 2.0 Client ID created in your own GCP project — enable the Tag Manager API and the Google Analytics Admin + Data APIs). Two equivalent onboarding commands, both hardened with PKCE (RFC 7636, S256) and both requesting the scope from config.json (oauth.scope) so they never drift:
export GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
export GOOGLE_CLIENT_SECRET=your-client-secretShortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Gtm Ga4: common questions
- Is Gtm Ga4 MCP server safe?
- Mostly: it is graded B (74/100). Read the Gtm Ga4 safety report
- How do I install Gtm Ga4?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Gtm Ga4 need an API key?
- No secret keys are declared. It reads 4 settings from the environment.
- Is Gtm Ga4 maintained?
- The last commit was 60 days ago (2026-09-04). The latest release is v1.0.1.
- What can I use instead of Gtm Ga4?
- Servers from other publishers that do the same job: AdLoop MCP server.
- How does Gtm Ga4 compare with other MCP servers?
- safety score 74/100 (higher than 40% of 48,255 servers); tools 13 (the typical server has 7); tools that change things 38% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.
Alternatives to Gtm Ga4
Same job from other publishers: the closest match first, then the best rated.
- AdLoopGoogle Ads, Reddit Ads, GA4 and Tag Manager in your AI client, with a preview before every change.not reviewedEstablishedA