analytics-tracking
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.
Best use case
analytics-tracking is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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.
Teams using analytics-tracking should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/analytics-tracking/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How analytics-tracking Compares
| Feature / Agent | analytics-tracking | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Analytics Tracking
## Overview
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. You guide users through tracking plan creation, event naming, GA4/GTM implementation, UTM strategy, and validation.
**Check for product marketing context first:**
If `.claude/product-marketing-context.md` exists, read it before asking questions. Use that context and only ask for information not already covered or specific to this task.
## Instructions
### Initial Assessment
Before implementing tracking, understand:
1. **Business Context** - What decisions will this data inform? What are key conversions?
2. **Current State** - What tracking exists? What tools are in use?
3. **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.
2. **Start with the Questions** - What do you need to know? What actions will you take? Work backwards to what you need to track.
3. **Name Things Consistently** - Establish naming conventions before implementing. Document everything.
4. **Maintain Data Quality** - Validate implementation. Monitor for issues. Clean data > more data.
### Tracking Plan Framework
```
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](references/event-library.md)
### Event Naming Conventions
Use Object-Action format, lowercase with underscores:
```
signup_completed
button_clicked
form_submitted
article_read
checkout_payment_completed
```
Be specific: `cta_hero_clicked` not `button_clicked`. Include context in properties, not event name.
### 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](references/event-library.md)
### Standard Event 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 |
### GA4 Implementation
1. Create GA4 property and data stream
2. Install gtag.js or GTM
3. Enable enhanced measurement
4. Configure custom events
5. Mark conversions in Admin
```javascript
gtag('event', 'signup_completed', {
'method': 'email',
'plan': 'free'
});
```
**For detailed GA4 implementation**: See [references/ga4-implementation.md](references/ga4-implementation.md)
### Google Tag Manager
| Component | Purpose |
|-----------|---------|
| Tags | Code that executes (GA4, pixels) |
| Triggers | When tags fire (page view, click) |
| Variables | Dynamic values (click text, data layer) |
```javascript
dataLayer.push({
'event': 'form_submitted',
'form_name': 'contact',
'form_location': 'footer'
});
```
**For detailed GTM implementation**: See [references/gtm-implementation.md](references/gtm-implementation.md)
### UTM Parameter Strategy
| 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 |
Lowercase everything. Use underscores or hyphens consistently. Document all UTMs in a spreadsheet.
### Debugging and Validation
| 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
### Privacy and Compliance
- Cookie consent required in EU/UK/CA
- No PII in analytics properties
- Configure data retention settings
- Use consent mode (wait for consent before firing tags)
- IP anonymization enabled
- Integrate with consent management platform
## Examples
### Example 1: SaaS Marketing Site Tracking Plan
**User prompt:** "We're launching a new marketing site for our HR software Peoplus on Next.js. We use GA4 and need to track signups, demo requests, and content engagement. Help me create a tracking plan."
The agent will:
- Create a structured tracking plan with events: `cta_clicked`, `demo_form_submitted`, `signup_completed`, `pricing_toggled`, `blog_article_read`, `resource_downloaded`.
- Define properties for each event (e.g., `demo_form_submitted` with `company_size`, `source_page`).
- Provide GTM data layer implementation code for each event.
- Recommend custom dimensions for `user_type` and `plan_interest`.
- Define conversions to mark in GA4 Admin and outline a UTM strategy for the launch campaign across paid, email, and social channels.
### Example 2: E-commerce Conversion Funnel Audit
**User prompt:** "Our Shopify store DailyBrew sells specialty coffee. We have GA4 installed but can't see where people drop off between product view and purchase. Our conversion rate is 1.2% and we need better funnel tracking."
The agent will:
- Audit the current GA4 setup and identify missing events in the purchase funnel.
- Create a funnel tracking plan: `product_viewed` (with `product_name`, `price`, `category`), `add_to_cart`, `cart_viewed`, `checkout_started`, `shipping_selected`, `payment_submitted`, `purchase_completed`.
- Provide Shopify-specific GTM implementation using Shopify's data layer.
- Set up enhanced e-commerce tracking in GA4 with proper product properties.
- Recommend a validation process using GA4 DebugView to confirm each funnel step fires correctly.
## Guidelines
- **Always start with questions, not tools** — understand what decisions the data will inform before choosing what to track.
- **Avoid PII in event properties** — never pass emails, full names, or other personally identifiable information as event parameters.
- **Test tracking before going live** — use GA4 DebugView and GTM Preview Mode to verify every event fires correctly with the right properties.
- **Don't duplicate automatic properties** — GA4 already captures page_location, page_referrer, and other standard parameters. Only add custom properties that provide additional context.
- **Document naming conventions upfront** — inconsistent event names (mixing `signupCompleted` with `signup_completed`) create data headaches that are painful to fix later.
- **Keep UTM parameters lowercase and consistent** — `utm_source=Google` and `utm_source=google` create separate entries in reports. Standardize before launching campaigns.
- **Plan for consent** — implement consent mode from day one. Retrofitting cookie consent is much harder than building it in.Related Skills
realtime-analytics
Build real-time analytics pipelines from scratch. Use when someone asks to "set up analytics", "build a dashboard", "track events in real time", "ClickHouse analytics", "event ingestion pipeline", or "live metrics". Covers event schema design, ingestion services with batching, ClickHouse table optimization, aggregation queries, and dashboard wiring.
product-analytics
Expert guidance for product analytics, helping product teams define metrics, build funnels, analyze retention, run A/B tests, and make data-driven decisions. Applies frameworks for North Star metrics, pirate metrics (AARRR), cohort analysis, and experiment design.
zustand
You are an expert in Zustand, the small, fast, and scalable state management library for React. You help developers manage global state without boilerplate using Zustand's hook-based stores, selectors for performance, middleware (persist, devtools, immer), computed values, and async actions — replacing Redux complexity with a simple, un-opinionated API in under 1KB.
zoho
Integrate and automate Zoho products. Use when a user asks to work with Zoho CRM, Zoho Books, Zoho Desk, Zoho Projects, Zoho Mail, or Zoho Creator, build custom integrations via Zoho APIs, automate workflows with Deluge scripting, sync data between Zoho apps and external systems, manage leads and deals, automate invoicing, build custom Zoho Creator apps, set up webhooks, or manage Zoho organization settings. Covers Zoho CRM, Books, Desk, Projects, Creator, and cross-product integrations.
zod
You are an expert in Zod, the TypeScript-first schema declaration and validation library. You help developers define schemas that validate data at runtime AND infer TypeScript types at compile time — eliminating the need to write types and validators separately. Used for API input validation, form validation, environment variables, config files, and any data boundary.
zipkin
Deploy and configure Zipkin for distributed tracing and request flow visualization. Use when a user needs to set up trace collection, instrument Java/Spring or other services with Zipkin, analyze service dependencies, or configure storage backends for trace data.
zig
Expert guidance for Zig, the systems programming language focused on performance, safety, and readability. Helps developers write high-performance code with compile-time evaluation, seamless C interop, no hidden control flow, and no garbage collector. Zig is used for game engines, operating systems, networking, and as a C/C++ replacement.
zed
Expert guidance for Zed, the high-performance code editor built in Rust with native collaboration, AI integration, and GPU-accelerated rendering. Helps developers configure Zed, create custom extensions, set up collaborative editing sessions, and integrate AI assistants for productive coding.
zeabur
Expert guidance for Zeabur, the cloud deployment platform that auto-detects frameworks, builds and deploys applications with zero configuration, and provides managed services like databases and message queues. Helps developers deploy full-stack applications with automatic scaling and one-click marketplace services.
zapier
Automate workflows between apps with Zapier. Use when a user asks to connect apps without code, automate repetitive tasks, sync data between services, or build no-code integrations between SaaS tools.
zabbix
Configure Zabbix for enterprise infrastructure monitoring with templates, triggers, discovery rules, and dashboards. Use when a user needs to set up Zabbix server, configure host monitoring, create custom templates, define trigger expressions, or automate host discovery and registration.
yup
Validate data with Yup schemas. Use when adding form validation, defining API request schemas, validating configuration, or building type-safe validation pipelines in JavaScript/TypeScript.