Analytics & Measurement Skill
Measurement rules for lead generation sites. GTM + GA4 focused.
Core Rules (Non-Negotiable)
- Every conversion MUST have a measurable event — Form submit, phone click, WhatsApp = tracked
- GTM is the only tag container — No inline GA4, no direct scripts
- One GTM container per site — No multiple containers
- Consent before tracking — GDPR: no GA4 until cookie accepted
- Event naming convention MUST be followed — See naming rules below
- Every event MUST have context — Location, element, value where applicable
- Test before deploy — GTM Preview + GA4 DebugView MUST pass
- Production and staging MUST be separated — Different GA4 properties or filtered
Event Types
| Type |
Purpose |
Use as KPI? |
| Conversion |
Business outcome (lead, sale) |
✅ Yes |
| Micro |
Supports 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
| Event |
Trigger |
Page Type |
page_view |
Page load |
All |
scroll_depth |
25%, 50%, 75%, 90% |
All |
cta_click |
CTA button click |
Landing |
phone_click |
tel: link click |
Landing |
whatsapp_click |
WhatsApp link |
Landing |
form_start |
First form interaction |
Landing |
form_submit |
Successful submission |
Landing |
calculator_start |
First step |
Calculator |
calculator_complete |
Result shown |
Calculator |
video_play |
Play clicked |
Video |
See events.md for parameters and implementation.
See gtm-setup.md for GTM container configuration.
Conversions (Mark in GA4)
| Event |
Conversion? |
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
- events.md — Full event documentation
- gtm-setup.md — GTM configuration guide
Conditional
- server-side.md — Cloudflare + sGTM + Ads setup
- debugging.md — Testing and troubleshooting
Definition of Done
Core (Zero Tolerance)
Conversions (MUST fire correctly)
Testing
Server-Side (If Enabled)
1---2name: analytics-measurement3description: 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.4---56# Analytics & Measurement Skill78Measurement rules for lead generation sites. GTM + GA4 focused.910## Core Rules (Non-Negotiable)11121. **Every conversion MUST have a measurable event** — Form submit, phone click, WhatsApp = tracked132. **GTM is the only tag container** — No inline GA4, no direct scripts143. **One GTM container per site** — No multiple containers154. **Consent before tracking** — GDPR: no GA4 until cookie accepted165. **Event naming convention MUST be followed** — See naming rules below176. **Every event MUST have context** — Location, element, value where applicable187. **Test before deploy** — GTM Preview + GA4 DebugView MUST pass198. **Production and staging MUST be separated** — Different GA4 properties or filtered2021## Event Types2223| Type | Purpose | Use as KPI? |24|------|---------|-------------|25| **Conversion** | Business outcome (lead, sale) | ✅ Yes |26| **Micro** | Supports analysis (scroll, click) | ❌ No |2728**Conversion events:** form_submit, phone_click, whatsapp_click, calculator_complete29**Micro events:** cta_click, scroll_depth, video_play, calculator_start3031Only conversion events may be used as primary KPIs. Micro events support optimization, not reporting.3233## Environment Policy3435- Production and staging MUST use separate GA4 properties (or filtered views)36- Staging data MUST NOT pollute production analytics37- Debug mode MUST be disabled in production38- Test events MUST be filtered out before reporting3940## Forbidden (STOP)4142STOP and fix if any of these occur:4344### Implementation45- ❌ GA4/Ads script outside GTM46- ❌ Multiple GTM containers47- ❌ Tracking before consent (GDPR violation)48- ❌ Hardcoded Measurement ID in code49- ❌ Staging data in production property5051### Events52- ❌ Double-firing events (same action = multiple events)53- ❌ Auto-events without explicit need (enhanced measurement spam)54- ❌ Event without naming convention55- ❌ Conversion without event56- ❌ Micro event used as KPI5758### Privacy (Non-Negotiable)59- ❌ PII in event parameters (email, phone, name, address)60- ❌ Tracking without consent where required61- ❌ IP not anonymized (GA4 does this by default)62- ❌ User ID without consent6364### Quality65- ❌ Deploy without GTM Preview test66- ❌ Event names with spaces or capitals67- ❌ Parameters without documentation6869## Event Naming Convention7071**Format:** `[action]_[object]` (lowercase_snake_case)7273- **action**: click, submit, view, start, complete74- **object**: form, cta, video, phone, whatsapp7576**Parameter rules:** lowercase_snake_case, max 40 chars, no PII7778See [events.md](references/events.md) for full event list with parameters.7980## Required Events8182| Event | Trigger | Page Type |83|-------|---------|-----------|84| `page_view` | Page load | All |85| `scroll_depth` | 25%, 50%, 75%, 90% | All |86| `cta_click` | CTA button click | Landing |87| `phone_click` | tel: link click | Landing |88| `whatsapp_click` | WhatsApp link | Landing |89| `form_start` | First form interaction | Landing |90| `form_submit` | Successful submission | Landing |91| `calculator_start` | First step | Calculator |92| `calculator_complete` | Result shown | Calculator |93| `video_play` | Play clicked | Video |9495See [events.md](references/events.md) for parameters and implementation.96See [gtm-setup.md](references/gtm-setup.md) for GTM container configuration.9798## Conversions (Mark in GA4)99100| Event | Conversion? | Send to Ads? |101|-------|-------------|--------------|102| `form_submit` | ✅ Yes | ✅ Yes |103| `phone_click` | ✅ Yes | ✅ Yes |104| `whatsapp_click` | ✅ Yes | ✅ Yes |105| `calculator_complete` | ✅ Yes | ✅ Yes |106| `cta_click` | ❌ No | ❌ No |107| `scroll_depth` | ❌ No | ❌ No |108109## Server-Side Tracking110111For ad blocker bypass and enhanced conversions, use server-side GTM via Cloudflare:112113```114Browser → Web GTM → Cloudflare Worker → sGTM → GA4 + Google Ads115```116117**Requirements:**118- First-party subdomain (e.g., `data.yourdomain.com`)119- Cloudflare Worker as proxy120- Server-Side GTM container121- Enhanced conversions: SHA256 hashed PII only122123See [server-side.md](references/server-side.md) for full implementation.124125## References126127### Required128129- [events.md](references/events.md) — Full event documentation130- [gtm-setup.md](references/gtm-setup.md) — GTM configuration guide131132### Conditional133134- [server-side.md](references/server-side.md) — Cloudflare + sGTM + Ads setup135- [debugging.md](references/debugging.md) — Testing and troubleshooting136137## Definition of Done138139### Core (Zero Tolerance)140- [ ] GTM is only tag container141- [ ] Consent blocks tracking until accepted142- [ ] Staging and production separated143- [ ] 0 double-firing events144- [ ] 0 PII in parameters145- [ ] All events follow naming convention146147### Conversions (MUST fire correctly)148- [ ] `form_submit`, `phone_click`, `whatsapp_click` fire once per action149- [ ] All marked as conversions in GA4150- [ ] Sending to Google Ads (if enabled)151152### Testing153- [ ] All events tested in GTM Preview154- [ ] All events visible in GA4 DebugView155- [ ] GTM container exported as backup156157### Server-Side (If Enabled)158- [ ] Cloudflare Worker + sGTM deployed159- [ ] Enhanced conversions SHA256 hashed