
Gtm Ga4
Connects Claude to Google Tag Manager and GA4 via their official APIs, giving you 14 tools for managing tags, triggers, and variables, auditing consent configurations, creating workspace versions, and pulling analytics reports. All write operations include sandbox protection that blocks accidental changes to non-workspace containers. You get GTM tag CRUD, consent compliance checks, workspace previews, and both standard and realtime GA4 reporting. Useful when you're debugging tag setups, auditing consent implementations, or need to query analytics data without leaving your Claude workflow. Requires a GCP service account with appropriate GTM and GA4 permissions. Built on googleapis and the official Google Analytics clients with retry policies via cockatiel.
- GitHub stars
- 1
- tools
- 13
- auth
- Required
- transport
- STDIO
- env vars
- 4
- last updated
- Apr 8, 2026
Tools
13 toolsPublic tool metadata for what this MCP can expose to an agent.
gtm_list_tagsList all tags in the workspace with consent status and firing triggers
List all tags in the workspace with consent status and firing triggers
No parameter schema in public metadata yet.
gtm_get_tagGet full tag configuration by tag ID
Get full tag configuration by tag ID
No parameter schema in public metadata yet.
gtm_update_tagUpdate an existing tag (merge patch via JSON)
Update an existing tag (merge patch via JSON)
No parameter schema in public metadata yet.
gtm_create_tagCreate a new tag from a JSON definition
Create a new tag from a JSON definition
No parameter schema in public metadata yet.
gtm_list_triggersList all triggers (ID, name, type)
List all triggers (ID, name, type)
No parameter schema in public metadata yet.
gtm_list_variablesList all variables (ID, name, type)
List all variables (ID, name, type)
No parameter schema in public metadata yet.
gtm_audit_consentAudit all tags for consent configuration compliance
Audit all tags for consent configuration compliance
No parameter schema in public metadata yet.
gtm_previewGenerate a quick preview of the current workspace
Generate a quick preview of the current workspace
No parameter schema in public metadata yet.
gtm_create_versionCreate a new container version from the workspace
Create a new container version from the workspace
No parameter schema in public metadata yet.
gtm_ga4_run_reportRun a GA4 report with dimensions, metrics, date range, and filters
Run a GA4 report with dimensions, metrics, date range, and filters
No parameter schema in public metadata yet.
gtm_ga4_realtime_reportRun a GA4 realtime report (last 30 minutes)
Run a GA4 realtime report (last 30 minutes)
No parameter schema in public metadata yet.
gtm_ga4_list_custom_dimensionsList all custom dimensions for the property
List all custom dimensions for the property
No parameter schema in public metadata yet.
gtm_ga4_create_custom_dimensionCreate a new custom dimension
Create a new custom dimension
No parameter schema in public metadata yet.
Sponsors
Configuration
GOOGLE_APPLICATION_CREDENTIALS*Path to service account JSON credentials file
GTM_ACCOUNT_ID*GTM account ID
GTM_CONTAINER_ID*GTM container ID
GA4_PROPERTY_IDGA4 property ID (numeric)
Readme
mcp-gtm-ga4
MCP server for Google Tag Manager and GA4 -- tag management, consent auditing, workspace versioning, and analytics reporting via Claude.
Quick install
Claude Code, one line (replace the placeholder values with your own; see Configuration and Authentication for how to get them):
claude mcp add --env GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json --env GTM_ACCOUNT_ID=YOUR_GTM_ACCOUNT_ID --env GTM_CONTAINER_ID=YOUR_GTM_CONTAINER_ID --env GA4_PROPERTY_ID=YOUR_GA4_PROPERTY_ID --transport stdio mcp-gtm-ga4 -- npx -y mcp-gtm-ga4
All write operations are sandbox-checked: the server refuses to write to a workspace that is not the resolved sandbox workspace.
Claude Desktop
Add this to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS), then fully quit and restart Claude Desktop:
Details
- Repository
- github.com/mharnett/mcp-gtm-ga4
- Category
- Sales & Marketing
- Package
mcp-gtm-ga4- Transport
- STDIO
- Auth
- Required
- Registry
- MCP registry, active