Analytics Tracking
Set up GA4, GTM, and event tracking that actually informs decisions — not vanity metrics.
Most teams have analytics installed but no answers. Events fire inconsistently, naming conventions drift, and nobody trusts the numbers. A clean tracking plan turns analytics from a graveyard of dashboards into a tool that drives marketing decisions.
Who it's for: marketing operations, growth marketers, product managers, founders setting up GA4 and GTM, analytics implementers
Example
"Build a tracking plan for our SaaS marketing site" → Object-action event taxonomy, GA4 + GTM implementation guide, UTM strategy, validation checklist, and a tracking plan document ready to hand to engineering
CLAUDE.md Template
New here? 3-minute setup guide → | Already set up? Copy the template below.
npx ccplaybooks add analytics-tracking---
name: analytics-tracking
description: When the user wants to set up, improve, or audit analytics tracking and measurement. Also use when the user mentions "set up tracking," "GA4," "Google Analytics," "conversion tracking," "event tracking," "UTM parameters," "tag manager," "GTM," "analytics implementation," "tracking plan," "how do I measure this," "track conversions," "attribution," "Mixpanel," "Segment," "are my events firing," or "analytics isn't working." Use this whenever someone asks how to know if something is working or wants to measure marketing results. For A/B test measurement, see ab-test-setup.
metadata:
version: 1.1.0
---
# Analytics Tracking
You are an expert in analytics implementation and measurement. Your goal is to help set up tracking that provides actionable insights for marketing and product decisions.
## Initial AssessmentGet new playbooks like this one
One email a week with new Claude Code workflows. Free, like everything here.
No spam. Unsubscribe anytime.
What This Does
Helps you design and implement a tracking plan grounded in business decisions — choosing the right events, naming them consistently, configuring GA4 and GTM, validating the implementation, and setting up UTM conventions that survive contact with reality.
Quick Start
Step 1: Create a Project Folder
Create a dedicated folder for this workflow (e.g. ~/marketing/analytics-tracking).
Step 2: Download the Template
Click Download above and save the file as CLAUDE.md in that folder.
Step 3: Run the Workflow
Open the folder in Claude Code and describe what you need to measure. Claude will work backwards from the decisions to a clean event schema.
Inputs You'll Need
- Business context — what decisions will this data inform; what are the key conversions
- Current state — what tracking exists, what tools are in use
- Tech stack — site/app platform, dev resources, privacy/compliance requirements
- Tools — GA4, Mixpanel, Amplitude, PostHog, Segment
How It Works
- Start with the questions you need answered, then work backwards to events
- Apply object-action naming conventions (
signup_completed,cta_clicked) - Define essential events for marketing site and product/app, with standard properties
- Configure GA4 (property, data stream, enhanced measurement, custom events, conversions)
- Set up GTM container with tags, triggers, variables, and a clean data layer
- Define UTM conventions and document them in a single source of truth
- Validate with DebugView, GTM Preview Mode, and a tag-firing checklist
What You Get
- Tracking plan document with event names, descriptions, properties, and triggers
- GA4 implementation guide and gtag.js examples
- GTM container structure with data layer pattern
- UTM parameter strategy with naming rules
- Debugging and validation checklist
- Privacy and consent considerations (cookie consent, IP anonymization, consent mode)
Tips & Best Practices
- Track for decisions, not data — every event should inform an action. Quality over quantity.
- Be specific in event names —
cta_hero_clickedbeats genericbutton_clicked - Keep context in properties, not event names — easier to filter, easier to evolve
- Avoid PII in analytics properties — bake privacy in from day one
- Validate before publishing — DebugView and GTM Preview catch most issues in 5 minutes