Analytics
Corey HainesCommunityCreated by Corey Haines
- Skill
- Tool integration
- Data and AI
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured approach to analytics implementation, emphasizing data quality, consistent naming conventions, and alignment with business goals. It guides users through the entire lifecycle of tracking—from defining what to measure based on decision-making needs, to technical implementation in tools like GA4 and GTM, and finally to validation and debugging. It includes specific patterns for UTM parameters, event naming, and data layer structures to ensure clean, reliable data collection.
What it does
- Defines a tracking plan framework to map business questions to specific events.
- Provides standardized event naming conventions (Object-Action) and property structures.
- Offers implementation guidance for GA4 and Google Tag Manager.
- Establishes best practices for UTM parameter strategy and traffic source tracking.
- Includes a validation checklist for debugging event firing and data accuracy.
- Provides principles for data quality, including reconciliation and observation window matching.
When to use it
- When you need to set up tracking for a new website, app, or marketing campaign.
- When you are auditing existing analytics to fix broken events or improve data quality.
- When you need to define a consistent naming convention for events and properties.
- When you need to implement or troubleshoot GA4 or GTM configurations.
- When you are unsure how to measure specific marketing results or user behaviors.
Advantages
- Ensures tracking is tied to actionable business decisions rather than vanity metrics.
- Promotes consistency across teams through established naming and property patterns.
- Reduces data corruption by enforcing strict validation and reconciliation practices.
- Provides clear, repeatable patterns for complex setups like partner/influencer tracking.
- Helps maintain privacy compliance by discouraging PII collection.
Usage examples
- “How should I set up tracking for my new SaaS signup flow?”
- The agent will help you define a tracking plan, identify key events like signup_started and signup_completed, and provide the GTM or GA4 implementation steps.
- “My GA4 data looks wrong, how do I audit it?”
- The agent will guide you through a validation checklist, including checking GTM triggers, using DebugView, and verifying event property population.
- “What is the best way to track traffic from our newsletter partners?”
- The agent will provide a UTM parameter strategy, including specific source/medium patterns and instructions for creating custom channel groups in GA4.
- “How do I ensure my event tracking is consistent?”
- The agent will introduce the Object-Action naming convention and provide a template for a tracking plan to document all events and properties.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/coreyhaines31/analytics/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip analytics.zip -d .agents/skills
Documentation by Corey Haines
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
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
5. Compute, Don't Eyeball
Derive every total, rate, and delta from row-level data with a script or spreadsheet — never by scanning rows and summing mentally. One silently dropped row corrupts every figure downstream of it.
Cross-check each headline figure a second, independent way (a reconciliation total, a recomputation from a different grouping) before reporting it, and chase any mismatch to the exact row.
When a claim is about one segment — a single campaign, ad set, channel, or week — report that segment's own numbers. Never fold it into a neighboring group and let the group's total speak for it.
6. Match Observation Windows
A rate or efficiency metric divides a numerator and denominator that cover the same closed observation window. Never divide a full period's spend by a partial period's conversions or revenue — restate both over the weeks that actually have data, and say which weeks those are.
Cohort rates use only cohorts whose observation window has ended. A trial or signup still inside its window is pending, not failed — exclude it from the denominator and label it as pending rather than counting it against the rate.
7. Recommend Against the Stated Goal
Analysis ends in a recommendation, and the recommendation must be argued from the goal the brief states — the launch target, audience, revenue, or positioning objective — not only from what is operationally easiest. Name which stated goal each option serves and what it trades away.
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_completedBest Practices
Lowercase with underscores
Be specific:
cta_hero_clickedvs.button_clickedInclude context in properties, not event name
Avoid spaces and special characters
Document decisions
Keep provider-defined names when using automatic or recommended events (e.g. GA4
click,view_search_results,purchase). Map internal business names explicitly; naming a custom event does not make the provider collect it automatically.
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
Event Example
// GA4's recommended sign_up event, not a custom name, so it feeds built-in reports.
// Your tracking plan can still call this signup_completed; map the name explicitly.
gtag('event', 'sign_up', {
'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. GA4 treats
LinkedInandlinkedinas two sources, and the split never merges back.Hyphens between words. No spaces, underscores, or
+. Pick one separator for the whole company; this skill uses hyphens.One spelling per source.
linkedin, never alsoliorlinkedin.com. Keep the allowed values in a shared sheet and build links from it.No personal data. Never put emails, names, phone numbers, or user IDs in a UTM. They land in analytics reports and in referrer logs, and Google's terms prohibit sending PII to GA4.
Specific but short:
blog-footer-cta, notcta1.Test the final URL. Shorteners and redirects can drop or double parameters. Click the live link and check the landing URL before the campaign ships.
UTM Patterns by Partner Type
Partner links break most often because each deal gets named on the spot. Fix the pattern per partner type once: utm_medium names the kind of deal, utm_source names who sent the traffic.
| Partner type | utm_source | utm_medium | utm_campaign | utm_content |
|---|---|---|---|---|
| Newsletter | {partner} (one per partner, across all their publications) | newsletter | {partner}-{publication}-{yyyy}-{mm} | {placement}-{yyyy-mm-dd} |
| Creator (YouTube, LinkedIn, TikTok) | {platform} | creator | {creator} | {post-date} or the video ID |
| Podcast | {podcast} | podcast | {podcast}-{yyyy}-{mm} | {spot}-{yyyy-mm-dd} (pre-roll, mid-roll) |
| Affiliate | {partner} | affiliate | {partner}-affiliate | placement, if they have several |
| Community | {community} | community | {community}-{program} | the channel or post, if known |
Use
creatoras the medium for paid creator deals, notsocial(which mixes them with your organic posts) orvideo(which mixes them with paid video ads). The platform goes inutm_source.One link per placement. A newsletter that runs you on two dates gets two links, so each date's clicks stay separate. The monthly
utm_campaignrolls them up.Add a custom channel group in GA4. GA4's default grouping sends mediums like
newsletter,creator,podcast, andcommunityto Unassigned (onlyaffiliateandemailmap to a default channel). Create a channel group with a rule per medium so partner traffic shows up as its own channels.Podcast and video links often aren't clickable, so pair the UTM link with a promo code or vanity URL. See influencer-marketing for the rest of partner measurement.
The partner-type pattern is adapted from Wispr Flow's link-creator skill (MIT), published in the skills.marketing library.
Traffic From AI Assistants
You can't tag links that ChatGPT, Claude, Perplexity, Gemini, or Copilot put in their answers. Some of those visits arrive with a referrer (chatgpt.com, perplexity.ai) or an assistant-added utm_source; many arrive as direct, or come later through a branded search.
Add a GA4 channel group rule that matches known assistant referrers and sources into an "AI assistants" channel, and update the list as new assistants appear.
Treat that channel as the floor. Assistant-driven visits that show up as direct or branded search can be most of the effect, and they won't carry the referrer.
For measuring the full effect (exposure, delayed visits, and longer attribution windows), see ai-seo. For reconciling it with other sources, see attribution.
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
[ ] Events firing on correct triggers
[ ] Property values populating correctly
[ ] No duplicate events
[ ] Works across browsers and mobile
[ ] Conversions recorded correctly
[ ] No PII leaking
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
conversion-tracking: For getting conversions (including GA4 key events from forms and bookings) to ad platforms and GA4, and verifying they arrive
attribution: For attribution models, multi-touch/MMM/incrementality, and reconciling conflicting numbers across tools (once tracking is live)
seo-audit: For organic traffic analysis
cro: For conversion optimization (uses this data)
revops: For pipeline metrics, CRM tracking, and revenue attribution
Files
- ATTRIBUTION.mdAdded by AutoGineer879 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md14.2 KiB
- evals/evals.json8.6 KiB
- references/event-library.md8.5 KiB
- references/ga4-implementation.md7.0 KiB
- references/gtm-implementation.md8.2 KiB
evals/evals.json
{
"skill_name": "analytics",
"evals": [
{
"id": 1,
"prompt": "Help me set up analytics tracking for our B2B SaaS product. We use GA4 and GTM. We need to track signups, feature usage, and upgrade events.",
"expected_output": "Should check for product-marketing.md first. Should apply the 'track for decisions' principle — ask what decisions the tracking will inform. Should use the event naming convention (object_action, lowercase with underscores). Should define essential events for SaaS: signup_completed, trial_started, feature_used, plan_upgraded, etc. Should provide GA4 implementation details with proper event parameters. Should include GTM data layer push examples. Should organize output as a tracking plan with event name, trigger, parameters, and purpose for each event.",
"assertions": [
"Checks for product-marketing.md",
"Applies 'track for decisions' principle",
"Uses object_action naming convention",
"Defines essential SaaS events (signup, feature usage, upgrade)",
"Provides GA4 implementation details",
"Includes GTM data layer examples",
"Output follows tracking plan format"
],
"files": []
},
{
"id": 2,
"prompt": "What UTM parameters should we use? We run ads on Google, Meta, and LinkedIn, plus send a weekly newsletter and post on LinkedIn organically.",
"expected_output": "Should apply the UTM parameter strategy framework. Should define consistent UTM conventions: source (google, meta, linkedin, newsletter), medium (cpc, paid-social, email, organic-social), campaign (naming convention with date or identifier). Should provide specific UTM examples for each channel mentioned. Should warn about common UTM mistakes (inconsistent casing, redundant parameters, missing medium). Should recommend a UTM tracking spreadsheet or naming convention document.",
"assertions": [
"Applies UTM parameter strategy",
"Defines source, medium, and campaign conventions",
"Provides specific UTM examples for each channel",
"Uses consistent naming conventions (lowercase)",
"Warns about common UTM mistakes",
"Recommends tracking documentation"
],
"files": []
},
{
"id": 3,
"prompt": "our tracking seems broken — we're seeing duplicate events and our conversion numbers in GA4 don't match what our database shows. help?",
"expected_output": "Should trigger on casual phrasing. Should apply the debugging and validation framework. Should systematically check for common issues: duplicate GTM tags firing, missing event deduplication, incorrect trigger conditions, cross-domain tracking issues, consent mode filtering. Should provide specific debugging steps: use GA4 DebugView, GTM Preview mode, browser developer tools. Should address the GA4 vs database discrepancy (common causes: consent mode, ad blockers, client-side vs server-side tracking, session timeout differences).",
"assertions": [
"Triggers on casual phrasing",
"Applies debugging and validation framework",
"Checks for duplicate tag firing",
"Provides specific debugging tools (GA4 DebugView, GTM Preview)",
"Addresses GA4 vs database discrepancy",
"Lists common causes of data mismatches",
"Provides systematic troubleshooting steps"
],
"files": []
},
{
"id": 4,
"prompt": "We're launching an e-commerce store and need to set up tracking from scratch. What events do we absolutely need?",
"expected_output": "Should reference the essential events by site type, specifically e-commerce. Should define the e-commerce event taxonomy: product_viewed, product_added_to_cart, cart_viewed, checkout_started, checkout_step_completed, purchase_completed, product_removed_from_cart. Should include enhanced e-commerce parameters (item_id, item_name, price, quantity, etc.). Should follow object_action naming convention. Should organize as a tracking plan with priorities (must-have vs nice-to-have).",
"assertions": [
"References essential events for e-commerce site type",
"Defines full e-commerce event taxonomy",
"Includes enhanced e-commerce parameters",
"Follows object_action naming convention",
"Organizes by priority (must-have vs nice-to-have)",
"Provides tracking plan format output"
],
"files": []
},
{
"id": 5,
"prompt": "We need to make sure our tracking is GDPR compliant. We have European users and we're using GA4, Hotjar, and Facebook Pixel.",
"expected_output": "Should apply the privacy and compliance framework. Should address GDPR requirements for each tool: consent before tracking, consent management platform (CMP) setup, GA4 consent mode configuration, conditional loading of Hotjar and Facebook Pixel. Should recommend a consent hierarchy (necessary, analytics, marketing). Should provide GTM implementation for consent-based tag firing. Should mention data retention settings in GA4. Should address cookie banner requirements.",
"assertions": [
"Applies privacy and compliance framework",
"Addresses GDPR requirements specifically",
"Recommends consent management platform",
"Covers GA4 consent mode configuration",
"Addresses conditional loading for each tool",
"Provides consent hierarchy",
"Mentions data retention settings"
],
"files": []
},
{
"id": 6,
"prompt": "Help me set up tracking for our A/B test. We want to measure which version of our pricing page converts better.",
"expected_output": "Should recognize this overlaps with A/B test setup, not just analytics tracking. Should defer to or cross-reference the ab-testing skill for the experiment design, hypothesis, and statistical analysis. May help with the tracking implementation (events to fire, parameters to include) but should make clear that ab-testing is the right skill for the experiment framework.",
"assertions": [
"Recognizes overlap with A/B test setup",
"References or defers to ab-testing skill",
"May help with tracking implementation specifics",
"Does not attempt to design the full experiment"
],
"files": []
},
{
"id": 7,
"prompt": "GA4 enhanced measurement is enabled. I filtered outbound_click, site_search and video_engagement and got zero, but DebugView shows 12 click events with outbound=true, 7 view_search_results, 6 video_start, 4 video_progress and 2 video_complete. Which reports should I build? Do I need to add custom events?",
"expected_output": "Identify the mismatched option labels/event names. Use click with outbound=true for the 12 outbound clicks, view_search_results for the 7 searches, and separate video_start/video_progress/video_complete reports for 6/4/2. Do not add custom duplicate events to fix a filter mismatch or sum all video events as unique views. Check enabled options, configured search query parameters, YouTube JS API support and DebugView; cross-domain measurement destinations do not produce outbound clicks.",
"assertions": [
"Uses actual enhanced-measurement event names instead of option labels",
"Filters click by outbound=true and reports 12 outbound clicks",
"Uses view_search_results and reports 7 searches",
"Separates 6 video starts, 4 progress events and 2 completions",
"Does not count all video events as unique views or create duplicate custom events",
"Mentions relevant enhanced-measurement configuration and DebugView checks"
],
"files": []
},
{
"id": 8,
"prompt": "Our GTM Custom JavaScript price variable parses .product-price text. USD $1,234.56 is tracked as 1, a European 1.234,56 display as 1.234, and missing prices become zero. How should we fix this without changing real free items?",
"expected_output": "Use the application numeric amount and explicit currency or a machine-readable unformatted decimal data-price attribute. Do not strip symbols or guess locale separators. Return null for missing/malformed/nonfinite values and skip or diagnose the monetary event; preserve canonical zero for free items. Test grouped US and localized European display strings, ordinary decimals and missing/invalid values.",
"assertions": [
"Uses numeric application data or canonical machine-readable decimal",
"Does not parse localized display strings or guess currency",
"Preserves explicit zero for free items",
"Missing or invalid amount is not converted to zero",
"Tests grouped and localized display controls"
],
"files": []
}
]
}
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Corey Haines
- Publisher
- Corey Haines (Community)
- Source
- coreyhaines31/marketingskills · skills/analytics · commit 96798cf
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Corey Haines or Corey Haines.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download analytics.zip