# analytics-tracking-automation

A skill that walks the agent through analytics setup: crawl the site, design GA4 events, sync them into GTM, verify in preview, publish the container.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2000 installs · ★ 5
- Author: reason-machines
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/data-skills/tree/HEAD/skills/analytics-tracking-automation/SKILL.md
- Updated: 2026-10-09
- HTML: https://affpapa.org/en/nevibecode/skills/analytics-tracking-automation

## What it does

The skill hands the agent a six-stage workflow. It crawls the site and sorts pages by purpose — product, pricing, contact. From that it builds a GA4 event schema with parameters and triggers, pushes it into a Google Tag Manager container over the API, runs Playwright checks against preview mode, and publishes the container version once those checks pass.

The `event-tracking` CLI drives all of it, with `init`, `resume`, `audit`, `sync`, `verify` and `publish`. Every run writes an artifact folder: `site-analysis.json`, `page-groups.json`, `event-schema.json`, `verification-report.json`, `checkpoint.json`. You can edit those files and pick up from the last checkpoint instead of starting over. Shopify storefronts get their own mode covering cart, checkout and purchase events.

Syncing to GTM needs Google OAuth credentials — `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` — and the redirect URI has to be `http://localhost:3000/oauth/callback`. Skip that and `sync` stops there. Node.js 18+ is required, and Playwright Chromium installs on the first `npm install`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/data-skills --skill analytics-tracking-automation -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/analytics-tracking-automation/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/analytics-tracking-automation/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/data-skills --skill analytics-tracking-automation -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/analytics-tracking-automation/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/data-skills --skill analytics-tracking-automation -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/analytics-tracking-automation/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/data-skills analytics-tracking-automation
```

2. **Manually: put the files in place**
- File: `.github/skills/analytics-tracking-automation/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/data-skills --skill analytics-tracking-automation -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/data-skills --path skills/analytics-tracking-automation
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/analytics-tracking-automation/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/data-skills --skill analytics-tracking-automation -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/data-skills/tree/HEAD/skills/analytics-tracking-automation/SKILL.md

## When to use it
- plan GA4 events around how a specific site is built
- compare a live GTM container against a recommended tracking plan
- create GTM tags, triggers and variables without clicking through the UI
- check that events fire in preview before anything goes live
- set up cart and purchase events for a Shopify store

## Example prompts
- Analyze https://www.example.com and draft a GTM tracking plan for it
- Generate a GA4 event schema and sync it to my GTM container
- Audit my GTM container and show where it drifts from the plan

## Similar
- [seo-audit](https://affpapa.org/en/nevibecode/skills/coreyhaines31-seo-audit.md) — skill · 237600 installs
- [programmatic-seo](https://affpapa.org/en/nevibecode/skills/coreyhaines31-programmatic-seo.md) — skill · 149700 installs
- [copy-editing](https://affpapa.org/en/nevibecode/skills/coreyhaines31-copy-editing.md) — skill · 149100 installs
- [marketing-ideas](https://affpapa.org/en/nevibecode/skills/coreyhaines31-marketing-ideas.md) — skill · 146900 installs
- [sales-enablement](https://affpapa.org/en/nevibecode/skills/sales-enablement.md) — skill · 118800 installs
- [revops](https://affpapa.org/en/nevibecode/skills/revops.md) — skill · 113500 installs

From the same set: [reason-machines/data-skills](https://affpapa.org/en/nevibecode/by/reason-machines/data-skills.md) — 31 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
