Claude-skill-registry analytics-measurement

Analytics and conversion tracking for lead generation websites. Use when implementing GTM, GA4, or any measurement. Works with astro-architecture for GTM setup. No CRO mérés nélkül vakrepülés.

install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/analytics-measurement" ~/.claude/skills/majiayu000-claude-skill-registry-analytics-measurement && rm -rf "$T"
manifest: skills/data/analytics-measurement/SKILL.md
source content

Analytics & Measurement Skill

Measurement rules for lead generation sites. GTM + GA4 focused.

Core Rules (Non-Negotiable)

  1. Every conversion MUST have a measurable event — Form submit, phone click, WhatsApp = tracked
  2. GTM is the only tag container — No inline GA4, no direct scripts
  3. One GTM container per site — No multiple containers
  4. Consent before tracking — GDPR: no GA4 until cookie accepted
  5. Event naming convention MUST be followed — See naming rules below
  6. Every event MUST have context — Location, element, value where applicable
  7. Test before deploy — GTM Preview + GA4 DebugView MUST pass
  8. Production and staging MUST be separated — Different GA4 properties or filtered

Event Types

TypePurposeUse as KPI?
ConversionBusiness outcome (lead, sale)✅ Yes
MicroSupports analysis (scroll, click)❌ No

Conversion events: form_submit, phone_click, whatsapp_click, calculator_complete Micro events: cta_click, scroll_depth, video_play, calculator_start

Only conversion events may be used as primary KPIs. Micro events support optimization, not reporting.

Environment Policy

  • Production and staging MUST use separate GA4 properties (or filtered views)
  • Staging data MUST NOT pollute production analytics
  • Debug mode MUST be disabled in production
  • Test events MUST be filtered out before reporting

Forbidden (STOP)

STOP and fix if any of these occur:

Implementation

  • ❌ GA4/Ads script outside GTM
  • ❌ Multiple GTM containers
  • ❌ Tracking before consent (GDPR violation)
  • ❌ Hardcoded Measurement ID in code
  • ❌ Staging data in production property

Events

  • ❌ Double-firing events (same action = multiple events)
  • ❌ Auto-events without explicit need (enhanced measurement spam)
  • ❌ Event without naming convention
  • ❌ Conversion without event
  • ❌ Micro event used as KPI

Privacy (Non-Negotiable)

  • ❌ PII in event parameters (email, phone, name, address)
  • ❌ Tracking without consent where required
  • ❌ IP not anonymized (GA4 does this by default)
  • ❌ User ID without consent

Quality

  • ❌ Deploy without GTM Preview test
  • ❌ Event names with spaces or capitals
  • ❌ Parameters without documentation

Event Naming Convention

Format:

[action]_[object]
(lowercase_snake_case)

  • action: click, submit, view, start, complete
  • object: form, cta, video, phone, whatsapp

Parameter rules: lowercase_snake_case, max 40 chars, no PII

See events.md for full event list with parameters.

Required Events

EventTriggerPage Type
page_view
Page loadAll
scroll_depth
25%, 50%, 75%, 90%All
cta_click
CTA button clickLanding
phone_click
tel: link clickLanding
whatsapp_click
WhatsApp linkLanding
form_start
First form interactionLanding
form_submit
Successful submissionLanding
calculator_start
First stepCalculator
calculator_complete
Result shownCalculator
video_play
Play clickedVideo

See events.md for parameters and implementation. See gtm-setup.md for GTM container configuration.

Conversions (Mark in GA4)

EventConversion?Send to Ads?
form_submit
✅ Yes✅ Yes
phone_click
✅ Yes✅ Yes
whatsapp_click
✅ Yes✅ Yes
calculator_complete
✅ Yes✅ Yes
cta_click
❌ No❌ No
scroll_depth
❌ No❌ No

Server-Side Tracking

For ad blocker bypass and enhanced conversions, use server-side GTM via Cloudflare:

Browser → Web GTM → Cloudflare Worker → sGTM → GA4 + Google Ads

Requirements:

  • First-party subdomain (e.g.,
    data.yourdomain.com
    )
  • Cloudflare Worker as proxy
  • Server-Side GTM container
  • Enhanced conversions: SHA256 hashed PII only

See server-side.md for full implementation.

References

Required

Conditional

Definition of Done

Core (Zero Tolerance)

  • GTM is only tag container
  • Consent blocks tracking until accepted
  • Staging and production separated
  • 0 double-firing events
  • 0 PII in parameters
  • All events follow naming convention

Conversions (MUST fire correctly)

  • form_submit
    ,
    phone_click
    ,
    whatsapp_click
    fire once per action
  • All marked as conversions in GA4
  • Sending to Google Ads (if enabled)

Testing

  • All events tested in GTM Preview
  • All events visible in GA4 DebugView
  • GTM container exported as backup

Server-Side (If Enabled)

  • Cloudflare Worker + sGTM deployed
  • Enhanced conversions SHA256 hashed