analytics-tracking
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAnalytics 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 exists, read it before asking questions. Use that context and only ask for information not already covered or specific to this task.
.claude/product-marketing-context.mdBefore 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?
首先检查产品营销背景:
如果存在文件,请在提问前阅读该文件。利用其中的背景信息,仅询问未涵盖或与本次任务相关的特定信息。
.claude/product-marketing-context.md在实施追踪前,需了解以下内容:
- 业务背景 - 这些数据将为哪些决策提供支撑?核心转化目标是什么?
- 当前状态 - 已存在哪些追踪方案?正在使用哪些工具?
- 技术背景 - 技术栈是什么?有哪些隐私/合规要求?
Core Principles
核心原则
1. Track for Decisions, Not Data
1. 为决策而非数据追踪
- Every event should inform a decision
- Avoid vanity metrics
- Quality > quantity of events
- 每个事件都应服务于决策
- 避免虚荣指标
- 事件质量重于数量
2. Start with the Questions
2. 从问题出发
- 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
3. 命名保持一致
- Naming conventions matter
- Establish patterns before implementing
- Document everything
- 命名规范至关重要
- 在实施前确立命名模式
- 对所有内容进行文档记录
4. Maintain Data Quality
4. 维护数据质量
- Validate implementation
- Monitor for issues
- Clean data > more data
- 验证实施效果
- 监控问题
- 干净的数据优于更多的数据
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
| 类型 | 示例 |
|---|---|
| 页面浏览 | 自动触发,附带元数据增强 |
| 用户操作 | 按钮点击、表单提交、功能使用 |
| 系统事件 | 注册完成、购买、订阅变更 |
| 自定义转化 | 目标完成、漏斗阶段 |
完整事件列表:请查看references/event-library.md
Event Naming Conventions
事件命名规范
Recommended Format: Object-Action
推荐格式:对象-动作
signup_completed
button_clicked
form_submitted
article_read
checkout_payment_completedsignup_completed
button_clicked
form_submitted
article_read
checkout_payment_completedBest Practices
最佳实践
- Lowercase with underscores
- Be specific: vs.
cta_hero_clickedbutton_clicked - Include context in properties, not event name
- Avoid spaces and special characters
- Document decisions
- 小写字母加下划线
- 具体明确:优于
cta_hero_clickedbutton_clicked - 在属性中包含上下文信息,而非事件名称
- 避免空格和特殊字符
- 记录所有命名决策
Essential Events
核心事件
Marketing Site
营销站点
| Event | Properties |
|---|---|
| cta_clicked | button_text, location |
| form_submitted | form_type |
| signup_completed | method, source |
| demo_requested | - |
| 事件 | 属性 |
|---|---|
| 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
| 事件 | 属性 |
|---|---|
| onboarding_step_completed | step_number, step_name |
| feature_used | feature_name |
| purchase_completed | plan, value |
| subscription_cancelled | reason |
按业务类型分类的完整事件库:请查看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 |
| 分类 | 属性 |
|---|---|
| 页面 | page_title, page_location, page_referrer |
| 用户 | user_id, user_type, account_id, plan_type |
| 营销活动 | source, medium, campaign, content, term |
| 产品 | product_id, product_name, category, price |
Best Practices
最佳实践
- Use consistent property names
- Include relevant context
- Don't duplicate automatic properties
- Avoid PII in properties
- 使用一致的属性名称
- 包含相关上下文信息
- 不重复自动收集的属性
- 属性中避免包含个人身份信息(PII)
GA4 Implementation
GA4 实施
Quick Setup
快速设置
- Create GA4 property and data stream
- Install gtag.js or GTM
- Enable enhanced measurement
- Configure custom events
- Mark conversions in Admin
- 创建GA4媒体资源和数据流
- 安装gtag.js或GTM
- 启用增强型测量
- 配置自定义事件
- 在管理员后台标记转化目标
Custom Event Example
自定义事件示例
javascript
gtag('event', 'signup_completed', {
'method': 'email',
'plan': 'free'
});For detailed GA4 implementation: See references/ga4-implementation.md
javascript
gtag('event', 'signup_completed', {
'method': 'email',
'plan': 'free'
});GA4详细实施指南:请查看references/ga4-implementation.md
Google Tag Manager
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) |
| 组件 | 用途 |
|---|---|
| 标签 | 执行的代码(GA4、像素代码等) |
| 触发器 | 标签触发的时机(页面浏览、点击等) |
| 变量 | 动态值(点击文本、数据层) |
Data Layer Pattern
数据层模式
javascript
dataLayer.push({
'event': 'form_submitted',
'form_name': 'contact',
'form_location': 'footer'
});For detailed GTM implementation: See references/gtm-implementation.md
javascript
dataLayer.push({
'event': 'form_submitted',
'form_name': 'contact',
'form_location': 'footer'
});GTM详细实施指南:请查看references/gtm-implementation.md
UTM Parameter Strategy
UTM 参数策略
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 |
| 参数 | 用途 | 示例 |
|---|---|---|
| utm_source | 流量来源 | google, newsletter |
| utm_medium | 营销媒介 | cpc, email, social |
| utm_campaign | 营销活动名称 | spring_sale |
| utm_content | 区分不同版本 | hero_cta |
| utm_term | 付费搜索关键词 | running+shoes |
Naming Conventions
命名规范
- Lowercase everything
- Use underscores or hyphens consistently
- Be specific but concise: , not
blog_footer_ctacta1 - Document all UTMs in a spreadsheet
- 全部使用小写
- 统一使用下划线或连字符
- 具体且简洁:,而非
blog_footer_ctacta1 - 在电子表格中记录所有UTM参数
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 |
| 工具 | 用途 |
|---|---|
| GA4 DebugView | 实时事件监控 |
| GTM预览模式 | 发布前测试触发器 |
| 浏览器扩展程序 | 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 |
| 问题 | 检查项 |
|---|---|
| 事件未触发 | 触发器配置、GTM是否加载 |
| 值不正确 | 变量路径、数据层结构 |
| 重复事件 | 多个容器、触发器重复触发 |
Privacy and Compliance
隐私与合规
Considerations
注意事项
- Cookie consent required in EU/UK/CA
- No PII in analytics properties
- Data retention settings
- User deletion capabilities
- 欧盟/英国/加拿大地区需要Cookie同意
- 分析属性中不包含个人身份信息(PII)
- 数据保留设置
- 用户数据删除能力
Implementation
实施要点
- Use consent mode (wait for consent)
- IP anonymization
- Only collect what you need
- Integrate with consent management platform
- 使用同意模式(等待用户同意)
- IP匿名化
- 仅收集必要数据
- 与同意管理平台集成
Output Format
输出格式
Tracking Plan Document
追踪计划文档
markdown
undefinedmarkdown
undefined[Site/Product] Tracking Plan
[站点/产品] 追踪计划
Overview
概述
- Tools: GA4, GTM
- Last updated: [Date]
- 工具:GA4, GTM
- 最后更新:[日期]
Events
事件
| Event Name | Description | Properties | Trigger |
|---|---|---|---|
| signup_completed | User completes signup | method, plan | Success page |
| 事件名称 | 描述 | 属性 | 触发条件 |
|---|---|---|---|
| signup_completed | 用户完成注册 | method, plan | 成功页面 |
Custom Dimensions
自定义维度
| Name | Scope | Parameter |
|---|---|---|
| user_type | User | user_type |
| 名称 | 范围 | 参数 |
|---|---|---|
| user_type | 用户 | user_type |
Conversions
转化目标
| Conversion | Event | Counting |
|---|---|---|
| Signup | signup_completed | Once per session |
---| 转化目标 | 事件 | 统计方式 |
|---|---|---|
| 注册 | signup_completed | 每会话一次 |
---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?
- 您正在使用哪些工具(GA4、Mixpanel等)?
- 您想要跟踪哪些关键操作?
- 这些数据将为哪些决策提供依据?
- 由谁负责实施 - 开发团队还是营销团队?
- 有哪些隐私/合规要求?
- 目前已在跟踪哪些内容?
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 |
如需实施指南,请查看tools registry。核心分析工具:
| 工具 | 最佳用途 | MCP | 指南 |
|---|---|---|---|
| GA4 | 网页分析、谷歌生态系统 | ✓ | ga4.md |
| Mixpanel | 产品分析、事件跟踪 | - | mixpanel.md |
| Amplitude | 产品分析、群组分析 | - | amplitude.md |
| PostHog | 开源分析、会话重放 | - | posthog.md |
| Segment | 客户数据平台、数据路由 | - | segment.md |
Related Skills
相关技能
- ab-test-setup: For experiment tracking
- seo-audit: For organic traffic analysis
- page-cro: For conversion optimization (uses this data)
- ab-test-setup:用于实验跟踪
- seo-audit:用于自然流量分析
- page-cro用于转化优化(基于本技能提供的数据)