posthog-analytics

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PostHog Analytics Expert

PostHog 产品分析专家

Transform PostHog data into actionable product insights. This skill combines product analytics expertise with the PostHog MCP server to help discover patterns, surface opportunities, and build a data-informed product strategy.
将PostHog数据转化为可落地的产品洞察。该技能结合了产品分析专业知识与PostHog MCP服务器,帮助发现数据规律、挖掘机会,并构建基于数据的产品策略。

Product Context Management

产品上下文管理

Before diving into analysis, establish product context. Store discovered knowledge in
.claude/product-context.md
for persistence across sessions.
在开始分析之前,先建立产品上下文。将发现的信息存储在
.claude/product-context.md
中,以便在不同会话中持续使用。

First Session: Discovery

首次会话:发现阶段

  1. Check for existing context: Read
    .claude/product-context.md
    if it exists
  2. Interview the user (if context is missing or incomplete):
    • What does the product do? Who are the users?
    • What are the key user actions/conversions?
    • What business metrics matter most?
  3. Explore PostHog data:
    • event-definitions-list
      - Discover tracked events
    • properties-list
      - Understand available properties
    • insights-get-all
      - See existing insights
    • dashboards-get-all
      - Review current dashboards
  4. Save context: Write discovered knowledge to
    .claude/product-context.md
  1. 检查现有上下文:如果存在
    .claude/product-context.md
    文件,请先读取
  2. 用户访谈(如果上下文缺失或不完整):
    • 产品的功能是什么?目标用户是谁?
    • 关键的用户行为/转化事件有哪些?
    • 最重要的业务指标是什么?
  3. 探索PostHog数据
    • event-definitions-list
      - 发现已跟踪的事件
    • properties-list
      - 了解可用的属性
    • insights-get-all
      - 查看现有洞察
    • dashboards-get-all
      - 审阅当前仪表盘
  4. 保存上下文:将发现的信息写入
    .claude/product-context.md

Context File Structure

上下文文件结构

markdown
undefined
markdown
undefined

Product Context

Product Context

Product Overview

Product Overview

[What the product does, target users]
[What the product does, target users]

Key Events

Key Events

EventMeaningImportance
$pageviewPage visitNavigation tracking
signup_completedUser registeredCore conversion
[custom events discovered]
EventMeaningImportance
$pageviewPage visitNavigation tracking
signup_completedUser registeredCore conversion
[custom events discovered]

Important Properties

Important Properties

  • user_tier: free/pro/enterprise
  • [other key properties]
  • user_tier: free/pro/enterprise
  • [other key properties]

Key Metrics

Key Metrics

  • Primary: [e.g., Weekly Active Users, Conversion Rate]
  • Secondary: [e.g., Feature Adoption, Retention]
  • Primary: [e.g., Weekly Active Users, Conversion Rate]
  • Secondary: [e.g., Feature Adoption, Retention]

Funnels

Funnels

  • Activation: signup → onboarding_complete → first_value_action
  • [other key funnels]
  • Activation: signup → onboarding_complete → first_value_action
  • [other key funnels]

Last Updated: [date]

Last Updated: [date]

undefined
undefined

Core Capabilities

核心能力

1. Proactive Insight Discovery

1. 主动洞察发现

When asked to "find insights" or "what's interesting", run this discovery workflow:
1. Trends Analysis
   - query-run: Total events over 30 days (spot volume changes)
   - query-run: DAU/WAU/MAU trends (engagement health)
   - query-run: Key conversion events over time

2. Funnel Health
   - query-run: Core activation funnel
   - query-run: Conversion funnel (trial → paid if SaaS)
   - Look for: Drop-off points, conversion changes

3. Retention Check
   - query-run: Cohort retention (week-over-week)
   - Look for: Retention curve shape, changes over time

4. Feature Adoption
   - query-run: Feature usage by user segment
   - Look for: Underused features, power user patterns

5. Error Impact
   - list-errors: Top errors by occurrence
   - error-details: Impact on user journeys
Insight Presentation Format:
undefined
当被要求“寻找洞察”或“有什么值得关注的点”时,执行以下发现流程:
1. 趋势分析
   - query-run: 过去30天的总事件数(发现数量变化)
   - query-run: DAU/WAU/MAU趋势(参与度健康度)
   - query-run: 关键转化事件随时间的变化

2. 漏斗健康度
   - query-run: 核心激活漏斗
   - query-run: 转化漏斗(如果是SaaS产品则为试用→付费)
   - 关注:流失节点、转化变化

3. 留存检查
   - query-run: 群组留存(周环比)
   - 关注:留存曲线形状、随时间的变化

4. 功能采用率
   - query-run: 按用户细分的功能使用情况
   - 关注:未充分使用的功能、核心用户使用模式

5. 错误影响
   - list-errors: 按发生次数排序的顶级错误
   - error-details: 对用户旅程的影响
洞察呈现格式:
undefined

[Insight Title]

[洞察标题]

Finding: [One sentence summary] Evidence: [Specific numbers/data] Impact: [Why this matters] Recommended Action: [What to do about it]
undefined
发现: [一句话总结] 证据: [具体数据/数字] 影响: [为什么这很重要] 建议行动: [应该采取什么措施]
undefined

2. Answering Analytics Questions

2. 解答分析类问题

Map common questions to PostHog queries:
Question PatternApproach
"How many users..."
query-run
with TrendsQuery,
math: "dau"
or
"total"
"What % convert..."
query-run
with FunnelsQuery
"Where do users drop off..."FunnelsQuery → analyze step-by-step conversion
"Which feature is most used..."TrendsQuery with breakdown by feature/event
"How is X changing over time..."TrendsQuery with
interval: "day"
or
"week"
"Who are our power users..."TrendsQuery with breakdown by user property
"What's causing errors..."
list-errors
error-details
for top issues
将常见问题映射到PostHog查询:
问题模式处理方法
"有多少用户..."使用TrendsQuery的
query-run
math: "dau"
"total"
"有多少比例的用户完成转化..."使用FunnelsQuery的
query-run
"用户在哪个环节流失..."FunnelsQuery → 逐步分析转化情况
"哪个功能的使用率最高..."按功能/事件细分的TrendsQuery
"X指标随时间如何变化..."使用
interval: "day"
"week"
的TrendsQuery
"我们的核心用户是哪些人..."按用户属性细分的TrendsQuery
"错误的原因是什么..."
list-errors
→ 针对顶级问题使用
error-details

3. Dashboard Creation

3. 仪表盘创建

When building dashboards, follow this structure:
Executive Dashboard (high-level health):
  • Active users (DAU/WAU/MAU)
  • Core conversion rate
  • Retention (week 1, week 4)
  • Revenue metrics (if applicable)
Product Dashboard (feature-level):
  • Feature adoption rates
  • Feature engagement depth
  • User journey completion
  • Error rates by feature
Growth Dashboard (acquisition/activation):
  • Signup funnel
  • Activation funnel
  • Traffic sources (if tracked)
  • Onboarding completion
Workflow:
  1. dashboard-create
    with descriptive name
  2. Build insights with
    query-run
    insight-create-from-query
  3. Add to dashboard with
    add-insight-to-dashboard
  4. Organize with
    dashboard-reorder-tiles
创建仪表盘时,遵循以下结构:
高管仪表盘(高层健康度):
  • 活跃用户数(DAU/WAU/MAU)
  • 核心转化率
  • 留存率(第1周、第4周)
  • 收入指标(如果适用)
产品仪表盘(功能层面):
  • 功能采用率
  • 功能参与深度
  • 用户旅程完成率
  • 按功能划分的错误率
增长仪表盘(获客/激活):
  • 注册漏斗
  • 激活漏斗
  • 流量来源(如果有跟踪)
  • 引导流程完成率
工作流程:
  1. 使用描述性名称执行
    dashboard-create
  2. 通过
    query-run
    构建洞察 →
    insight-create-from-query
  3. 使用
    add-insight-to-dashboard
    添加到仪表盘
  4. 使用
    dashboard-reorder-tiles
    进行布局整理

4. Experiment Design

4. 实验设计

When setting up A/B tests:
  1. Clarify hypothesis: What change, expected impact, and why
  2. Find existing flags:
    feature-flag-get-all
    (reuse if appropriate)
  3. Choose metrics: Use
    event-definitions-list
    to find trackable events
  4. Set up experiment:
    experiment-create
    with:
    • Clear name and description
    • Primary metric (what you're optimizing)
    • Secondary metrics (guardrails)
    • Appropriate sample size (MDE guidance)
See references/experiments.md for detailed experiment patterns.
设置A/B测试时:
  1. 明确假设:要做什么改变、预期影响以及原因
  2. 查找现有标志
    feature-flag-get-all
    (如果合适则复用)
  3. 选择指标:使用
    event-definitions-list
    找到可跟踪的事件
  4. 设置实验:使用
    experiment-create
    ,包含:
    • 清晰的名称和描述
    • 主要指标(你要优化的目标)
    • 次要指标(保障指标)
    • 合适的样本量(参考MDE指南)
请查看references/experiments.md获取详细的实验模式。

5. Cohort & Segment Analysis

5. 群组与细分分析

For understanding user segments:
1. Define cohort criteria (user properties, behaviors)
2. Compare cohorts on key metrics:
   - query-run with breakdownFilter by cohort property
   - Conversion rates per segment
   - Retention per segment
3. Identify highest-value segments
4. Recommend targeting strategies
用于理解用户细分群体:
1. 定义群组标准(用户属性、行为)
2. 比较不同群组的关键指标:
   - 按群组属性使用breakdownFilter的`query-run`
   - 各细分群体的转化率
   - 各细分群体的留存率
3. 识别高价值细分群体
4. 推荐针对性策略

Query Patterns

查询模式

TrendsQuery (counts over time)

TrendsQuery(随时间变化的计数)

json
{
  "kind": "InsightVizNode",
  "source": {
    "kind": "TrendsQuery",
    "dateRange": {"date_from": "-30d"},
    "interval": "day",
    "series": [{
      "kind": "EventsNode",
      "event": "event_name",
      "custom_name": "Display Name",
      "math": "total"
    }]
  }
}
Math options:
total
,
dau
,
weekly_active
,
monthly_active
,
unique_session
,
avg
,
sum
,
min
,
max
json
{
  "kind": "InsightVizNode",
  "source": {
    "kind": "TrendsQuery",
    "dateRange": {"date_from": "-30d"},
    "interval": "day",
    "series": [{
      "kind": "EventsNode",
      "event": "event_name",
      "custom_name": "Display Name",
      "math": "total"
    }]
  }
}
数学选项:
total
,
dau
,
weekly_active
,
monthly_active
,
unique_session
,
avg
,
sum
,
min
,
max

FunnelsQuery (conversion analysis)

FunnelsQuery(转化分析)

json
{
  "kind": "InsightVizNode",
  "source": {
    "kind": "FunnelsQuery",
    "dateRange": {"date_from": "-30d"},
    "series": [
      {"kind": "EventsNode", "event": "step_1", "custom_name": "Step 1"},
      {"kind": "EventsNode", "event": "step_2", "custom_name": "Step 2"},
      {"kind": "EventsNode", "event": "step_3", "custom_name": "Step 3"}
    ],
    "funnelsFilter": {
      "funnelWindowInterval": 7,
      "funnelWindowIntervalUnit": "day"
    }
  }
}
json
{
  "kind": "InsightVizNode",
  "source": {
    "kind": "FunnelsQuery",
    "dateRange": {"date_from": "-30d"},
    "series": [
      {"kind": "EventsNode", "event": "step_1", "custom_name": "Step 1"},
      {"kind": "EventsNode", "event": "step_2", "custom_name": "Step 2"},
      {"kind": "EventsNode", "event": "step_3", "custom_name": "Step 3"}
    ],
    "funnelsFilter": {
      "funnelWindowInterval": 7,
      "funnelWindowIntervalUnit": "day"
    }
  }
}

Breakdown Analysis

细分分析

Add to any query:
json
"breakdownFilter": {
  "breakdown": "property_name",
  "breakdown_type": "event"  // or "person"
}
添加到任意查询中:
json
"breakdownFilter": {
  "breakdown": "property_name",
  "breakdown_type": "event"  // or "person"
}

SaaS Metrics Framework

SaaS指标框架

For SaaS products, prioritize these metrics:
MetricQuery ApproachWhy It Matters
Activation RateFunnel: signup → key_actionValidates onboarding
DAU/MAU RatioTrends: DAU ÷ MAUEngagement stickiness
Feature AdoptionTrends: feature_used by userProduct-market fit signals
Retention (D7, D30)Cohort retention queryLong-term value predictor
Conversion (Trial→Paid)Funnel: trial_start → subscriptionRevenue health
Expansion RevenueTrends: upgrade eventsGrowth efficiency
Churn IndicatorsDeclining usage patternsEarly warning system
对于SaaS产品,优先关注以下指标:
指标查询方法重要性
激活率漏斗:注册 → 关键行为验证引导流程有效性
DAU/MAU比率趋势:DAU ÷ MAU反映用户参与粘性
功能采用率趋势:按用户划分的功能使用情况产品市场契合度信号
留存率(D7, D30)群组留存查询长期价值预测指标
转化率(试用→付费)漏斗:试用开始 → 订阅收入健康度指标
扩展收入趋势:升级事件增长效率指标
流失预警使用率下降模式早期预警系统

Resources

资源

  • references/experiments.md - Detailed experiment design patterns
  • references/saas-playbook.md - SaaS-specific analytics strategies
  • references/experiments.md - 详细的实验设计模式
  • references/saas-playbook.md - SaaS专属分析策略