/ Directory / Playground / event-tracking-skill
● Community jtrackingai ⚡ Instant

event-tracking-skill

by jtrackingai · jtrackingai/event-tracking-skill

GA4 + GTM event tracking automated — site analysis, event schema, GTM sync, preview verification, and publishing from your agent.

Event Tracking Skill automates the full GA4 event-tracking workflow: scan a site, propose an event schema aligned with GA4 conventions, sync to Google Tag Manager, verify in GTM Preview, and publish. Works across Claude Code, Cursor, and Codex. Removes the repetitive part of analytics work.

Why use it

Key features

Live Demo

What it looks like in practice

event-tracking-skill.replay ▶ ready
0/0

Install

Pick your client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "event-tracking-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/jtrackingai/event-tracking-skill",
        "~/.claude/skills/event-tracking-skill"
      ],
      "_inferred": true
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "event-tracking-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/jtrackingai/event-tracking-skill",
        "~/.claude/skills/event-tracking-skill"
      ],
      "_inferred": true
    }
  }
}

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "event-tracking-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/jtrackingai/event-tracking-skill",
        "~/.claude/skills/event-tracking-skill"
      ],
      "_inferred": true
    }
  }
}

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "event-tracking-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/jtrackingai/event-tracking-skill",
        "~/.claude/skills/event-tracking-skill"
      ],
      "_inferred": true
    }
  }
}

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "event-tracking-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/jtrackingai/event-tracking-skill",
        "~/.claude/skills/event-tracking-skill"
      ]
    }
  ]
}

Continue uses an array of server objects rather than a map.

~/.config/zed/settings.json
{
  "context_servers": {
    "event-tracking-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/jtrackingai/event-tracking-skill",
          "~/.claude/skills/event-tracking-skill"
        ]
      }
    }
  }
}

Add to context_servers. Zed hot-reloads on save.

claude mcp add event-tracking-skill -- git clone https://github.com/jtrackingai/event-tracking-skill ~/.claude/skills/event-tracking-skill

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use event-tracking-skill

How to set up GA4 + GTM from zero on a new site

👤 Marketers and full-stack devs instrumenting a new site ⏱ ~60 min intermediate

When to use: You have a site live, no tracking yet, and a deadline.

Prerequisites
  • Skill installed — git clone https://github.com/jtrackingai/event-tracking-skill ~/.claude/skills/event-tracking-skill
  • GA4 property + GTM container — Create in Google Tag Manager; note GTM-XXXXXX ID
  • Service account with Tag Manager API access — GCP console → enable Tag Manager API → service account JSON
Flow
  1. Scan the site
    Scan https://example.com and propose a GA4 event schema (page_view, view_item, add_to_cart, etc.).✓ Copied
    → Event list with parameters and sample payloads
  2. Sync to GTM
    Sync this schema into GTM container GTM-ABCDEF as tags + triggers + variables.✓ Copied
    → Workspace changes reported
  3. Preview and verify
    Open Preview on staging.example.com and verify each event fires.✓ Copied
    → Per-event fire/miss report
  4. Publish
    Publish version with notes 'initial GA4 setup'.✓ Copied
    → Live version ID returned

Outcome: A GA4-tracked site with events flowing within an hour.

Pitfalls
  • Events fire but don't appear in GA4 for 24h — Use DebugView in GA4 for real-time verification while testing
  • GTM workspace conflicts with manual edits — Create a dedicated workspace for the skill's changes to avoid stepping on someone else
Combine with: seo-audit-skill

Layer GA4 ecommerce events onto an existing site

👤 Ecommerce operators already on GA4 but missing purchase/view_item tracking ⏱ ~45 min intermediate

When to use: You have basic tracking but ecommerce funnels are empty.

Flow
  1. Infer product events
    Scan /shop and /checkout and propose the full GA4 ecommerce event list.✓ Copied
    → view_item_list, view_item, add_to_cart, begin_checkout, purchase with items[] param
  2. Configure dataLayer push patterns
    Generate JS snippets to push each event from our React components.✓ Copied
    → Per-event dataLayer.push snippet
  3. Wire in GTM
    Create the matching GA4 tags and triggers in GTM.✓ Copied
    → Tags linked to dataLayer events

Outcome: Full ecommerce funnel visible in GA4.

Combine with: ecommerce-skill

Audit an existing GTM container for coverage gaps

👤 Analysts inheriting a messy GTM ⏱ ~30 min advanced

When to use: You're on a new team; GTM was set up years ago; nobody knows what's live.

Flow
  1. Dump container state
    Read GTM container GTM-XXXX and list every active tag, trigger, and variable.✓ Copied
    → Normalized inventory
  2. Compare to site
    Now scan the site and show which events fire in GTM Preview but aren't meaningful anymore, and which should exist but don't.✓ Copied
    → Gap + cruft list

Outcome: A cleanup PR list for your GTM workspace.

Combinations

Pair with other MCPs for X10 leverage

event-tracking-skill + seo-audit-skill

SEO audit finds structural issues, event-tracking wires up measurement

Run seo-audit, fix structural gaps, then event-tracking-skill for GA4 setup.✓ Copied
event-tracking-skill + ecommerce-skill

Ecommerce skill sets up funnels, event-tracking instruments them

Use ecommerce-skill to redesign checkout, then event-tracking to wire purchase events.✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
scan_site url Before any GTM changes Claude tokens
sync_gtm container_id, schema After schema is reviewed 1+ Tag Manager API calls
preview_verify container_id, target_url Before publish 0
publish_version container_id, notes After preview passes 1 API call
audit_container container_id Inheriting an existing GTM 1+ API calls

Cost & Limits

What this costs to run

API quota
GTM Tag Manager API: 250 req / 100s per user; generous for manual setup
Tokens per call
10-30k tokens per full setup
Monetary
Free (GA4 + GTM are free)
Tip
Scope scans to 5-10 key pages to avoid long crawls.

Security

Permissions, secrets, blast radius

Credential storage: Service account JSON in env var or file path. GTM write scope: tagmanager.edit.containers, tagmanager.publish.
Data egress: Site scan reads your URLs; schema is pushed to Google Tag Manager.
Never grant: tagmanager.delete.containers

Troubleshooting

Common errors and fixes

401 Unauthorized on Tag Manager API

Service account not added as a user on the GTM container. Add in GTM Admin → User Management.

Verify: curl -H "Authorization: Bearer $TOKEN" https://tagmanager.googleapis.com/tagmanager/v2/accounts
Preview shows events firing but GA4 DebugView is empty

GA4 config tag missing or sending to wrong measurement ID. Double-check G-XXXXXX in the config tag.

Published version rolls back changes

Another workspace was published after yours. Reconcile both workspaces, merge, republish.

Alternatives

event-tracking-skill vs others

AlternativeWhen to use it insteadTradeoff
Manual GTM setupYou need custom logic the LLM can't safely generateSlower, more error-prone

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills