Why connect GTM to Cursor?
When you edit a checkout or a form in Cursor, you rarely open GTM to check what depends on it. Add Lemonado and Cursor's agent can read the container while you work, so it warns you when a change in your code will stop a trigger from firing.
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 Cursor
Before you start
- A Google Tag Manager account you can sign in to
- Cursor 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
Open your MCP config
Open ~/.cursor/mcp.json for every project, or .cursor/mcp.json for this project only. Create the file if it doesn't exist.
- 4
Add Lemonado
Merge this into the file and save.
json{ "mcpServers": { "lemonado": { "url": "https://mcp.lemonado.io/mcp" } } } - 5
Sign in
Cursor asks you to sign in to Lemonado. Approve access, then ask the agent about your data.
- 6
Ask Cursor about GTM
Try "I'm changing the thank-you page route from /thank-you to /order/complete. Which GTM triggers depend on that URL?" Or ask: "Which clicks are tracked?" or "Is the form tracked?"
Good to know
- Editing the file directly avoids relying on menu labels that change between Cursor versions.
What can Cursor do with GTM?
Cursor's agent reads your GTM data while it edits: it fills components with real data, checks tracking code and writes the analysis next to your code.
I'm changing the thank-you page route from /thank-you to /order/complete. Which GTM triggers depend on that URL?
Four triggers match Page Path equals /thank-you, and 11 tags use them, including every purchase conversion. They need to match the new path before you deploy.
Source: GTM + your code
Which CSS selectors and element IDs do our GTM click triggers use, and do they still exist in our components?
6 of 14 click triggers point at IDs that no longer exist in the code, including #cta-hero and #pricing-annual.
Source: GTM + your code
Our new contact form is in components/ContactForm.tsx. Is there a GTM trigger and tag for its submission?
No. The form doesn't push an event, and GTM's form submission trigger only listens on the old form's ID. Add a dataLayer.push on success.
Source: GTM + your code
Check our layouts for GTM snippets and compare with the containers in our GTM account.
app/layout.tsx and the legacy blog template both load GTM-XXXX12, so the blog fires every tag twice.
Source: GTM + your code
Find tags in GTM that send the same event to the same destination, so it might be counted twice.
The GA4 purchase event is sent by two tags: one on the purchase trigger and one in a custom HTML tag from 2023. Both fire on the thank-you page.
Source: Google Tag Manager
Compare the GA4 events our GTM tags send with the events GA4 actually received last week.
GTM sends 31 event names, GA4 received 27. Four events (begin_checkout among them) use a trigger tied to a button that was removed.
Source: GTM + GA4
Connect GTM to another AI app.
Claude
Connect GTM to Claude
ChatGPT
Connect GTM to ChatGPT
Claude Code
Connect GTM to Claude Code
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 Cursor
All Cursor integrations- Google Analytics in CursorAsk Claude, ChatGPT or Cursor about GA4 traffic, conversions and funnels, next to your ad spend.
- Google Ads in CursorAsk Claude, ChatGPT or Cursor about your Google Ads campaigns, search terms and spend.
- Meta Ads in CursorAsk Claude, ChatGPT or Cursor about your Facebook and Instagram ads, creatives and results.
- Google BigQuery in CursorAsk Claude, ChatGPT or Cursor about your GA4 export and BigQuery tables without writing SQL.
- Attio in CursorAsk Claude, ChatGPT or Cursor about your Attio records, next to the campaigns that brought them in.
- Instagram organic in CursorAsk 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 Cursor and ask it to connect you, or copy the block.
# Connect Google Tag Manager to Cursor (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 Cursor: ~/.cursor/mcp.json
```json
{
"mcpServers": {
"lemonado": {
"url": "https://mcp.lemonado.io/mcp"
}
}
}
```
First question to try: "I'm changing the thank-you page route from /thank-you to /order/complete. Which GTM triggers depend on that URL?"
More: https://lemonado.io/integrations/google-tag-manager · https://lemonado.io/llms.txtFrequently Asked Questions
No. Read access to the container is enough, because Lemonado only reads it. Publishing stays with whoever owns the container in Tag Manager.
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 Cursor read-only access to your containers, next to GA4 and your ad platforms.
Open Cursor's settings and find lemonado in the MCP list. A red dot or a sign-in prompt means the login expired. Restart Cursor after editing mcp.json. 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 "Compare the GA4 events our GTM tags send with the events GA4 actually received last week."
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