borghei/claude-skills/analytics-tracking
Claude Code and agent skill by borghei/claude-skills
- community
Checking that the SKILL.md file is still in the repository.
End-to-end analytics implementation for web and SaaS: GA4, Google Tag Manager, event taxonomy, conversion tracking, and UTM strategy. Use when building a tracking plan, debugging missing events, setting up GTM, or auditing existing analytics.
Install
npx vskill@latest install borghei/claude-skills/analytics-trackingSKILL.md
The same SKILL.md was published earlier as borghei/claude-skills/analytics-tracking.
Analytics Tracking - Implementation & Auditing
Category: Marketing Tags: GA4, Google Tag Manager, event tracking, conversion tracking, UTM, analytics audit, consent mode
Overview
Analytics Tracking is the implementation layer for marketing measurement. Bad tracking is worse than no tracking -- duplicate events, missing parameters, unconsented data, and broken conversions lead to decisions based on bad data. This skill covers building tracking right the first time and finding what is broken when it is not.
This skill handles implementation only. For analyzing campaign performance data, use campaign-analytics. For product analytics and in-app behavior, use the product-team skills.
Clarify First
Before building the tracking plan, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
- Operating mode: build from scratch, audit existing, or debug a specific issue (selects the entire workflow).
- Platform stack: GA4, GTM, and which ad platforms (Google Ads / Meta / LinkedIn) (drives implementation + conversion tracking setup).
- Key conversions + funnel events: the user actions that matter to the business (drives event taxonomy + conversion configuration).
- Region / consent requirements: EU/EEA users present? (determines whether Consent Mode v2 is required).
Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
Operating Modes
Mode 1: Build From Scratch
No analytics in place. Build the tracking plan, implement GA4 + GTM, define event taxonomy, configure conversions.
Mode 2: Audit Existing Tracking
Tracking exists but data cannot be trusted. Audit coverage, identify gaps, clean up duplicates, fix consent issues.
Mode 3: Debug Specific Issues
Events are missing, conversions do not match, GTM preview shows fires but GA4 does not record. Structured debugging workflow.
Event Taxonomy Design
Get this right before touching GA4 or GTM. Retrofitting taxonomy is painful and expensive.
Naming Convention
Format: object_action (snake_case, past tense verb)
| Correct | Wrong | Why Wrong | |
|---|---|---|---|
form_submitted | submitForm | camelCase, verb-first | |
plan_selected | clickPricingPlan | Implementation detail, not user action | |
video_started | VideoStart | PascalCase, inconsistent tense | |
checkout_completed | purchase | Ambiguous, not a verb phrase |
Rules:
- Always
noun_verborder, neververb_noun - Snake_case only -- no camelCase, no hyphens, no PascalCase
- Past tense verbs:
_started,_completed,_failed,_viewed - Specific enough to be unambiguous, not so verbose it is a sentence
- Prefix with domain when needed:
onboarding_step_completed,billing_plan_selected
Standard Event Parameters
Every custom event should include applicable parameters from this table:
| Parameter | Type | Example | Required When | |
|---|---|---|---|---|
user_id | string | usr_abc123 | Always (if authenticated) | |
plan_name | string | professional | Billing/pricing events | |
value | number | 99.00 | Revenue events | |
currency | string | USD | Always with value | |
content_group | string | onboarding | Page/flow grouping | |
method | string | google_oauth | Signup/login events | |
step_name | string | connect_account | Multi-step flows | |
step_number | number | 3 | Multi-step flows | |
source | string | pricing_page | CTA click events |
SaaS Event Taxonomy (Reference)
Core Funnel:
Micro-Conversions:
GA4 Configuration
Data Stream Setup
- Create property: GA4 Admin > Properties > Create
- Add web data stream with your domain
- Enhanced Measurement -- review each:
- Page views: Keep enabled
- Scrolls: Keep enabled
- Outbound clicks: Keep enabled
- Site search: Enable if you have search
- Video engagement: Disable if tracking videos manually (avoids duplicates)
- File downloads: Disable if tracking via GTM (for better parameters)
- Configure domains: add all subdomains in your funnel
- Data retention: Set to 14 months (maximum for free GA4)
Key Events (formerly "Conversions")
GA4 renamed "conversions" to key events in March 2024; "conversions" now refers to key events imported into Google Ads. Mark as key events in GA4 Admin > Data display > Events (star icon):
signup_completedcheckout_completeddemo_requestedtrial_started
Rules:
- Maximum 30 key events per standard property (50 on Analytics 360) -- curate carefully
- Marking a key event is not retroactive -- it affects reports from the time it is marked, not historic data
- Do not mark micro-conversions as key events unless optimizing ad campaigns for them
- Counting method: set to "once per session" for lead events, "every" for purchase events
Source: Mark events as key events (as of September 2026).
Custom Dimensions
Register custom dimensions for any event parameter you want to filter/segment by:
| Parameter | Scope | Dimension Name | |
|---|---|---|---|
plan_name | Event | Plan Name | |
user_id | User | User ID | |
content_group | Event | Content Group | |
feature_name | Event | Feature Name |
Register in GA4 Admin > Custom definitions > Create custom dimension.
Google Tag Manager Implementation
Container Architecture
Implementation Pattern: Data Layer Push
Your application pushes events to the data layer. GTM picks them up and sends to GA4.
Application code:
GTM configuration:
SPA Handling
Single Page Applications need special attention because page views do not fire automatically on route changes.
Option A: History change trigger (GTM built-in)
- Enable "History Change" trigger in GTM
- Fires GA4 page_view on every pushState/popState
Option B: DataLayer push on route change (more control)
Conversion Tracking: Ad Platforms
Google Ads
Recommended approach: Import GA4 conversions into Google Ads (single source of truth).
- Link GA4 and Google Ads accounts
- In Google Ads > Goals > Conversions > Import > Google Analytics
- Select GA4 key events to import (they become Google Ads conversions)
- Set attribution model: Data-driven (if 50+ conversions/month), otherwise Last-click
- Conversion window: 30 days for lead gen, 90 days for high-consideration B2B
Enhanced Conversions: Enable for 15-30% better conversion measurement. Sends hashed first-party data (email, phone) to match conversions that cookies miss.
Meta (Facebook/Instagram)
- Install Meta Pixel base code via GTM
- Configure standard events:
PageView,Lead,CompleteRegistration,Purchase - Conversions API (CAPI): strongly recommended -- client-side pixel loses approximately 30% of conversions due to ad blockers and iOS App Tracking Transparency
- Deduplication: when using both pixel and CAPI, send the same
event_idto prevent double-counting
LinkedIn Insight Tag
- Install via GTM (Tag type: LinkedIn Insight)
- Configure conversion events in LinkedIn Campaign Manager
- Match events to your taxonomy:
signup_completed-> LinkedIn "Sign-up" conversion
UTM Strategy
Convention Enforcement
| Parameter | Convention | Example | |
|---|---|---|---|
utm_source | Platform name, lowercase | google, linkedin, newsletter | |
utm_medium | Traffic type | cpc, email, social, organic | |
utm_campaign | Campaign identifier | q1-trial-push, brand-awareness-2026 | |
utm_content | Creative variant | hero-cta-blue, sidebar-text-link | |
utm_term | Paid keyword (search only) | saas-analytics-tool |
Critical rules:
- Never tag organic traffic with UTMs (overrides GA4 automatic attribution)
- Never tag direct/internal links with UTMs
- Use a UTM builder spreadsheet or tool -- manual entry causes inconsistency
- Lowercase everything --
Googleandgoogleare different sources in GA4
Attribution Windows
| Platform | Default | Recommended for SaaS | |
|---|---|---|---|
| GA4 | 30 days | 30-90 days (match your sales cycle) | |
| Google Ads | 30 days | 30 days (trial), 90 days (enterprise) | |
| Meta | 7-day click, 1-day view | 7-day click only (view-through inflates; 7-/28-day view windows were removed Jan 2026) | |
| 30 days | 30 days |
AI Referral Traffic
Visits from AI assistants (ChatGPT, Gemini, Claude, Copilot, Perplexity, etc.) are a growing, distinct acquisition source. Measure them explicitly instead of letting them blur into Referral or Direct.
GA4 "AI Assistant" Channel (as of September 2026)
Since May 13, 2026, GA4's Default Channel Group includes an AI Assistant channel. When the referrer matches Google's list of recognized AI assistants, GA4 sets medium = ai-assistant and campaign = (ai-assistant), and the session is grouped under AI Assistant. No configuration is needed. The rule is evaluated before Referral. Sources: Default channel group, What's new in Google Analytics.
Known Gaps
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingmarketing/analytics-tracking/SKILL.md
Popularity
- Repository stars
- 169
- Repository forks
- 33
- 7-day trend score
- 26
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 21 May 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/borghei/claude-skills/analytics-tracking)