# Google Tag Manager MCP

> Google Tag Manager MCP is an open-source MCP server for marketing and seo. Audit Google Tag Manager tags, triggers and variables, then version and publish. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** vscode, CLI, self-hosted
- **Website:** https://renzojohnson.com/contributions/google-tag-manager-mcp
- **MCP Registry name:** com.renzojohnson/google-tag-manager-mcp
- **Categories:** marketing and SEO, analytics and data
- **Listing updated:** 2026-11-14

## About

Seven read tools walk the account hierarchy: accounts, containers, workspaces, then tags with their firing and blocking triggers, triggers with conditions, variables (including enabled built-ins), and the live published version. A gtm_admin tool handles the changes: create or update a tag, pause or resume it, create triggers and variables, create a version and publish it.

Safety is built in: delete_tag and publish_version only run with confirm: true. The author describes container audits, comparing event names in code with triggers, and documenting what is live as the main uses.

It reads configuration only, so it cannot tell what fires in a visitor's browser and does not replace Preview mode; server-side containers are listed but the tools were designed around web containers. Your Google account needs at least read access to the container. It runs locally via a VS Code extension or npm on Node.js 22 or newer.

## Features

- **Container audit:** Lists every tag, trigger and variable with the relationships between them.
- **Live version:** Reads the published version of a container.
- **Tag editing:** Creates, updates, pauses and deletes tags.
- **Triggers and variables:** Creates new ones through named actions.
- **Versioning:** Creates a container version from a workspace.
- **Confirmed publishing:** Publishing to the live site needs confirm: true.

## Good for

- Find tags with no firing trigger
- Check the GA4 configuration tag's measurement ID
- Pause an old remarketing tag
- Compare data-layer events with triggers
- Write up what is live for a privacy review

## Install

### Claude Code (Terminal)

```sh
claude mcp add google-tag-manager-mcp --env GOOGLE_OAUTH_CLIENT_SECRET='<GOOGLE_OAUTH_CLIENT_SECRET>' --env GOOGLE_OAUTH_REFRESH_TOKEN='<GOOGLE_OAUTH_REFRESH_TOKEN>' -- npx -y @renzo.johnson/google-tag-manager-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "google-tag-manager-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/google-tag-manager-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "google-tag-manager-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/google-tag-manager-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "google-tag-manager-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/google-tag-manager-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "google-tag-manager-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/google-tag-manager-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "google-tag-manager-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/google-tag-manager-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}
```

## Tools

- `gtm_list_accounts`: List Tag Manager accounts you can open.
- `gtm_list_containers`: List containers in an account with public IDs.
- `gtm_list_workspaces`: List workspaces in a container.
- `gtm_list_tags`: List tags with type, firing and blocking triggers and parameters.
- `gtm_list_triggers`: List triggers with type and conditions.
- `gtm_list_variables`: List user-defined and enabled built-in variables.
- `gtm_get_live_version`: Read the published version of a container.
- `gtm_admin`: Create, update, pause and delete tags; create triggers, variables and versions; publish a version.

## FAQ

### Can it replace Preview mode?

No, it reads configuration, not what fires in browsers.

### Does it publish by itself?

Only when the agent passes confirm: true.

### Are server-side containers supported?

They are listed, but the tools were designed around web containers.

### What access do I need?

At least read access to the container in Tag Manager.

### Is Google Tag Manager MCP free?

Yes. Google Tag Manager MCP is open source, so you can use and self-host it for free.

### How do I add Google Tag Manager MCP to Claude Code?

Run this command in your terminal: claude mcp add google-tag-manager-mcp --env GOOGLE_OAUTH_CLIENT_SECRET='<GOOGLE_OAUTH_CLIENT_SECRET>' --env GOOGLE_OAUTH_REFRESH_TOKEN='<GOOGLE_OAUTH_REFRESH_TOKEN>' -- npx -y @renzo.johnson/google-tag-manager-mcp

### What are the best alternatives to Google Tag Manager MCP?

The closest alternatives to Google Tag Manager MCP are Agent-Native Analytics, Google Ads + Meta Ads + SEO/GEO MCP, Tapetide - Indian Stock Market MCP, World Monitor and Calven.

## Alternatives

- [Agent-Native Analytics](https://ai-powered.com/mcp/agent-native-analytics): Agent-Native Analytics is an open-source MCP server for analytics and data.
- [Google Ads + Meta Ads + SEO/GEO MCP](https://ai-powered.com/mcp/google-ads-meta-ads-seo-geo-mcp): Google Ads + Meta Ads + SEO/GEO MCP is a freemium MCP server for marketing and seo.
- [Tapetide - Indian Stock Market MCP](https://ai-powered.com/mcp/tapetide-indian-stock-market-mcp): Tapetide - Indian Stock Market MCP is a freemium MCP server for finance and payments.
- [World Monitor](https://ai-powered.com/mcp/world-monitor): World Monitor is a freemium MCP server for analytics and data.
- [Calven](https://ai-powered.com/mcp/calven): Calven is an MCP server for marketing and seo.
- [CompanyData](https://ai-powered.com/mcp/companydata): CompanyData is a paid MCP server for analytics and data.
- [MCP](https://ai-powered.com/mcp/mcp-mwhffe53): MCP is a freemium MCP server for marketing and seo.
- [ChartAnt](https://ai-powered.com/mcp/chartant): ChartAnt is a freemium MCP server for design and media.

---
Source: https://ai-powered.com/mcp/google-tag-manager-mcp
