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 Con
1---2name: analytics3description: When the user wants to set up, improve, or audit analytics tracking and measurement. 4category: Document Processing5source: antigravity6tags: [javascript, markdown, mcp, claude, ai, agent, document, spreadsheet, security, seo]7url: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/analytics8metadata:9 source: https://skillmd.com/skills/sickn33/analytics10---111213# Analytics Tracking14## When to Use1516Use 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...171819You 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.2021## Initial Assessment2223**Check for product marketing context first:**24If `.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.2526Before implementing tracking, understand:27281. **Business Context** - What decisions will this data inform? What are key conversions?292. **Current State** - What tracking exists? What tools are in use?303. **Technical Context** - What's the tech stack? Any privacy/compliance requirements?3132---3334## Core Principles3536### 1. Track for Decisions, Not Data37- Every event should inform a decision38- Avoid vanity metrics39- Quality > quantity of events4041### 2. Start with the Questions42- What do you need to know?43- What actions will you take based on this data?44- Work backwards to what you need to track4546### 3. Name Things Consistently47- Naming conventions matter48- Establish patterns before implementing49- Document everything5051### 4. Maintain Data Quality52- Validate implementation53- Monitor for issues54- Clean data > more data5556---5758## Tracking Plan Framework5960### Structure6162```63Event Name | Category | Properties | Trigger | Notes64---------- | -------- | ---------- | ------- | -----65```6667### Event Types6869| Type | Examples |70|------|----------|71| Pageviews | Automatic, enhanced with metadata |72| User Actions | Button clicks, form submissions, feature usage |73| System Events | Signup completed, purchase, subscription changed |74| Custom Conversions | Goal completions, funnel stages |7576**For comprehensive event lists**: See [references/event-library.md](references/event-library.md)7778---7980## Event Naming Conventions8182### Recommended Format: Object-Action8384```85signup_completed86button_clicked87form_submitted88article_read89checkout_payment_completed90```9192### Best Practices93- Lowercase with underscores94- Be specific: `cta_hero_clicked` vs. `button_clicked`95- Include context in properties, not event name96- Avoid spaces and special characters97- Document decisions9899---100101## Essential Events102103### Marketing Site104105| Event | Properties |106|-------|------------|107| cta_clicked | button_text, location |108| form_submitted | form_type |109| signup_completed | method, source |110| demo_requested | - |111112### Product/App113114| Event | Properties |115|-------|------------|116| onboarding_step_completed | step_number, step_name |117| feature_used | feature_name |118| purchase_completed | plan, value |119| subscription_cancelled | reason |120121**For full event library by business type**: See [references/event-library.md](references/event-library.md)122123---124125## Event Properties126127### Standard Properties128129| Category | Properties |130|----------|------------|131| Page | page_title, page_location, page_referrer |132| User | user_id, user_type, account_id, plan_type |133| Campaign | source, medium, campaign, content, term |134| Product | product_id, product_name, category, price |135136### Best Practices137- Use consistent property names138- Include relevant context139- Don't duplicate automatic properties140- Avoid PII in properties141142---143144## GA4 Implementation145146### Quick Setup1471481. Create GA4 property and data stream1492. Install gtag.js or GTM1503. Enable enhanced measurement1514. Configure custom events1525. Mark conversions in Admin153154### Custom Event Example155156```javascript157gtag('event', 'signup_completed', {158 'method': 'email',159 'plan': 'free'160});161```162163**For detailed GA4 implementation**: See [references/ga4-implementation.md](references/ga4-implementation.md)164165---166167## Google Tag Manager168169### Container Structure170171| Component | Purpose |172|-----------|---------|173| Tags | Code that executes (GA4, pixels) |174| Triggers | When tags fire (page view, click) |175| Variables | Dynamic values (click text, data layer) |176177### Data Layer Pattern178179```javascript180dataLayer.push({181 'event': 'form_submitted',182 'form_name': 'contact',183 'form_location': 'footer'184});185```186187**For detailed GTM implementation**: See [references/gtm-implementation.md](references/gtm-implementation.md)188189---190191## UTM Parameter Strategy192193### Standard Parameters194195| Parameter | Purpose | Example |196|-----------|---------|---------|197| utm_source | Traffic source | google, newsletter |198| utm_medium | Marketing medium | cpc, email, social |199| utm_campaign | Campaign name | spring_sale |200| utm_content | Differentiate versions | hero_cta |201| utm_term | Paid search keywords | running+shoes |202203### Naming Con