gtm-setup — Claude Code skill for GTM setup
A reference for Google Tag Manager events and GA4 setup. Use it to shape a dataLayer event, choose a trigger, or troubleshoot tracking.
npx skills add cognyai/claude-code-marketing-skills --skill gtm-setup -a claude-codeWhat gtm-setup does
gtm-setup answers questions about Google Tag Manager event tracking, from dataLayer behavior to trigger and variable types, GA4 tags, and debugging. Ask about a particular topic, such as purchase tracking or common implementation mistakes, and it can provide code examples.
The guide works without connected accounts. With Cogny MCP connected, it can inspect a GTM container and review its tags, triggers, and variables; GA4 tools can help verify incoming events. GTM recursively merges nested objects, so old ecommerce values can carry into later events. Clear them by pushing ecommerce: null before the next ecommerce event.
What it helps with
- build a purchase event with
dataLayer.push() - choose a trigger and configure a GA4 tag
- trace a variable that reads an outdated value
- inspect the tags and triggers in a GTM container
- debug missing or duplicated tracking events
Example prompts for the agent
- Show me a
dataLayer.push()example for a purchase event. - Explain which GTM trigger fits a form submission event.
- Inspect the tags and variables in my GTM container.
How to install gtm-setup
1Skills CLI (Vercel)
npx skills add cognyai/claude-code-marketing-skills --skill gtm-setup -a claude-code2Manually: put the files in place
~/.claude/skills/gtm-setup/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/gtm-setup/
1Skills CLI (Vercel)
npx skills add cognyai/claude-code-marketing-skills --skill gtm-setup -a codex2Manually: put the files in place
.agents/skills/gtm-setup/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add cognyai/claude-code-marketing-skills --skill gtm-setup -a cursor2Manually: put the files in place
.cursor/skills/gtm-setup/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install cognyai/claude-code-marketing-skills gtm-setup2Manually: put the files in place
.github/skills/gtm-setup/SKILL.md1Skills CLI (Vercel)
npx skills add cognyai/claude-code-marketing-skills --skill gtm-setup -a gemini-cli2Platform CLI
gemini skills install https://github.com/cognyai/claude-code-marketing-skills --path skills/gtm-setupManually: put the files in place
.devin/skills/gtm-setup/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add cognyai/claude-code-marketing-skills --skill gtm-setup -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about gtm-setup
How do I install gtm-setup in Claude Code?
Run npx skills add cognyai/claude-code-marketing-skills --skill gtm-setup -a claude-code. The skill file is at ~/.claude/skills/gtm-setup/SKILL.md.
What does gtm-setup do?
It guides event tracking setup in Google Tag Manager and GA4, including dataLayer events, triggers, variables, and debugging.
Can gtm-setup inspect my GTM container?
Yes, when Cogny MCP is connected, it can inspect the container’s tags, triggers, and variables. The reference guide itself works without connected accounts.