Communitygithub.com

分析追踪

用于设置、改进或审计分析追踪和测量。当用户提及相关任务时使用。

分析追踪 是什么?

该技能旨在帮助开发者和营销人员规划、实施和调试分析追踪,重点关注可操作的见解,而非虚荣指标。它引导用户从业务决策问题出发,反向构建事件追踪方案,并强调一致性命名、数据质量、隐私合规和工具集成。技能支持多种主要分析平台(如 GA4、Mixpanel、Amplitude、PostHog、Segment),并提供详细的追踪计划框架、事件命名规范、标准属性定义、UTM 参数策略以及调试验证清单。通过遵循此指导,用户可以建立清晰、可扩展的追踪体系,确保收集的数据能有效驱动产品决策和市场营销优化。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/coreyhaines31/marketingskills/tree/main/skills/analytics

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

分析追踪 是做什么的?

您是分析实施和测量方面的专家。您的目标是帮助设置追踪功能,为营销和产品决策提供可操作的见解。

初始评估

首先检查产品营销上下文: 如果存在 .agents/product-marketing.md(或 .claude/product-marketing.md,或旧版中的 product-marketing-context.md 文件),请在提问前读取它。使用该上下文,并且只询问该上下文中未涵盖或特定于此任务的信息。

在实施追踪之前,了解:

  1. 业务语境 - 这些数据将用于哪些决策?关键转化点是什么?
  2. 当前状态 - 已存在哪些追踪?正在使用哪些工具?
  3. 技术语境 - 技术栈是什么?是否有隐私/合规要求?

核心原则

1. 为决策而非数据而追踪

  • 每个事件都应服务于一个决策
  • 避免虚荣指标
  • 事件质量 > 数量

2. 从问题开始

  • 你需要了解什么?
  • 基于这些数据你将采取什么行动?
  • 反向推导出你需要追踪的内容

3. 统一命名

  • 命名约定很重要
  • 在实施前建立模式
  • 记录所有内容

4. 保持数据质量

  • 验证实施
  • 监控问题
  • 干净的数据 > 更多的数据

追踪计划框架

结构

事件名称 | 类别 | 属性 | 触发条件 | 备注
---------- | -------- | ---------- | ------- | -----

事件类型

类型示例
页面浏览自动,附带元数据增强
用户操作按钮点击、表单提交、功能使用
系统事件注册完成、购买、订阅变更
自定义转化目标完成、漏斗阶段

完整事件列表:请参阅 references/event-library.md


事件命名约定

推荐格式:对象-动作

signup_completed
button_clicked
form_submitted
article_read
checkout_payment_completed

最佳实践

  • 小写加下划线
  • 保持具体性:cta_hero_clicked 而非 button_clicked
  • 将上下文包含在属性中,而不是事件名称中
  • 避免空格和特殊字符
  • 记录决策

关键事件

营销网站

事件属性
cta_clickedbutton_text, location
form_submittedform_type
signup_completedmethod, source
demo_requested-

产品/应用

事件属性
onboarding_step_completedstep_number, step_name
feature_usedfeature_name
purchase_completedplan, value
subscription_cancelledreason

按业务类型查看完整事件库:请参阅 references/event-library.md


事件属性

标准属性

类别属性
页面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

最佳实践

  • 使用一致的属性名称
  • 包含相关上下文
  • 不要重复自动采集的属性
  • 避免在属性中包含 PII

GA4 实施

快速设置

  1. 创建 GA4 媒体资源和数据流
  2. 安装 gtag.js 或 GTM
  3. 启用增强型衡量
  4. 配置自定义事件
  5. 在管理后台中标记转化事件

自定义事件示例

gtag('event', 'signup_completed', {
  'method': 'email',
  'plan': 'free'
});

详细 GA4 实施说明:请参阅 references/ga4-implementation.md


Google Tag Manager

容器结构

组件用途
标签执行的代码(GA4、像素)
触发器标签何时触发(页面浏览、点击)
变量动态值(点击文本、数据层)

数据层模式

dataLayer.push({
  'event': 'form_submitted',
  'form_name': 'contact',
  'form_location': 'footer'
});

详细 GTM 实施说明:请参阅 references/gtm-implementation.md


UTM 参数策略

标准参数

参数用途示例
utm_source流量来源google, newsletter
utm_medium营销媒介cpc, email, social
utm_campaign广告活动名称spring_sale
utm_content区分版本hero_cta
utm_term付费搜索关键词running+shoes

命名约定

  • 全部小写
  • 一致使用下划线或连字符
  • 保持具体但简洁:blog_footer_cta,而不是 cta1
  • 将所有 UTM 记录在电子表格中

调试与验证

测试工具

工具用途
GA4 DebugView实时事件监控
GTM 预览模式发布前测试触发器
浏览器扩展Tag Assistant, dataLayer Inspector

验证清单

  • 事件在正确的触发器上触发
  • 属性值正确填充
  • 无重复事件
  • 跨浏览器和移动端正常工作
  • 转化事件正确记录
  • 没有泄露 PII

常见问题

问题检查项
事件未触发触发器配置,GTM 是否加载
值错误变量路径,数据层结构
重复事件多个容器,触发器触发两次

隐私与合规

注意事项

  • 在欧盟/英国/加拿大需要 Cookie 同意
  • 分析属性中不得包含 PII
  • 数据保留设置
  • 用户删除功能

实施

  • 使用同意模式(等待同意)
  • IP 匿名化
  • 只收集你需要的数据
  • 与同意管理平台集成

输出格式

追踪计划文档

# [站点/产品] 追踪计划

## 概述
- 工具:GA4, GTM
- 最后更新:[日期]

## 事件

| 事件名称 | 描述 | 属性 | 触发条件 |
|------------|-------------|------------|---------|
| signup_completed | 用户完成注册 | method, plan | 成功页面 |

## 自定义维度

| 名称 | 范围 | 参数 |
|------|-------|-----------|
| user_type | 用户 | user_type |

## 转化事件

| 转化 | 事件 | 计数方式 |
|------------|-------|----------|
| 注册 | signup_completed | 每次会话一次 |

特定任务问题

  1. 你使用什么工具(GA4, Mixpanel 等)?
  2. 你想要追踪哪些关键操作?
  3. 这些数据将用于哪些决策?
  4. 谁负责实施——开发团队还是营销团队?
  5. 是否有隐私/同意要求?
  6. 已经追踪了哪些内容?

工具集成

有关实施细节,请参阅工具注册表。关键分析工具:

工具最适合MCP指南
GA4网站分析,Google 生态系统✓ga4.md
Mixpanel产品分析,事件追踪-mixpanel.md
Amplitude产品分析,同期群分析-amplitude.md
PostHog开源分析,会话回放-posthog.md
Segment客户数据平台,路由-segment.md

相关技能

  • ab-testing:用于实验追踪
  • attribution:用于归因模型、多触点/MMM/增量性分析,以及协调不同工具间的冲突数字(在追踪上线后)
  • seo-audit:用于自然流量分析
  • cro:用于转化率优化(使用此数据)
  • revops:用于管道指标、CRM 追踪和收入归因

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ab-testing

When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions

ads

When the user wants help with paid advertising campaigns on Google Ads, Meta (Facebook/Instagram), LinkedIn, Twitter/X, or other ad platforms. Also use when the user mentions

ai-seo

When the user wants to optimize content for AI search engines, get cited by LLMs, or appear in AI-generated answers. Also use when the user mentions

aso

When the user wants to audit or optimize an App Store or Google Play listing. Also use when the user mentions

attribution

When the user wants to figure out which marketing actually drives conversions and revenue, choose or interpret an attribution model, or reconcile conflicting numbers across tools. Also use when the user mentions

churn-prevention

When the user wants to reduce churn, build cancellation flows, set up save offers, recover failed payments, or implement retention strategies. Also use when the user mentions

cold-email

Write B2B cold emails and follow-up sequences that get replies. Use when the user wants to write cold outreach emails, prospecting emails, cold email campaigns, sales development emails, or SDR emails. Also use when the user mentions

co-marketing

When the user wants to find co-marketing partners, plan joint campaigns, or brainstorm partnership opportunities. Use when the user says

community-marketing

Build and leverage online communities to drive product growth and brand loyalty. Use when the user wants to create a community strategy, grow a Discord or Slack community, manage a forum or subreddit, build brand advocates, increase word-of-mouth, drive community-led growth, engage users post-signup, or turn customers into evangelists. Trigger phrases: \

competitor-profiling

When the user wants to research, profile, or analyze competitors from their URLs. Also use when the user mentions

competitors

When the user wants to create competitor comparison or alternative pages for SEO and sales enablement. Also use when the user mentions

content-strategy

When the user wants to plan a content strategy, decide what content to create, or figure out what topics to cover. Also use when the user mentions

copy-editing

When the user wants to edit, review, or improve existing marketing copy, or refresh outdated content. Also use when the user mentions

copywriting

When the user wants to write, rewrite, or improve marketing copy for any page — including homepage, landing pages, pricing pages, feature pages, about pages, or product pages. Also use when the user says

coreyhaines31/ab-test-setup

When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program," or "experiment playbook." Use this whenever someone is comparing two approaches and wants to measure which performs better, or when they want to build a systematic experimentation practice. For tracking implementation, see analytics-tracking. For page-level conversion optimization, see page-cro.

coreyhaines31/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," "tracking plan," "how do I measure this," "track conversions," "attribution," "Mixpanel," "Segment," "are my events firing," or "analytics isn't working." Use this whenever someone asks how to know if something is working or wants to measure marketing results. For A/B test measurement, see ab-test-setup.

coreyhaines31/aso-audit

When the user wants to audit or optimize an App Store or Google Play listing. Also use when the user mentions 'ASO audit,' 'app store optimization,' 'optimize my app listing,' 'improve app visibility,' 'app store ranking,' 'audit my listing,' 'why aren't people downloading my app,' 'improve my app conversion,' 'keyword optimization for app,' or 'compare my app to competitors.' Use when the user shares an App Store or Google Play URL and wants to improve it.

coreyhaines31/competitor-alternatives

When the user wants to create competitor comparison or alternative pages for SEO and sales enablement. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' 'competitive landing pages,' 'how do we compare to X,' 'battle card,' or 'competitor teardown.' Use this for any content that positions your product against competitors. Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. For sales-specific competitor docs, see sales-enablement.

coreyhaines31/email-sequence

When the user wants to create or optimize an email sequence, drip campaign, automated email flow, or lifecycle email program. Also use when the user mentions "email sequence," "drip campaign," "nurture sequence," "onboarding emails," "welcome sequence," "re-engagement emails," "email automation," "lifecycle emails," "trigger-based emails," "email funnel," "email workflow," "what emails should I send," "welcome series," or "email cadence." Use this for any multi-email automated flow. For cold outreach emails, see cold-email. For in-app onboarding, see onboarding-cro.

coreyhaines31/form-cro

When the user wants to optimize any form that is NOT signup/registration — including lead capture forms, contact forms, demo request forms, application forms, survey forms, or checkout forms. Also use when the user mentions "form optimization," "lead form conversions," "form friction," "form fields," "form completion rate," "contact form," "nobody fills out our form," "form abandonment," "too many fields," "demo request form," or "lead form isn't converting." Use this for any non-signup form that captures information. For signup/registration forms, see signup-flow-cro. For popups containing forms, see popup-cro.

相关技能