analytics

作者: coreyhaines31

当用户想要设置、改进或审计分析追踪和测量时使用。也适用于用户提及“设置追踪”、“GA4”、“Google Analytics”、“转化追踪”、“事件追踪”、“UTM参数”、“标签管理器”、“GTM”、“分析实施”、“追踪计划”、“我该如何测量这个”、“追踪转化”、“归因”、“Mixpanel”、“Segment”、“我的事件是否触发”或“分析无法正常工作”时。每当有人询问如何判断某件事是否正常运作时,也使用此技能。

npx skills add https://github.com/coreyhaines31/marketingskills --skill analytics

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:

  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 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

TypeExamples
PageviewsAutomatic, enhanced with metadata
User ActionsButton clicks, form submissions, feature usage
System EventsSignup completed, purchase, subscription changed
Custom ConversionsGoal 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

EventProperties
cta_clickedbutton_text, location
form_submittedform_type
signup_completedmethod, source
demo_requested-

Product/App

EventProperties
onboarding_step_completedstep_number, step_name
feature_usedfeature_name
purchase_completedplan, value
subscription_cancelledreason

For full event library by business type: See references/event-library.md


Event Properties

Standard Properties

CategoryProperties
Pagepage_title, page_location, page_referrer
Useruser_id, user_type, account_id, plan_type
Campaignsource, medium, campaign, content, term
Productproduct_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

  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

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

ComponentPurpose
TagsCode that executes (GA4, pixels)
TriggersWhen tags fire (page view, click)
VariablesDynamic 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

ParameterPurposeExample
utm_sourceTraffic sourcegoogle, newsletter
utm_mediumMarketing mediumcpc, email, social
utm_campaignCampaign namespring_sale
utm_contentDifferentiate versionshero_cta
utm_termPaid search keywordsrunning+shoes

Naming Conventions

  • Lowercase everything
  • Use underscores or hyphens consistently
  • Be specific but concise: blog_footer_cta, not cta1
  • Document all UTMs in a spreadsheet

Debugging and Validation

Testing Tools

ToolUse For
GA4 DebugViewReal-time event monitoring
GTM Preview ModeTest triggers before publish
Browser ExtensionsTag 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

IssueCheck
Events not firingTrigger config, GTM loaded
Wrong valuesVariable path, data layer structure
Duplicate eventsMultiple 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

  1. What tools are you using (GA4, Mixpanel, etc.)?
  2. What key actions do you want to track?
  3. What decisions will this data inform?
  4. Who implements - dev team or marketing?
  5. Are there privacy/consent requirements?
  6. What's already tracked?

Tool Integrations

For implementation, see the tools registry. Key analytics tools:

ToolBest ForMCPGuide
GA4Web analytics, Google ecosystemga4.md
MixpanelProduct analytics, event tracking-mixpanel.md
AmplitudeProduct analytics, cohort analysis-amplitude.md
PostHogOpen-source analytics, session replay-posthog.md
SegmentCustomer data platform, routing-segment.md

Related Skills

  • ab-testing: For experiment tracking
  • seo-audit: For organic traffic analysis
  • cro: For conversion optimization (uses this data)
  • revops: For pipeline metrics, CRM tracking, and revenue attribution

来自 coreyhaines31 的更多技能

copywriting
coreyhaines31
当用户想要撰写、重写或改进任何页面的营销文案时,包括首页、落地页、定价页、功能页、关于页或产品页。也适用于用户说“为……写文案”、“改进这段文案”、“重写这个页面”、“营销文案”、“标题帮助”、“CTA文案”、“价值主张”、“标语”、“副标题”、“首屏文案”、“折叠区以上内容”、“这段文案太弱”、“让这个更有吸引力”或“帮我描述产品”时。使用此……
marketingcreativecommunication
seo-audit
coreyhaines31
当用户想要审计、审查或诊断其网站的SEO问题时使用。也适用于用户提及"SEO审计"、"技术SEO"、"为什么没有排名"、"SEO问题"、"页面SEO"、"元标签审查"、"SEO健康检查"、"流量下降"、"排名丢失"、"未出现在谷歌中"、"网站没有排名"、"谷歌更新影响了我"、"页面速度"、"核心网页指标"、"抓取错误"或"索引问题"时。即使用户只是模糊地说"我的SEO很差"或"帮帮我..."等情况也适用。
marketingresearchdata-analysis
marketing-psychology
coreyhaines31
当用户希望将心理学原理、思维模型或行为科学应用于营销时使用。也适用于用户提及"心理学"、"思维模型"、"认知偏差"、"说服"、"行为科学"、"人们为何购买"、"决策"、"消费者行为"、"锚定效应"、"社会认同"、"稀缺性"、"损失厌恶"、"框架效应"或"助推"等概念。每当有人想要理解或利用人们在营销情境中的思考与决策方式时使用此技能。用于应用...
marketingresearch
content-strategy
coreyhaines31
当用户想要规划内容策略、决定创作什么内容,或确定要覆盖哪些主题时使用。当用户提到“内容策略”、“我应该写什么”、“内容创意”、“博客策略”、“主题集群”、“内容规划”、“编辑日历”、“内容营销”、“内容路线图”、“我应该创作什么内容”、“博客主题”、“内容支柱”或“我不知道写什么”时也适用。每当有人需要帮助决定要创作什么内容时使用此技能。
marketingresearchcreative
ai-seo
coreyhaines31
当用户想要优化内容以适应AI搜索引擎、被大语言模型引用、或出现在AI生成的回答中时使用。也适用于用户提及以下术语时:'AI SEO'、'AEO'、'GEO'、'LLMO'、'答案引擎优化'、'生成式引擎优化'、'大语言模型优化'、'AI概览'、'针对ChatGPT优化'、'针对Perplexity优化'、'AI引用'、'AI可见性'、'零点击搜索'、'如何出现在AI回答中'、'大语言模型提及'、或'针对Claude/Gemini优化'。当有人提及相关内容时均可使用。
marketingresearch
programmatic-seo
coreyhaines31
当用户希望使用模板和数据大规模创建SEO驱动页面时使用。当用户提及“程序化SEO”、“模板页面”、“规模化页面”、“目录页面”、“地理位置页面”、“[关键词] + [城市] 页面”、“对比页面”、“集成页面”、“为SEO构建大量页面”、“pSEO”、“生成100个页面”、“数据驱动页面”或“模板化着陆页”时也可使用。每当有人想要创建针对不同关键词或地点的多个相似页面时,请使用此技能。用于...
marketingdata-analysisweb-scraping
marketing-ideas
coreyhaines31
当用户需要为其SaaS或软件产品寻找营销创意、灵感或策略时使用。也适用于用户询问“营销创意”、“增长思路”、“如何营销”、“营销策略”、“营销战术”、“推广方法”、“增长点子”、“还能尝试什么”、“我不知道如何营销这个”、“头脑风暴营销”或“应该做什么营销”等情况。每当用户陷入困境或寻求增长灵感时,以此作为起点。针对具体...
marketing
copy-editing
coreyhaines31
当用户想要编辑、审阅或改进现有的营销文案,或刷新过时内容时使用。也适用于用户提及“编辑这段文案”、“审阅我的文案”、“文案反馈”、“校对”、“润色”、“改进这段内容”、“文案梳理”、“精简这段”、“读起来别扭”、“清理这段文字”、“太啰嗦”、“强化信息传达”、“刷新内容”、“更新页面”、“内容过时”或“内容审计”等表述。当用户已有文案并希望对其进行处理时使用。
documentcommunicationmarketing