Analytics Tracking
When to Use
Use this skill when you need 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...
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 Assessment
Check for product marketing context first:
If .agents/product-marketing.md exists (or .claude/product-marketing.md, or the legacy product-marketing-context.md filename, in older setups), read it before asking questions. Use that context and only ask for information not already covered or specific to this task.
Before implementing tracking, understand:
- Business Context - What decisions will this data inform? What are key conversions?
- Current State - What tracking exists? What tools are in use?
- Technical Context - What's the tech stack? Any privacy/compliance requirements?
Core Principles
1. Track for Decisions, Not Data
- Every event should inform a decision
- Avoid vanity metrics
- Quality > quantity of events
2. Start with the Questions
- What do you need to know?
- What actions will you take based on this data?
- Work backwards to what you need to track
3. Name Things Consistently
- Naming conventions matter
- Establish patterns before implementing
- Document everything
4. Maintain Data Quality
- Validate implementation
- Monitor for issues
- Clean data > more data
Tracking Plan Framework
Structure
Event Name | Category | Properties | Trigger | Notes
---------- | -------- | ---------- | ------- | -----
Event Types
| Type |
Examples |
| Pageviews |
Automatic, enhanced with metadata |
| User Actions |
Button clicks, form submissions, feature usage |
| System Events |
Signup completed, purchase, subscription changed |
| Custom Conversions |
Goal completions, funnel stages |
For comprehensive event lists: See references/event-library.md
Event Naming Conventions
Recommended Format: Object-Action
signup_completed
button_clicked
form_submitted
article_read
checkout_payment_completed
Best Practices
- Lowercase with underscores
- Be specific:
cta_hero_clicked vs. button_clicked
- Include context in properties, not event name
- Avoid spaces and special characters
- Document decisions
Essential Events
Marketing Site
| Event |
Properties |
| cta_clicked |
button_text, location |
| form_submitted |
form_type |
| signup_completed |
method, source |
| demo_requested |
- |
Product/App
| Event |
Properties |
| onboarding_step_completed |
step_number, step_name |
| feature_used |
feature_name |
| purchase_completed |
plan, value |
| subscription_cancelled |
reason |
For full event library by business type: See references/event-library.md
Event Properties
Standard Properties
| Category |
Properties |
| Page |
page_title, page_location, page_referrer |
| User |
user_id, user_type, account_id, plan_type |
| Campaign |
source, medium, campaign, content, term |
| Product |
product_id, product_name, category, price |
Best Practices
- Use consistent property names
- Include relevant context
- Don't duplicate automatic properties
- Avoid PII in properties
GA4 Implementation
Quick Setup
- Create GA4 property and data stream
- Install gtag.js or GTM
- Enable enhanced measurement
- Configure custom events
- Mark conversions in Admin
Custom Event Example
gtag('event', 'signup_completed', {
'method': 'email',
'plan': 'free'
});
For detailed GA4 implementation: See references/ga4-implementation.md
Google Tag Manager
Container Structure
| Component |
Purpose |
| Tags |
Code that executes (GA4, pixels) |
| Triggers |
When tags fire (page view, click) |
| Variables |
Dynamic values (click text, data layer) |
Data Layer Pattern
dataLayer.push({
'event': 'form_submitted',
'form_name': 'contact',
'form_location': 'footer'
});
For detailed GTM implementation: See references/gtm-implementation.md
UTM Parameter Strategy
Standard Parameters
| Parameter |
Purpose |
Example |
| utm_source |
Traffic source |
google, newsletter |
| utm_medium |
Marketing medium |
cpc, email, social |
| utm_campaign |
Campaign name |
spring_sale |
| utm_content |
Differentiate versions |
hero_cta |
| utm_term |
Paid search keywords |
running+shoes |
Naming Conventions
- Lowercase everything
- Use underscores or hyphens consistently
- Be specific but concise:
blog_footer_cta, not cta1
- Document all UTMs in a spreadsheet
Debugging and Validation
Testing Tools
| Tool |
Use For |
| GA4 DebugView |
Real-time event monitoring |
| GTM Preview Mode |
Test triggers before publish |
| Browser Extensions |
Tag Assistant, dataLayer Inspector |
Validation Checklist
Common Issues
| Issue |
Check |
| Events not firing |
Trigger config, GTM loaded |
| Wrong values |
Variable path, data layer structure |
| Duplicate events |
Multiple containers, trigger firing twice |
Privacy and Compliance
Considerations
- Cookie consent required in EU/UK/CA
- No PII in analytics properties
- Data retention settings
- User deletion capabilities
Implementation
- Use consent mode (wait for consent)
- IP anonymization
- Only collect what you need
- Integrate with consent management platform
Output Format
Tracking Plan Document
# [Site/Product] Tracking Plan
## Overview
- Tools: GA4, GTM
- Last updated: [Date]
## Events
| Event Name | Description | Properties | Trigger |
|------------|-------------|------------|---------|
| signup_completed | User completes signup | method, plan | Success page |
## Custom Dimensions
| Name | Scope | Parameter |
|------|-------|-----------|
| user_type | User | user_type |
## Conversions
| Conversion | Event | Counting |
|------------|-------|----------|
| Signup | signup_completed | Once per session |
Task-Specific Questions
- What tools are you using (GA4, Mixpanel, etc.)?
- What key actions do you want to track?
- What decisions will this data inform?
- Who implements - dev team or marketing?
- Are there privacy/consent requirements?
- What's already tracked?
Tool Integrations
For implementation, see the tools registry. Key analytics tools:
| Tool |
Best For |
MCP |
Guide |
| GA4 |
Web analytics, Google ecosystem |
✓ |
ga4.md |
| Mixpanel |
Product analytics, event tracking |
- |
mixpanel.md |
| Amplitude |
Product analytics, cohort analysis |
- |
amplitude.md |
| PostHog |
Open-source analytics, session replay |
- |
posthog.md |
| Segment |
Customer data platform, routing |
- |
segment.md |
Related Skills
- ab-testing: For experiment tracking
- seo-audit: For organic traffic analysis
- cro: For conversion optimization (uses this data)
- revops: For pipeline metrics, CRM tracking, and revenue attribution
Limitations
- Use this skill only when the task clearly matches its upstream source and local project context.
- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
1---2name: analytics3description: 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...4risk: unknown5source: https://github.com/coreyhaines31/marketingskills/tree/main/skills/analytics6source_repo: coreyhaines31/marketingskills7source_type: community8date_added: 2026-07-019license: MIT10license_source: https://github.com/coreyhaines31/marketingskills/blob/main/LICENSE11metadata:12 source: https://skillmd.com/skills/antigravity/analytics13---1415# Analytics Tracking16## When to Use1718Use this skill when you need 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...192021You 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.2223## Initial Assessment2425**Check for product marketing context first:**26If `.agents/product-marketing.md` exists (or `.claude/product-marketing.md`, or the legacy `product-marketing-context.md` filename, in older setups), read it before asking questions. Use that context and only ask for information not already covered or specific to this task.2728Before implementing tracking, understand:29301. **Business Context** - What decisions will this data inform? What are key conversions?312. **Current State** - What tracking exists? What tools are in use?323. **Technical Context** - What's the tech stack? Any privacy/compliance requirements?3334---3536## Core Principles3738### 1. Track for Decisions, Not Data39- Every event should inform a decision40- Avoid vanity metrics41- Quality > quantity of events4243### 2. Start with the Questions44- What do you need to know?45- What actions will you take based on this data?46- Work backwards to what you need to track4748### 3. Name Things Consistently49- Naming conventions matter50- Establish patterns before implementing51- Document everything5253### 4. Maintain Data Quality54- Validate implementation55- Monitor for issues56- Clean data > more data5758---5960## Tracking Plan Framework6162### Structure6364```65Event Name | Category | Properties | Trigger | Notes66---------- | -------- | ---------- | ------- | -----67```6869### Event Types7071| Type | Examples |72|------|----------|73| Pageviews | Automatic, enhanced with metadata |74| User Actions | Button clicks, form submissions, feature usage |75| System Events | Signup completed, purchase, subscription changed |76| Custom Conversions | Goal completions, funnel stages |7778**For comprehensive event lists**: See [references/event-library.md](references/event-library.md)7980---8182## Event Naming Conventions8384### Recommended Format: Object-Action8586```87signup_completed88button_clicked89form_submitted90article_read91checkout_payment_completed92```9394### Best Practices95- Lowercase with underscores96- Be specific: `cta_hero_clicked` vs. `button_clicked`97- Include context in properties, not event name98- Avoid spaces and special characters99- Document decisions100101---102103## Essential Events104105### Marketing Site106107| Event | Properties |108|-------|------------|109| cta_clicked | button_text, location |110| form_submitted | form_type |111| signup_completed | method, source |112| demo_requested | - |113114### Product/App115116| Event | Properties |117|-------|------------|118| onboarding_step_completed | step_number, step_name |119| feature_used | feature_name |120| purchase_completed | plan, value |121| subscription_cancelled | reason |122123**For full event library by business type**: See [references/event-library.md](references/event-library.md)124125---126127## Event Properties128129### Standard Properties130131| Category | Properties |132|----------|------------|133| Page | page_title, page_location, page_referrer |134| User | user_id, user_type, account_id, plan_type |135| Campaign | source, medium, campaign, content, term |136| Product | product_id, product_name, category, price |137138### Best Practices139- Use consistent property names140- Include relevant context141- Don't duplicate automatic properties142- Avoid PII in properties143144---145146## GA4 Implementation147148### Quick Setup1491501. Create GA4 property and data stream1512. Install gtag.js or GTM1523. Enable enhanced measurement1534. Configure custom events1545. Mark conversions in Admin155156### Custom Event Example157158```javascript159gtag('event', 'signup_completed', {160 'method': 'email',161 'plan': 'free'162});163```164165**For detailed GA4 implementation**: See [references/ga4-implementation.md](references/ga4-implementation.md)166167---168169## Google Tag Manager170171### Container Structure172173| Component | Purpose |174|-----------|---------|175| Tags | Code that executes (GA4, pixels) |176| Triggers | When tags fire (page view, click) |177| Variables | Dynamic values (click text, data layer) |178179### Data Layer Pattern180181```javascript182dataLayer.push({183 'event': 'form_submitted',184 'form_name': 'contact',185 'form_location': 'footer'186});187```188189**For detailed GTM implementation**: See [references/gtm-implementation.md](references/gtm-implementation.md)190191---192193## UTM Parameter Strategy194195### Standard Parameters196197| Parameter | Purpose | Example |198|-----------|---------|---------|199| utm_source | Traffic source | google, newsletter |200| utm_medium | Marketing medium | cpc, email, social |201| utm_campaign | Campaign name | spring_sale |202| utm_content | Differentiate versions | hero_cta |203| utm_term | Paid search keywords | running+shoes |204205### Naming Conventions206- Lowercase everything207- Use underscores or hyphens consistently208- Be specific but concise: `blog_footer_cta`, not `cta1`209- Document all UTMs in a spreadsheet210211---212213## Debugging and Validation214215### Testing Tools216217| Tool | Use For |218|------|---------|219| GA4 DebugView | Real-time event monitoring |220| GTM Preview Mode | Test triggers before publish |221| Browser Extensions | Tag Assistant, dataLayer Inspector |222223### Validation Checklist224225- [ ] Events firing on correct triggers226- [ ] Property values populating correctly227- [ ] No duplicate events228- [ ] Works across browsers and mobile229- [ ] Conversions recorded correctly230- [ ] No PII leaking231232### Common Issues233234| Issue | Check |235|-------|-------|236| Events not firing | Trigger config, GTM loaded |237| Wrong values | Variable path, data layer structure |238| Duplicate events | Multiple containers, trigger firing twice |239240---241242## Privacy and Compliance243244### Considerations245- Cookie consent required in EU/UK/CA246- No PII in analytics properties247- Data retention settings248- User deletion capabilities249250### Implementation251- Use consent mode (wait for consent)252- IP anonymization253- Only collect what you need254- Integrate with consent management platform255256---257258## Output Format259260### Tracking Plan Document261262```markdown263# [Site/Product] Tracking Plan264265## Overview266- Tools: GA4, GTM267- Last updated: [Date]268269## Events270271| Event Name | Description | Properties | Trigger |272|------------|-------------|------------|---------|273| signup_completed | User completes signup | method, plan | Success page |274275## Custom Dimensions276277| Name | Scope | Parameter |278|------|-------|-----------|279| user_type | User | user_type |280281## Conversions282283| Conversion | Event | Counting |284|------------|-------|----------|285| Signup | signup_completed | Once per session |286```287288---289290## Task-Specific Questions2912921. What tools are you using (GA4, Mixpanel, etc.)?2932. What key actions do you want to track?2943. What decisions will this data inform?2954. Who implements - dev team or marketing?2965. Are there privacy/consent requirements?2976. What's already tracked?298299---300301## Tool Integrations302303For implementation, see the [tools registry](https://github.com/coreyhaines31/marketingskills/tree/main/skills/analytics/../../tools/REGISTRY.md). Key analytics tools:304305| Tool | Best For | MCP | Guide |306|------|----------|:---:|-------|307| **GA4** | Web analytics, Google ecosystem | ✓ | [ga4.md](https://github.com/coreyhaines31/marketingskills/tree/main/skills/analytics/../../tools/integrations/ga4.md) |308| **Mixpanel** | Product analytics, event tracking | - | [mixpanel.md](https://github.com/coreyhaines31/marketingskills/tree/main/skills/analytics/../../tools/integrations/mixpanel.md) |309| **Amplitude** | Product analytics, cohort analysis | - | [amplitude.md](https://github.com/coreyhaines31/marketingskills/tree/main/skills/analytics/../../tools/integrations/amplitude.md) |310| **PostHog** | Open-source analytics, session replay | - | [posthog.md](https://github.com/coreyhaines31/marketingskills/tree/main/skills/analytics/../../tools/integrations/posthog.md) |311| **Segment** | Customer data platform, routing | - | [segment.md](https://github.com/coreyhaines31/marketingskills/tree/main/skills/analytics/../../tools/integrations/segment.md) |312313---314315## Related Skills316317- **ab-testing**: For experiment tracking318- **seo-audit**: For organic traffic analysis319- **cro**: For conversion optimization (uses this data)320- **revops**: For pipeline metrics, CRM tracking, and revenue attribution321322## Limitations323324- Use this skill only when the task clearly matches its upstream source and local project context.325- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.326- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.