MCP.Market

Gtm Ga4 MCP server

by mharnett·io.github.mharnett/gtm-ga4·v1.0.1·2 stars

GTM + GA4 MCP: tag management, consent auditing, workspace versioning, reports.

B74/100grade B
What users say
No reviews yet
Be the first
Safety scan
B74/100

full report

Adoption
Growing

2 stars51 downloads/wk

Reviews

Write one

Nobody 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 posts

Read from the package source without running it. The installed server may list more.

  • ga4_create_custom_dimensionwrite action

    Register a new custom dimension in the GA4 property.

  • ga4_list_custom_dimensions

    List all registered custom dimensions for the GA4 property.

  • ga4_realtime_report

    Query GA4 Realtime Report (last 30 minutes).

  • ga4_run_reportwrite action

    Query GA4 historical report.

  • gtm_audit_consent

    Scan 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 action

    Create a new tag in the sandbox workspace. Safety: only operates on sandbox workspace.

  • gtm_create_versionwrite action

    Create a version (snapshot) of the sandbox workspace. Does NOT publish.

  • gtm_get_tag

    Get full details of a single tag by ID from the sandbox workspace.

  • gtm_list_tags

    List all tags in the sandbox GTM workspace with name, type, consent status, and firing triggers.

  • gtm_list_triggers

    List all triggers in the sandbox GTM workspace.

  • gtm_list_variables

    List all variables in the sandbox GTM workspace.

  • gtm_preview

    Generate a GTM Preview URL for the sandbox workspace.

  • gtm_update_tagwrite action

    Update 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

1 high
  • 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-concat
    dist/index.js: … import("child_process").then(cp => cp.exec(`${open} "${authUrl}"`)); }); }); } // H…
Overall 74/100. Components that don't apply are left out of the denominator. Any critical finding is an F.RubricAppeal a findingJSON

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
Add to Cursor

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-ga4

Or clone and build:

git clone https://github.com/mharnett/mcp-gtm-ga4.git
cd mcp-gtm-ga4
npm install
npm run build

Configuration

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-secret

Shortened. 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.

  • AdLoop
    Google Ads, Reddit Ads, GA4 and Tag Manager in your AI client, with a preview before every change.
    A

More from mharnett →