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健康檢查」、「我的流量下降了」、「排名消失」、「沒有出現在Google上」、「網站沒有排名」、「Google更新影響了我」、「頁面速度」、「核心網頁指標」、「爬蟲錯誤」或「索引問題」等情況。即使用戶只是模糊地說「我的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