gtm-ga4
v1.3.2GTM + GA4 MCP: tag management, consent auditing, workspace versioning, reports.
Values you need
| Variable | What it is | |
|---|---|---|
GOOGLE_APPLICATION_CREDENTIALS | required | Path to service account JSON credentials file |
GTM_ACCOUNT_ID | required | GTM account ID |
GTM_CONTAINER_ID | required | GTM container ID |
GA4_PROPERTY_ID | optional | GA4 property ID (numeric) |
npm (npx)
Requires Node.js 18+
Run in a terminal
claude mcp add gtm-ga4 -e 'GOOGLE_APPLICATION_CREDENTIALS=<GOOGLE_APPLICATION_CREDENTIALS>' -e 'GTM_ACCOUNT_ID=<GTM_ACCOUNT_ID>' -e 'GTM_CONTAINER_ID=<GTM_CONTAINER_ID>' -- npx -y mcp-gtm-ga4@1.3.2Add to
claude_desktop_config.json{
"mcpServers": {
"gtm-ga4": {
"args": [
"-y",
"mcp-gtm-ga4@1.3.2"
],
"command": "npx",
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "<GOOGLE_APPLICATION_CREDENTIALS>",
"GTM_ACCOUNT_ID": "<GTM_ACCOUNT_ID>",
"GTM_CONTAINER_ID": "<GTM_CONTAINER_ID>"
}
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"gtm-ga4": {
"args": [
"-y",
"mcp-gtm-ga4@1.3.2"
],
"command": "npx",
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "<GOOGLE_APPLICATION_CREDENTIALS>",
"GTM_ACCOUNT_ID": "<GTM_ACCOUNT_ID>",
"GTM_CONTAINER_ID": "<GTM_CONTAINER_ID>"
}
}
}
}Add to
.vscode/mcp.json{
"inputs": [
{
"description": "GOOGLE_APPLICATION_CREDENTIALS",
"id": "google-application-credentials",
"password": true,
"type": "promptString"
},
{
"description": "GTM_ACCOUNT_ID",
"id": "gtm-account-id",
"password": true,
"type": "promptString"
},
{
"description": "GTM_CONTAINER_ID",
"id": "gtm-container-id",
"password": true,
"type": "promptString"
}
],
"servers": {
"gtm-ga4": {
"args": [
"-y",
"mcp-gtm-ga4@1.3.2"
],
"command": "npx",
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "${input:google-application-credentials}",
"GTM_ACCOUNT_ID": "${input:gtm-account-id}",
"GTM_CONTAINER_ID": "${input:gtm-container-id}"
},
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.gtm-ga4]
command = "npx"
args = ["-y", "mcp-gtm-ga4@1.3.2"]
env = { "GOOGLE_APPLICATION_CREDENTIALS" = "<GOOGLE_APPLICATION_CREDENTIALS>", "GTM_ACCOUNT_ID" = "<GTM_ACCOUNT_ID>", "GTM_CONTAINER_ID" = "<GTM_CONTAINER_ID>" }For AI agents
- Ask the user for: GOOGLE_APPLICATION_CREDENTIALS, GTM_ACCOUNT_ID, GTM_CONTAINER_ID. Never invent or guess these values; secrets go into the client config, not into chat logs.
- Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
- Restart or reload the client so it starts the server.
- If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.
Machine-readable: install.md · manifest.json