Skip to main content
AC
Marketing & Growth5.2 KBMIT licensed

analytics

Rewritten from patterns in the Corey Haines marketing-skills pack (MIT)

Set up, improve, or audit analytics tracking and measurement. Use when the user mentions GA4, Google Analytics, GTM, tag manager, conversion tracking, event tracking, UTM parameters, tracking plan, Mixpanel, Segment, attribution, "are my events firing", or "how do I measure this". Not for experiment design or A/B test measurement: use ab-testing. Not for organic traffic analysis: use seo-audit. Not for conversion optimization work that consumes this data: use cro.

  • analytics

SKILL.md

Analytics Tracking

Track for decisions, not data. Every event must inform a decision someone will actually make. Start from the questions, work backwards to the events, and keep the plan documented. Clean data beats more data.

Before implementing

If a product marketing context file exists (.agents/product-marketing.md or .claude/product-marketing.md), read it first. Then confirm three things:

  1. Business context. What decisions will this data inform? What counts as a conversion?
  2. Current state. What tracking exists, in which tools, and is it trusted?
  3. Technical context. Stack, who implements (dev or marketing), privacy and consent requirements.

Workflow

  1. Write the questions. "Which channel drives signups that retain?" beats "track everything".
  2. Draft the tracking plan. One row per event: name, description, properties, trigger. This document is the contract between marketing and engineering.
  3. Fix naming before code. Object-action format, lowercase with underscores: signup_completed, cta_hero_clicked, form_submitted. Context goes in properties, not in the event name. No spaces, no special characters.
  4. Implement. GA4 direct or through GTM with a dataLayer. Read references/implementation.md when writing GA4 events, GTM triggers, or UTM conventions.
  5. Validate before trusting. DebugView, GTM preview mode, real devices. See Verification below.
  6. Mark conversions and document. Conversions configured in the tool, plan updated, UTM registry started.

Minimum viable event set

SurfaceEvents
Marketing sitecta_clicked (button_text, location), form_submitted (form_type), signup_completed (method, source), demo_requested
Productonboarding_step_completed (step_number, step_name), feature_used (feature_name), purchase_completed (plan, value), subscription_cancelled (reason)

Standard property groups: page (title, location, referrer), user (user_id, plan_type, never PII), campaign (source, medium, campaign, content, term), product (id, name, category, price).

Privacy rules

  • Cookie consent required in EU/UK/CA. Use consent mode: tags wait for consent.
  • No PII in event properties. No emails, no names, no free-text fields users typed into.
  • Collect only what maps to a decision. Set data retention deliberately.

Good vs bad

Bad: button_clicked fired on every button, with the page URL stuffed into the event name (button_clicked_pricing_page_hero). Unqueryable, unbounded cardinality, no decision attached.

Good: cta_clicked with properties {button_text: "Start trial", location: "pricing_hero"}. One event, filterable by property, directly answers "which CTA placement converts".

Verification

Open GA4 DebugView (or the tool's live event stream), then perform each key action on the site yourself. Expect: each action fires exactly one event, with the documented name, and every property populated with the expected value. If an event is missing, check the trigger config and that GTM/gtag actually loads on that page. If an event fires twice, look for duplicate containers or a trigger firing on both click and submit. If a property is empty, check the dataLayer variable path.

Completion checklist

  • [ ] Tracking plan documented: every event with properties and trigger
  • [ ] Naming convention stated and followed (object_action, lowercase, underscores)
  • [ ] Each key action verified live in DebugView or equivalent
  • [ ] No duplicate events, no empty properties
  • [ ] Conversions marked in the tool
  • [ ] No PII in any property
  • [ ] Consent mode wired where legally required
  • [ ] UTM conventions documented in a shared registry

Any box unchecked: not done. Fix or say so.

Footguns

  • Shipping tracking without a plan document. Six months later nobody knows what event_7 means or trusts the numbers. Fix: the plan doc is a deliverable, written before implementation and updated with every change.
  • Duplicate events from stacked containers. A hardcoded gtag snippet plus a GTM tag doubles every count and quietly inflates conversion rates. Fix: one installation path; audit with Tag Assistant before launch.
  • Inconsistent UTMs. Facebook, facebook, and fb become three sources and attribution turns to noise. Fix: lowercase everything, one documented spreadsheet of live UTMs, reject links that break the convention.
  • Vanity events. Scroll depth on every page, hover tracking, events nobody queries. They cost quota and drown signal. Fix: for each event, name the decision it informs. No decision, no event.

Reference files

More in Marketing & Growth

All skills