Analytics 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
Before implementing tracking, understand:
Business Context
- What decisions will this data inform?
- What are the key conversion actions?
- What questions need answering?
Current State
- What tracking exists?
- What tools are in use (GA4, Mixpanel, Amplitude, etc.)?
- What's working/not working?
Technical Context
- What's the tech stack?
- Who will implement and maintain?
- 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 | Event Category | Properties | Trigger | Notes
---------- | ------------- | ---------- | ------- | -----
Event Types
Pageviews
- Automatic in most tools
- Enhanced with page metadata
User Actions
- Button clicks
- Form submissions
- Feature usage
- Content interactions
System Events
- Signup completed
- Purchase completed
- Subscription changed
- Errors occurred
Custom Conversions
- Goal completions
- Funnel stages
- Business-specific milestones
Event Naming Conventions
Format Options
Object-Action (Recommended)
signup_completed
button_clicked
form_submitted
article_read
Action-Object
click_button
submit_form
complete_signup
Category_Object_Action
checkout_payment_completed
blog_article_viewed
onboarding_step_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 to Track
Marketing Site
Navigation
- page_view (enhanced)
- outbound_link_clicked
- scroll_depth (25%, 50%, 75%, 100%)
Engagement
- cta_clicked (button_text, location)
- video_played (video_id, duration)
- form_started
- form_submitted (form_type)
- resource_downloaded (resource_name)
Conversion
- signup_started
- signup_completed
- demo_requested
- contact_submitted
Product/App
Onboarding
- signup_completed
- onboarding_step_completed (step_number, step_name)
- onboarding_completed
- first_key_action_completed
Core Usage
- feature_used (feature_name)
- action_completed (action_type)
- session_started
- session_ended
Monetization
- trial_started
- pricing_viewed
- checkout_started
- purchase_completed (plan, value)
- subscription_cancelled
E-commerce
Browsing
- product_viewed (product_id, category, price)
- product_list_viewed (list_name, products)
- product_searched (query, results_count)
Cart
- product_added_to_cart
- product_removed_from_cart
- cart_viewed
Checkout
- checkout_started
- checkout_step_completed (step)
- payment_info_entered
- purchase_completed (order_id, value, products)
Event Properties (Parameters)
Standard Properties to Consider
Page/Screen
- page_title
- page_location (URL)
- page_referrer
- content_group
User
- user_id (if logged in)
- user_type (free, paid, admin)
- account_id (B2B)
- plan_type
Campaign
- source
- medium
- campaign
- content
- term
Product (e-commerce)
- product_id
- product_name
- category
- price
- quantity
- currency
Timing
- timestamp
- session_duration
- time_on_page
Best Practices
- Use consistent property names
- Include relevant context
- Don't duplicate GA4 automatic properties
- Avoid PII in properties
- Document expected values
GA4 Implementation
Configuration
Data Streams
- One stream per platform (web, iOS, Android)
- Enable enhanced measurement
Enhanced Measurement Events
- page_view (automatic)
- scroll (90% depth)
- outbound_click
- site_search
- video_engagement
- file_download
Recommended Events
Custom Events (GA4)
// gtag.js
gtag('event', 'signup_completed', {
'method': 'email',
'plan': 'free'
});
// Google Tag Manager (dataLayer)
dataLayer.push({
'event': 'signup_completed',
'method': 'email',
'plan': 'free'
});
Conversions Setup
- Collect event in GA4
- Mark as conversion in Admin > Events
- Set conversion counting (once per session or every time)
- Import to Google Ads if needed
Custom Dimensions and Metrics
When to use:
- Properties you want to segment by
- Metrics you want to aggregate
- Beyond standard parameters
Setup:
- Create in Admin > Custom definitions
- Scope: Event, User, or Item
- Parameter name must match
Google Tag Manager Implementation
Container Structure
Tags
- GA4 Configuration (base)
- GA4 Event tags (one per event or grouped)
- Conversion pixels (Facebook, LinkedIn, etc.)
Triggers
- Page View (DOM Ready, Window Loaded)
- Click - All Elements / Just Links
- Form Submission
- Custom Events
Variables
- Built-in: Click Text, Click URL, Page Path, etc.
- Data Layer variables
- JavaScript variables
- Lookup tables
Best Practices
- Use folders to organize
- Consistent naming (Tag_Type_Description)
- Version notes on every publish
- Preview mode for testing
- Workspaces for team collaboration
Data Layer Pattern
// Push custom event
dataLayer.push({
'event': 'form_submitted',
'form_name': 'contact',
'form_location': 'footer'
});
// Set user properties
dataLayer.push({
'user_id': '12345',
'user_type': 'premium'
});
// E-commerce event
dataLayer.push({
'event': 'purchase',
'ecommerce': {
'transaction_id': 'T12345',
'value': 99.99,
'currency': 'USD',
'items': [{
'item_id': 'SKU123',
'item_name': 'Product Name',
'price': 99.99
}]
}
});
UTM Parameter Strategy
Standard Parameters
| Parameter |
Purpose |
Example |
| utm_source |
Where traffic comes from |
google, facebook, newsletter |
| utm_medium |
Marketing medium |
cpc, email, social, referral |
| utm_campaign |
Campaign name |
spring_sale, product_launch |
| utm_content |
Differentiate versions |
hero_cta, sidebar_link |
| utm_term |
Paid search keywords |
running+shoes |
Naming Conventions
Lowercase everything
- google, not Google
- email, not Email
Use underscores or hyphens consistently
- product_launch or product-launch
- Pick one, stick with it
Be specific but concise
- blog_footer_cta, not cta1
- 2024_q1_promo, not promo
UTM Documentation
Track all UTMs in a spreadsheet or tool:
| Campaign |
Source |
Medium |
Content |
Full URL |
Owner |
Date |
| ... |
... |
... |
... |
... |
... |
... |
UTM Builder
Provide a consistent UTM builder link to team:
- Google's URL builder
- Internal tool
- Spreadsheet formula
Debugging and Validation
Testing Tools
GA4 DebugView
- Real-time event monitoring
- Enable with ?debug_mode=true
- Or via Chrome extension
GTM Preview Mode
- Test triggers and tags
- See data layer state
- Validate before publish
Browser Extensions
- GA Debugger
- Tag Assistant
- dataLayer Inspector
Validation Checklist
Common Issues
Events not firing
- Trigger misconfigured
- Tag paused
- GTM not loaded on page
Wrong values
- Variable not configured
- Data layer not pushing correctly
- Timing issues (fire before data ready)
Duplicate events
- Multiple GTM containers
- Multiple tag instances
- Trigger firing multiple times
Privacy and Compliance
Considerations
- Cookie consent required in EU/UK/CA
- No PII in analytics properties
- Data retention settings
- User deletion capabilities
- Cross-device tracking consent
Implementation
Consent Mode (GA4)
- Wait for consent before tracking
- Use consent mode for partial tracking
- Integrate with consent management platform
Data Minimization
- Only collect what you need
- IP anonymization
- No PII in custom dimensions
Output Format
Tracking Plan Document
# [Site/Product] Tracking Plan
## Overview
- Tools: GA4, GTM
- Last updated: [Date]
- Owner: [Name]
## Events
### Marketing Events
| Event Name | Description | Properties | Trigger |
|------------|-------------|------------|---------|
| signup_started | User initiates signup | source, page | Click signup CTA |
| signup_completed | User completes signup | method, plan | Signup success page |
### Product Events
[Similar table]
## Custom Dimensions
| Name | Scope | Parameter | Description |
|------|-------|-----------|-------------|
| user_type | User | user_type | Free, trial, paid |
## Conversions
| Conversion | Event | Counting | Google Ads |
|------------|-------|----------|------------|
| Signup | signup_completed | Once per session | Yes |
## UTM Convention
[Guidelines]
Implementation Code
Provide ready-to-use code snippets
Testing Checklist
Specific validation steps
Questions to Ask
If you need more context:
- 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?
Related Skills
- ab-test-setup: For experiment tracking
- seo-audit: For organic traffic analysis
- page-cro: For conversion optimization (uses this data)
1---2title: "🧪 analytics-tracking"3name: "analytics-tracking"4description: 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," or "tracking plan." For A/B test measurement, see ab-test-setup.5upstream:6 match: ambiguous7 copies: 68 candidates: [automindtechnologie-jpg/ultimate-skill.md, bradycassidy/marketingskills, phrazzld/claude-config, sebas-aikon-intelligence/antigravity-awesome-skills, silvainfm/claude-skills, xfstudio/skills]9 checked: 2026-08-2610metadata:11 source: https://skillmd.com/skills/michaelschecht/analytics-tracking12---1314# Analytics Tracking1516You 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.1718## Initial Assessment1920Before implementing tracking, understand:21221. **Business Context**23 - What decisions will this data inform?24 - What are the key conversion actions?25 - What questions need answering?26272. **Current State**28 - What tracking exists?29 - What tools are in use (GA4, Mixpanel, Amplitude, etc.)?30 - What's working/not working?31323. **Technical Context**33 - What's the tech stack?34 - Who will implement and maintain?35 - Any privacy/compliance requirements?3637---3839## Core Principles4041### 1. Track for Decisions, Not Data42- Every event should inform a decision43- Avoid vanity metrics44- Quality > quantity of events4546### 2. Start with the Questions47- What do you need to know?48- What actions will you take based on this data?49- Work backwards to what you need to track5051### 3. Name Things Consistently52- Naming conventions matter53- Establish patterns before implementing54- Document everything5556### 4. Maintain Data Quality57- Validate implementation58- Monitor for issues59- Clean data > more data6061---6263## Tracking Plan Framework6465### Structure6667```68Event Name | Event Category | Properties | Trigger | Notes69---------- | ------------- | ---------- | ------- | -----70```7172### Event Types7374**Pageviews**75- Automatic in most tools76- Enhanced with page metadata7778**User Actions**79- Button clicks80- Form submissions81- Feature usage82- Content interactions8384**System Events**85- Signup completed86- Purchase completed87- Subscription changed88- Errors occurred8990**Custom Conversions**91- Goal completions92- Funnel stages93- Business-specific milestones9495---9697## Event Naming Conventions9899### Format Options100101**Object-Action (Recommended)**102```103signup_completed104button_clicked105form_submitted106article_read107```108109**Action-Object**110```111click_button112submit_form113complete_signup114```115116**Category_Object_Action**117```118checkout_payment_completed119blog_article_viewed120onboarding_step_completed121```122123### Best Practices124125- Lowercase with underscores126- Be specific: `cta_hero_clicked` vs. `button_clicked`127- Include context in properties, not event name128- Avoid spaces and special characters129- Document decisions130131---132133## Essential Events to Track134135### Marketing Site136137**Navigation**138- page_view (enhanced)139- outbound_link_clicked140- scroll_depth (25%, 50%, 75%, 100%)141142**Engagement**143- cta_clicked (button_text, location)144- video_played (video_id, duration)145- form_started146- form_submitted (form_type)147- resource_downloaded (resource_name)148149**Conversion**150- signup_started151- signup_completed152- demo_requested153- contact_submitted154155### Product/App156157**Onboarding**158- signup_completed159- onboarding_step_completed (step_number, step_name)160- onboarding_completed161- first_key_action_completed162163**Core Usage**164- feature_used (feature_name)165- action_completed (action_type)166- session_started167- session_ended168169**Monetization**170- trial_started171- pricing_viewed172- checkout_started173- purchase_completed (plan, value)174- subscription_cancelled175176### E-commerce177178**Browsing**179- product_viewed (product_id, category, price)180- product_list_viewed (list_name, products)181- product_searched (query, results_count)182183**Cart**184- product_added_to_cart185- product_removed_from_cart186- cart_viewed187188**Checkout**189- checkout_started190- checkout_step_completed (step)191- payment_info_entered192- purchase_completed (order_id, value, products)193194---195196## Event Properties (Parameters)197198### Standard Properties to Consider199200**Page/Screen**201- page_title202- page_location (URL)203- page_referrer204- content_group205206**User**207- user_id (if logged in)208- user_type (free, paid, admin)209- account_id (B2B)210- plan_type211212**Campaign**213- source214- medium215- campaign216- content217- term218219**Product** (e-commerce)220- product_id221- product_name222- category223- price224- quantity225- currency226227**Timing**228- timestamp229- session_duration230- time_on_page231232### Best Practices233234- Use consistent property names235- Include relevant context236- Don't duplicate GA4 automatic properties237- Avoid PII in properties238- Document expected values239240---241242## GA4 Implementation243244### Configuration245246**Data Streams**247- One stream per platform (web, iOS, Android)248- Enable enhanced measurement249250**Enhanced Measurement Events**251- page_view (automatic)252- scroll (90% depth)253- outbound_click254- site_search255- video_engagement256- file_download257258**Recommended Events**259- Use Google's predefined events when possible260- Correct naming for enhanced reporting261- See: https://support.google.com/analytics/answer/9267735262263### Custom Events (GA4)264265```javascript266// gtag.js267gtag('event', 'signup_completed', {268 'method': 'email',269 'plan': 'free'270});271272// Google Tag Manager (dataLayer)273dataLayer.push({274 'event': 'signup_completed',275 'method': 'email',276 'plan': 'free'277});278```279280### Conversions Setup2812821. Collect event in GA42832. Mark as conversion in Admin > Events2843. Set conversion counting (once per session or every time)2854. Import to Google Ads if needed286287### Custom Dimensions and Metrics288289**When to use:**290- Properties you want to segment by291- Metrics you want to aggregate292- Beyond standard parameters293294**Setup:**2951. Create in Admin > Custom definitions2962. Scope: Event, User, or Item2973. Parameter name must match298299---300301## Google Tag Manager Implementation302303### Container Structure304305**Tags**306- GA4 Configuration (base)307- GA4 Event tags (one per event or grouped)308- Conversion pixels (Facebook, LinkedIn, etc.)309310**Triggers**311- Page View (DOM Ready, Window Loaded)312- Click - All Elements / Just Links313- Form Submission314- Custom Events315316**Variables**317- Built-in: Click Text, Click URL, Page Path, etc.318- Data Layer variables319- JavaScript variables320- Lookup tables321322### Best Practices323324- Use folders to organize325- Consistent naming (Tag_Type_Description)326- Version notes on every publish327- Preview mode for testing328- Workspaces for team collaboration329330### Data Layer Pattern331332```javascript333// Push custom event334dataLayer.push({335 'event': 'form_submitted',336 'form_name': 'contact',337 'form_location': 'footer'338});339340// Set user properties341dataLayer.push({342 'user_id': '12345',343 'user_type': 'premium'344});345346// E-commerce event347dataLayer.push({348 'event': 'purchase',349 'ecommerce': {350 'transaction_id': 'T12345',351 'value': 99.99,352 'currency': 'USD',353 'items': [{354 'item_id': 'SKU123',355 'item_name': 'Product Name',356 'price': 99.99357 }]358 }359});360```361362---363364## UTM Parameter Strategy365366### Standard Parameters367368| Parameter | Purpose | Example |369|-----------|---------|---------|370| utm_source | Where traffic comes from | google, facebook, newsletter |371| utm_medium | Marketing medium | cpc, email, social, referral |372| utm_campaign | Campaign name | spring_sale, product_launch |373| utm_content | Differentiate versions | hero_cta, sidebar_link |374| utm_term | Paid search keywords | running+shoes |375376### Naming Conventions377378**Lowercase everything**379- google, not Google380- email, not Email381382**Use underscores or hyphens consistently**383- product_launch or product-launch384- Pick one, stick with it385386**Be specific but concise**387- blog_footer_cta, not cta1388- 2024_q1_promo, not promo389390### UTM Documentation391392Track all UTMs in a spreadsheet or tool:393394| Campaign | Source | Medium | Content | Full URL | Owner | Date |395|----------|--------|--------|---------|----------|-------|------|396| ... | ... | ... | ... | ... | ... | ... |397398### UTM Builder399400Provide a consistent UTM builder link to team:401- Google's URL builder402- Internal tool403- Spreadsheet formula404405---406407## Debugging and Validation408409### Testing Tools410411**GA4 DebugView**412- Real-time event monitoring413- Enable with ?debug_mode=true414- Or via Chrome extension415416**GTM Preview Mode**417- Test triggers and tags418- See data layer state419- Validate before publish420421**Browser Extensions**422- GA Debugger423- Tag Assistant424- dataLayer Inspector425426### Validation Checklist427428- [ ] Events firing on correct triggers429- [ ] Property values populating correctly430- [ ] No duplicate events431- [ ] Works across browsers432- [ ] Works on mobile433- [ ] Conversions recorded correctly434- [ ] User ID passing when logged in435- [ ] No PII leaking436437### Common Issues438439**Events not firing**440- Trigger misconfigured441- Tag paused442- GTM not loaded on page443444**Wrong values**445- Variable not configured446- Data layer not pushing correctly447- Timing issues (fire before data ready)448449**Duplicate events**450- Multiple GTM containers451- Multiple tag instances452- Trigger firing multiple times453454---455456## Privacy and Compliance457458### Considerations459460- Cookie consent required in EU/UK/CA461- No PII in analytics properties462- Data retention settings463- User deletion capabilities464- Cross-device tracking consent465466### Implementation467468**Consent Mode (GA4)**469- Wait for consent before tracking470- Use consent mode for partial tracking471- Integrate with consent management platform472473**Data Minimization**474- Only collect what you need475- IP anonymization476- No PII in custom dimensions477478---479480## Output Format481482### Tracking Plan Document483484```485# [Site/Product] Tracking Plan486487## Overview488- Tools: GA4, GTM489- Last updated: [Date]490- Owner: [Name]491492## Events493494### Marketing Events495496| Event Name | Description | Properties | Trigger |497|------------|-------------|------------|---------|498| signup_started | User initiates signup | source, page | Click signup CTA |499| signup_completed | User completes signup | method, plan | Signup success page |500501### Product Events502[Similar table]503504## Custom Dimensions505506| Name | Scope | Parameter | Description |507|------|-------|-----------|-------------|508| user_type | User | user_type | Free, trial, paid |509510## Conversions511512| Conversion | Event | Counting | Google Ads |513|------------|-------|----------|------------|514| Signup | signup_completed | Once per session | Yes |515516## UTM Convention517518[Guidelines]519```520521### Implementation Code522523Provide ready-to-use code snippets524525### Testing Checklist526527Specific validation steps528529---530531## Questions to Ask532533If you need more context:5341. What tools are you using (GA4, Mixpanel, etc.)?5352. What key actions do you want to track?5363. What decisions will this data inform?5374. Who implements - dev team or marketing?5385. Are there privacy/consent requirements?5396. What's already tracked?540541---542543## Related Skills544545- **ab-test-setup**: For experiment tracking546- **seo-audit**: For organic traffic analysis547- **page-cro**: For conversion optimization (uses this data)