aa-segment-performance-comparator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSegment Performance Comparator (Adobe Analytics)
细分群体性能比较器(Adobe Analytics)
Compare the performance of two or more audience segments across key metrics
side by side to understand how different visitor groups behave. Uses direct
segment-vs-segment comparison to determine a winner, loser, and spread for
each metric, with a separate context panel showing segment sizing.
AA Call Budget: AA'saccepts a singlerunReportper call. For N segments × M metrics the comparison requires N×M calls, plus 1 baseline call for the segment-size context panel. For 3 segments × 5 metrics = 16 calls. Limit to 4 segments and 6 metrics for practical performance. Always confirm the segment/metric list with the user before starting.segmentId
可并排比较两个或多个受众细分群体在关键指标上的表现,以了解不同访客群体的行为模式。通过直接的细分群体间对比,确定每个指标的优胜者、落后者及差异幅度,并通过单独的上下文面板展示细分群体的规模。
AA调用预算: AA的每次调用仅接受一个runReport。对于N个细分群体×M个指标的对比,需要N×M次调用,再加上1次用于细分群体规模上下文面板的基准调用。例如3个细分群体×5个指标=16次调用。为保证实际性能,限制最多4个细分群体和6个指标。开始前务必与用户确认细分群体/指标列表。segmentId
AA MCP Tools Used
使用的AA MCP工具
- — select report suite
findReportSuites - — set session context (reportSuiteId + globalCompanyId)
setSessionDefaults - — discover and select comparison segments
findSegments - — resolve metric IDs
findMetrics - — one call per segment per metric, plus one unsegmented call for sizing context
runReport
- — 选择报告套件
findReportSuites - — 设置会话上下文(reportSuiteId + globalCompanyId)
setSessionDefaults - — 发现并选择对比细分群体
findSegments - — 解析指标ID
findMetrics - — 每个细分群体每个指标调用一次,再加上一次用于规模上下文的无细分群体调用
runReport
Phase 0 — Setup
阶段0 — 准备工作
- Confirm report suite with /
findReportSuites.setSessionDefaults
findReportSuites(globalCompanyId: "<gcid>", page: 0, limit: 10)
setSessionDefaults(globalCompanyId: "<gcid>", reportSuiteId: "<rsid>")- 通过/
findReportSuites确认报告套件。setSessionDefaults
findReportSuites(globalCompanyId: "<gcid>", page: 0, limit: 10)
setSessionDefaults(globalCompanyId: "<gcid>", reportSuiteId: "<rsid>")Phase 1 — Select Segments
阶段1 — 选择细分群体
Ask the user which segments to compare. If not specified, prompt:
"Which visitor audiences would you like to compare? For example: Mobile vs. Desktop, New vs. Returning, Paid Search vs. Organic, or specific named segments from your library."
Search for and confirm each segment:
findSegments(page: 0, limit: 50)询问用户要对比哪些细分群体。如果未指定,提示:
“您想要对比哪些访客受众?例如:移动端 vs 桌面端、新访客 vs 回访访客、付费搜索 vs 自然搜索,或者您库中的特定命名细分群体。”
搜索并确认每个细分群体:
findSegments(page: 0, limit: 50)Filter locally by name. Built-in IDs: "Paid_Search", "Purchasers", "Return_Visits"
按名称本地过滤。内置ID:"Paid_Search", "Purchasers", "Return_Visits"
> **Note:** `findSegments` does not accept a `searchTerm` parameter. Retrieve all segments
> and filter by name locally. Built-in template segments have short IDs like "Paid_Search"
> that can be passed directly as `segmentIds` in `runReport`.
If the user requests a segment that doesn't exist by name, offer to build
it first using the aa-segment-builder skill, or suggest the closest existing
segment from search results.
Limit: 4 segments maximum per comparison. Advise this limit upfront.
---
> **注意:** `findSegments`不接受`searchTerm`参数。需获取所有细分群体并按名称本地过滤。内置模板细分群体的ID较短,如"Paid_Search",可直接作为`runReport`中的`segmentIds`传入。
如果用户请求的细分群体不存在,可先使用aa-segment-builder技能创建,或从搜索结果中推荐最接近的现有细分群体。
限制:每次对比最多4个细分群体。需提前告知此限制。
---Phase 2 — Select Metrics
阶段2 — 选择指标
Ask the user which metrics to compare. Suggest a balanced mix:
- Volume:
metrics/visits - Engagement: ,
metrics/pageviews,metrics/bounceratemetrics/pagespervisit - Conversion: , conversion rate calculated metric
metrics/orders - Revenue:
metrics/revenue
Call to resolve each metric ID:
findMetricsfindMetrics(expansions: "componentType,categories", page: 0, limit: 200)询问用户要对比哪些指标。建议均衡组合:
- 流量类:
metrics/visits - 参与度类: ,
metrics/pageviews,metrics/bounceratemetrics/pagespervisit - 转化类: , 计算得出的转化率指标
metrics/orders - 营收类:
metrics/revenue
调用解析每个指标ID:
findMetricsfindMetrics(expansions: "componentType,categories", page: 0, limit: 200)Filter locally by name. Key IDs: metrics/visits, metrics/revenue, metrics/orders, metrics/bouncerate
按名称本地过滤。关键ID:metrics/visits, metrics/revenue, metrics/orders, metrics/bouncerate
Limit: 6 metrics maximum. Confirm the final list with the user:
> "I'll compare these 3 segments across 5 metrics. This requires 16 report
> calls (3 segments × 5 metrics + 1 sizing call). OK to proceed?"
---
限制:最多6个指标。需与用户确认最终列表:
> “我将对比这3个细分群体的5个指标。这需要16次报告调用(3个细分群体×5个指标 + 1次规模调用)。是否可以开始?”
---Phase 3 — Select Date Range
阶段3 — 选择日期范围
Ask for or confirm the analysis period:
- Last 7 days (good for quick comparison)
- Last 30 days (recommended default)
- Last 90 days (for seasonal smoothing)
- Custom range
询问或确认分析周期:
- 最近7天(适合快速对比)
- 最近30天(推荐默认值)
- 最近90天(用于季节性平滑)
- 自定义范围
Phase 4 — Run Comparison Reports
阶段4 — 运行对比报告
4.1 Segment sizing (context only)
4.1 细分群体规模(仅上下文)
Run a single unsegmented call for to get the total
population size, then one call per segment for to
compute each segment's share of total. These sizing values populate the
context panel — they are not used in the comparison matrix.
metrics/visitsmetrics/visitsrunReport(
dimensionId: "variables/page",
metricIds: "metrics/visits",
startDate: "<start>",
endDate: "<end>",
limit: 1
)运行一次无细分群体的调用以获取总受众规模,然后为每个细分群体运行一次调用,计算每个细分群体占总规模的比例。这些规模值用于填充上下文面板——不用于对比矩阵。
metrics/visitsmetrics/visitsrunReport(
dimensionId: "variables/page",
metricIds: "metrics/visits",
startDate: "<start>",
endDate: "<end>",
limit: 1
)allVisitorVisits = summaryData.totals[0]
allVisitorVisits = summaryData.totals[0]
undefinedrunReport(
dimensionId: "variables/page",
metricIds: "metrics/visits",
segmentIds: "<segmentId>",
startDate: "<start>",
endDate: "<end>",
limit: 1
)
undefinedrunReport(
dimensionId: "variables/page",
metricIds: "metrics/visits",
segmentIds: "<segmentId>",
startDate: "<start>",
endDate: "<end>",
limit: 1
)
segmentVisits = summaryData.totals[0]; shareOfTotal = segmentVisits / allVisitorVisits × 100
segmentVisits = summaryData.totals[0]; shareOfTotal = segmentVisits / allVisitorVisits × 100
> Reuse these results if `metrics/visits` is already a comparison metric.
> 如果`metrics/visits`已作为对比指标,可复用这些结果。4.2 Per segment per metric
4.2 每个细分群体每个指标
For each segment × metric combination:
runReport(
dimensionId: "variables/page",
metricIds: "<metricId>", # note: "metricIds" not "metricId"
segmentIds: "<segmentId>", # note: "segmentIds" not "segmentId"
startDate: "<start>",
endDate: "<end>",
limit: 1
)针对每个细分群体×指标组合:
runReport(
dimensionId: "variables/page",
metricIds: "<metricId>", # 注意:是"metricIds"而非"metricId"
segmentIds: "<segmentId>", # 注意:是"segmentIds"而非"segmentId"
startDate: "<start>",
endDate: "<end>",
limit: 1
)Total = summaryData.totals[0]
Total = summaryData.totals[0]
> Read totals from `summaryData.totals[0]` (not `rows[]`). `dimensionId` is required — use any dimension with `limit: 1` for aggregate totals. Segment IDs are the raw `id` field from `findSegments`.
Track progress: "Fetching Segment 2 of 3, metric 3 of 5..."
---
> 从`summaryData.totals[0]`读取总计值(而非`rows[]`)。`dimensionId`是必填项——使用任意维度并设置`limit: 1`以获取聚合总计值。细分群体ID为`findSegments`返回的原始`id`字段。
跟踪进度:“正在获取第2个细分群体(共3个),第3个指标(共5个)...”
---Phase 5 — Build the Comparison Matrix
阶段5 — 构建对比矩阵
The matrix compares segments directly to each other — no baseline column.
For each metric row, compute:
| Computed Value | Formula |
|---|---|
| Segment value | Raw from |
| Winner | Segment with the best value for this metric |
| Loser | Segment with the worst value for this metric |
| Spread | (max − min) / max × 100 |
| Significant? | |
For metrics where lower is better (bounce rate, cost per acquisition),
invert the winner/loser logic — the segment with the lowest value
wins. Mark these metrics clearly in the report.
矩阵直接对比各细分群体——无基准列。
针对每个指标行,计算:
| 计算值 | 公式 |
|---|---|
| 细分群体值 | 来自 |
| 优胜者 | 该指标表现最佳的细分群体 |
| 落后者 | 该指标表现最差的细分群体 |
| 差异幅度 | (最大值 − 最小值) / 最大值 × 100 |
| 是否显著? | 若差异幅度>10%则为 |
对于数值越低越好的指标(跳出率、获客成本),反转优胜者/落后者逻辑——数值最低的细分群体获胜。需在报告中明确标记这些指标。
5.1 Segment profile summary
5.1 细分群体概况总结
For each segment, compute an overall performance profile:
- Wins: count of metrics where this segment ranks #1
- Losses: count of metrics where this segment ranks last
- Biggest edge: metric where this segment outperforms others by the widest spread
- Visits share: percentage of total visits from the context panel
针对每个细分群体,计算整体表现概况:
- 获胜次数: 该细分群体排名第一的指标数量
- 落后次数: 该细分群体排名最后的指标数量
- 最大优势: 该细分群体领先其他群体幅度最大的指标
- 访问量占比: 来自上下文面板的总访问量占比
Phase 6 — Generate HTML Comparison Report
阶段6 — 生成HTML对比报告
Build the comparison report inline and write to
.
/tmp/aa_segment_comparator_report_<YYYY-MM-DD_HHMMSS>.html在线构建对比报告并写入。
/tmp/aa_segment_comparator_report_<YYYY-MM-DD_HHMMSS>.htmlHTML template
HTML模板
Read and use it verbatim. Do not improvise the
HTML structure or CSS — only fill in the tokens (,
, , , ,
, , , , ,
, , , ,
, , ) and repeat segment chips,
matrix rows, and insight boxes once per data item. Use the /
classes per Phase 5 winner/loser rules.
template.html{PLACEHOLDER}{ORG_NAME}{DATE_RANGE}{REPORT_SUITE}{GENERATED_DATE}{SEGMENT_NAMES_SUMMARY}{SEGMENT_NAME}{COLOR}{VISITOR_COUNT}{NUM_SEGMENTS}{NUM_METRICS}{NUM_SIGNIFICANT}{OVERALL_WINNER}{METRIC_NAME}{VALUE}{WINNER_SEGMENT}{SPREAD}{INSIGHT_TEXT}cell-winnercell-loserSection titles — no phase prefix: Section headings in the HTML report must not include
the phase number. Use the plain section name only (e.g., "Segment Comparison" not "Phase 2 — Segment Comparison",
"Metric Details" not "Phase 3 — Metric Details").
Write to and open:
/tmp/aa_segment_comparator_report_<YYYY-MM-DD_HHMMSS>.htmlbash
open /tmp/aa_segment_comparator_report_<YYYY-MM-DD_HHMMSS>.html直接使用,不得自行修改HTML结构或CSS——仅填充占位符(、、、、、、、、、、、、、、、、),并根据数据项重复细分群体标签、矩阵行和洞察框。根据阶段5的优胜者/落后者规则使用 / 类。
template.html{PLACEHOLDER}{ORG_NAME}{DATE_RANGE}{REPORT_SUITE}{GENERATED_DATE}{SEGMENT_NAMES_SUMMARY}{SEGMENT_NAME}{COLOR}{VISITOR_COUNT}{NUM_SEGMENTS}{NUM_METRICS}{NUM_SIGNIFICANT}{OVERALL_WINNER}{METRIC_NAME}{VALUE}{WINNER_SEGMENT}{SPREAD}{INSIGHT_TEXT}cell-winnercell-loser章节标题——无阶段前缀:HTML报告中的章节标题不得包含阶段编号。仅使用纯章节名称(例如,“细分群体对比”而非“阶段2 — 细分群体对比”,“指标详情”而非“阶段3 — 指标详情”)。
写入并打开:
/tmp/aa_segment_comparator_report_<YYYY-MM-DD_HHMMSS>.htmlbash
open /tmp/aa_segment_comparator_report_<YYYY-MM-DD_HHMMSS>.htmlInline Summary (Always Deliver)
文本摘要(必选)
Always follow the HTML report with a text summary:
Segment Comparison — [Date Range] | Report Suite: [Name]
Segment Context: Mobile 48,200 visits (38.7%) Desktop 72,400 (58.2%)
Mobile Desktop Winner Spread
──────────────── ─────── ──────── ───────── ──────
Visits 48,200 72,400 Desktop 33%
Bounce Rate 61.4% 40.1% ✓ Desktop 35% ✦
Conversion Rate 1.2% 3.1% ✓ Desktop 61% ✦
Revenue $9,400 $31,200 Desktop 70% ✦
✦ = spread > 10% ✓ = winner
Key findings:
- Desktop converts 2.6× better (3.1% vs 1.2%). Prioritize mobile checkout.
- Paid Search (not shown) has highest CVR at 4.8% — most efficient channel.HTML报告后需附带文本摘要:
细分群体对比 — [日期范围] | 报告套件:[名称]
细分群体上下文:移动端 48,200次访问(38.7%) 桌面端 72,400次访问(58.2%)
移动端 桌面端 优胜者 差异幅度
──────────────── ─────── ──────── ───────── ──────
访问量 48,200 72,400 桌面端 33%
跳出率 61.4% 40.1% ✓ 桌面端 35% ✦
转化率 1.2% 3.1% ✓ 桌面端 61% ✦
营收 $9,400 $31,200 桌面端 70% ✦
✦ = 差异幅度>10% ✓ = 优胜者
关键发现:
- 桌面端转化率是移动端的2.6倍(3.1% vs 1.2%)。优先优化移动端结账流程。
- 付费搜索(未展示)的转化率最高,达4.8%——是最有效的渠道。Guardrails
约束规则
- Confirm segments and metrics with the user before starting — the call count is N×M and can grow quickly.
- For bounce rate and other "lower is better" metrics, invert the winner logic — the segment with the lowest value wins. Label these metrics clearly in the report (e.g., "↓ lower is better").
- If a segment returns very few visits (< 1,000), note that results may not be statistically reliable.
- Do not show baseline delta percentages (segment vs. All Visitors) in the comparison matrix. Segments are subsets of the total population, so count-metric deltas are always negative and misleading. Use the context panel for segment sizing instead.
- 开始前务必与用户确认细分群体和指标——调用次数为N×M,可能快速增加。
- 对于跳出率等“数值越低越好”的指标,反转优胜者逻辑——数值最低的细分群体获胜。需在报告中明确标记这些指标(例如,“↓ 数值越低越好”)。
- 如果某个细分群体的访问量极少(<1000次),需注明结果可能不具备统计可靠性。
- 不要在对比矩阵中展示基准差值百分比(细分群体 vs 所有访客)。细分群体是总受众的子集,因此计数指标的差值始终为负且具有误导性。应使用上下文面板展示细分群体规模。
Example Interaction
交互示例
"Compare our mobile and desktop visitors on conversion metrics."
- Confirm report suite.
- Find segments: "Mobile Devices" and "Desktop" (or offer to create them).
- Confirm metrics: visits, bounce rate, orders, conversion rate, revenue.
- Date range: last 30 days.
- Preview: "2 segments × 5 metrics + 1 sizing call = 11 reports. Proceed?"
- Run all reports; announce progress.
- Context: Mobile = 48.2k visits (38.7%), Desktop = 72.4k visits (58.2%).
- Matrix: Desktop wins 3 of 5 metrics. Conversion rate spread 61%.
- Generate HTML report and open.
- Insight: "Desktop is your primary conversion engine. Mobile drives volume (39% of visits) but converts at 1.2% vs. Desktop's 3.1% — a 61% spread. Prioritize mobile checkout optimization for the biggest conversion lift opportunity."
“对比我们移动端和桌面端访客的转化指标。”
- 确认报告套件。
- 查找细分群体:“移动设备”和“桌面端”(或提供创建选项)。
- 确认指标:访问量、跳出率、订单量、转化率、营收。
- 日期范围:最近30天。
- 预览:“2个细分群体×5个指标 + 1次规模调用 = 11次报告调用。是否继续?”
- 运行所有报告;告知进度。
- 上下文:移动端=48.2k次访问(38.7%),桌面端=72.4k次访问(58.2%)。
- 矩阵:桌面端在5个指标中获胜3个。转化率差异幅度为61%。
- 生成HTML报告并打开。
- 洞察:“桌面端是您的主要转化引擎。移动端带来流量(占访问量的39%)但转化率仅为1.2%,而桌面端为3.1%——差异幅度达61%。优先优化移动端结账流程以获得最大转化提升空间。”