Connect
GTM to
Claude Code
- Does GTM still match the dataLayer?
https://mcp.lemonado.io/mcpUse Claude Code to check the dataLayer pushes in your code against the variables and triggers in your GTM container. Lemonado connects them in about 1 minute, no API keys needed.
https://mcp.lemonado.io/mcpWhy connect GTM to Claude Code?
Most GTM breakages start in code: a developer renames a dataLayer key, and a trigger in GTM silently stops matching. Claude Code reads the dataLayer.push calls in your repo, and with Lemonado it reads the container that depends on them, so it finds the mismatch before your conversions drop.
All your GTM data
Accounts, containers and workspaces, ready to ask about.
Always today's numbers
Triggers and the conditions behind them, synced from GTM automatically, so answers use today's numbers.
Connect all your tools
Questions like "Why did conversions drop?" use GTM and GA4, Google Ads at once.
How to connect GTM to Claude Code
Before you start
- A Google Tag Manager account you can sign in to
- Claude Code installed
- A Lemonado account (the free trial works)
- 1
Connect Google Tag Manager in Lemonado
In Lemonado, open Connectors, find Google Tag Manager and sign in. Sign in with a Google account that has at least Read access to the GTM containers you want to audit. Pick the web container your site uses.
- 2
Turn on external access
In the company's settings, open External tools, turn the connection on, choose which sources it can reach and copy the server URL.
texthttps://mcp.lemonado.io/mcp - 3
Add the server
With Claude Code installed, run one of these in your terminal. Most people want the first: it adds Lemonado to every project.
bash# every project (recommended) claude mcp add --scope user --transport http lemonado https://mcp.lemonado.io/mcp # this project only claude mcp add --transport http lemonado https://mcp.lemonado.io/mcp - 4
Sign in
Start Claude Code with claude and run /mcp. Choose Lemonado and finish the sign-in in your browser.
bashclaude /mcp - 5
Ask Claude Code about GTM
Ask a question about the accounts your connection can reach. Claude Code can also write the numbers into a file or a script for you. Try "List every dataLayer.push in our repo and compare the keys with the data layer variables and custom event triggers in our GTM container." Or ask: "Document the setup" or "Will this rename break anything?"
Good to know
- The command uses Claude Code's default local scope. Use --scope user to share the server across projects.
What can Claude Code do with GTM?
Claude Code queries your GTM data while it works in your repo: it saves data as files, checks tracking against code and runs headless with claude -p.
List every dataLayer.push in our repo and compare the keys with the data layer variables and custom event triggers in our GTM container.
The code pushes 18 events. GTM listens for 21. checkout_step, promo_click and form_submit_newsletter have triggers but no push anywhere in the code anymore.
Source: GTM + your code
Write docs/tracking.md describing each dataLayer event, the GTM tags it fires and which platforms receive it.
Saved. It covers 18 events and 46 tags, with a table of which platform gets each conversion.
Source: GTM + your code
I want to rename the ecommerce.value key to ecommerce.revenue. Which GTM variables, tags and triggers would that break?
One variable (DLV - value) reads it, and 9 tags use that variable: all purchase tags for Google Ads, Meta, TikTok and GA4.
Source: GTM + your code
Compare GTM versions 208 and 213 and write the changes to changelog/gtm.md in plain words.
Saved. 5 tags changed, 2 triggers were added and 1 variable was renamed, with a line on what each change does.
Source: GTM + your code
List tags in our GTM container that have no consent settings, grouped by vendor.
14 tags have no consent check: 8 custom HTML pixels, 4 Meta tags and 2 LinkedIn Insight tags. All GA4 and Google Ads tags use consent mode.
Source: Google Tag Manager
Google Ads conversions fell on Oct 18. Check which GTM version was published that week and what it changed.
Version 209 went live Oct 18 at 16:40 and renamed the dataLayer variable for order value. The Google Ads conversion tag still reads the old name, so it sends no value.
Source: GTM + Google Ads
Connect GTM to another AI app.
Claude
Connect GTM to Claude
ChatGPT
Connect GTM to ChatGPT
Cursor
Connect GTM to Cursor
VS Code (GitHub Copilot)
Connect GTM to VS Code (GitHub Copilot)
Codex
Connect GTM to Codex
Perplexity
Connect GTM to Perplexity
Google Antigravity
Connect GTM to Google Antigravity
Windsurf (Devin Desktop)
Connect GTM to Windsurf (Devin Desktop)
Zed
Connect GTM to Zed
n8n
Connect GTM to n8n
Other integrations for Claude Code
All Claude Code integrations- Google Analytics in Claude CodeAsk Claude, ChatGPT or Cursor about GA4 traffic, conversions and funnels, next to your ad spend.
- Google Ads in Claude CodeAsk Claude, ChatGPT or Cursor about your Google Ads campaigns, search terms and spend.
- Meta Ads in Claude CodeAsk Claude, ChatGPT or Cursor about your Facebook and Instagram ads, creatives and results.
- Google BigQuery in Claude CodeAsk Claude, ChatGPT or Cursor about your GA4 export and BigQuery tables without writing SQL.
- Attio in Claude CodeAsk Claude, ChatGPT or Cursor about your Attio records, next to the campaigns that brought them in.
- Instagram organic in Claude CodeAsk Claude or ChatGPT which posts and reels grow your account, and which ones to turn into ads.
Reading this as an AI agent?
Everything an agent needs to set this up, in plain text. Paste this page's link into Claude Code and ask it to connect you, or copy the block.
# Connect Google Tag Manager to Claude Code (Lemonado MCP) - Server URL: https://mcp.lemonado.io/mcp - Transport: Streamable HTTP - Auth: OAuth; the user signs in to Lemonado in the browser. No API keys. - In Lemonado: connect the GTM account and container. Sign in with a Google account that has at least Read access to the GTM containers you want to audit. Pick the web container your site uses. - In Claude Code: Terminal: claude mcp add ```bash # every project (recommended) claude mcp add --scope user --transport http lemonado https://mcp.lemonado.io/mcp # this project only claude mcp add --transport http lemonado https://mcp.lemonado.io/mcp ``` If you are Claude Code, run the setup yourself: Add the Lemonado MCP server for all my projects by running: claude mcp add --scope user --transport http lemonado https://mcp.lemonado.io/mcp Then tell me to run /mcp and sign in to Lemonado. Once I've signed in, list the Google Tag Manager accounts Lemonado can reach. First question to try: "List every dataLayer.push in our repo and compare the keys with the data layer variables and custom event triggers in our GTM container." More: https://lemonado.io/integrations/google-tag-manager · https://lemonado.io/llms.txt
Frequently Asked Questions
For auditing, yes. Community servers usually ask for edit and publish rights so the agent can change your container. Lemonado only reads, which is safer for audits, and it adds GA4 and ad platform data to check tags against real conversions.
No, Google doesn't run one. Community servers exist, and most can edit and publish your container, so check what you grant them. Lemonado gives Claude Code read-only access to your containers, next to GA4 and your ad platforms.
Run claude mcp list to see whether lemonado is connected. If it needs authentication, run /mcp inside Claude Code and sign in again. In Lemonado, check that Google Tag Manager is connected and External tools is on for the company. If a container is missing, your Google user needs access to it in Tag Manager > Admin > User Management. Account access alone isn't always enough.
Yes, if both are connected in Lemonado. One connection reaches every source you allow, so you can ask things like "Google Ads conversions fell on Oct 18. Check which GTM version was published that week and what it changed."
MCP is included in Lemonado's paid plans and in the free trial, so you can try it before you pay.
Still have a question?
Shoot us an email at hello@lemonado.io.
Try for freeStop fighting with data. Start feeding your AI.
Connect your data to AI and free your team from reporting and busywork.
Try Lemonado free