cja-segment-performance-comparator
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "cja-segment-performance-comparator" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-cf3c3a990744e6bc79f5f802049dae4dd84bb9bf90cbe946096eabf33696f258. Verify the upstream source and version against https://github.com/adobe/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Compare key metrics of two or more audience segments side by side. Intended for use when comparing audiences, groups, or cohorts—for example comparing mobile vs. desktop users, new vs. returning visitors, or determining which group performs better by key KPIs.
Introduction source: third_party · adobe · 1.0 Reference
SkillPi interpretation
- Tasks
- Compare 2–5 audience segments across a set of key metrics in a side-by-side matrix. The output tells the user not just what each segment looks like in isolation, but which segment wins or loses on each metric — and which differences are large enough to act on.
- Software, accounts and paid services
- 1. Call `findDataViews` to list available data views. 2. If the user hasn't specified a data view, present the list and ask which to use. 3. Call `setDefaultSessionDataViewId` with the chosen ID. 4. Ask the user which segments to compare if not already specified. Confirm the metrics to compare them on.
- Testing
- Not tested
Browse files
Frontmatter
name: cja-segment-performance-comparator
description: >
Compares the performance of two or more audience segments across key metrics
side by side. Use this skill when someone wants to compare audiences, cohorts,
or groups — for example, "how do mobile users compare to desktop users on
conversion," "compare new vs. returning visitors," "show me the difference
between these two segments," "compare these audiences on our KPIs," or
"which segment performs better." Also trigger for "segment comparison,"
"audience comparison," or "cohort comparison."
license: Apache-2.0
metadata:
author: Adobe
version: "1.0"Segment Performance Comparator (Customer Journey Analytics)
Compare 2–5 audience segments across a set of key metrics in a side-by-side matrix. The output tells the user not just what each segment looks like in isolation, but which segment wins or loses on each metric — and which differences are large enough to act on.
This skill answers the question "which audience should we focus on?" with data. Segment comparisons drive product decisions, personalization strategy, and budget allocation — so clarity and actionability matter more than exhaustive data.
CJA MCP Tools Used
findSegments— search for segments by name or keyworddescribeSegment— understand the logic of candidate segments before using themfindMetrics— resolve base metric IDsfindCalculatedMetrics— include custom KPIs in the comparisonlistComponentUsage— identify the most-used metrics as default comparison setrunReport(withsegmentIdsoradhocSegments) — pull metric values per segment
Phase 0 — Setup
- Call
findDataViewsto list available data views. - If the user hasn't specified a data view, present the list and ask which to use.
- Call
setDefaultSessionDataViewIdwith the chosen ID. - Ask the user which segments to compare if not already specified. Confirm the metrics to compare them on.
Phase 1 — Identify Segments to Compare
1.1 From user description
If the user named specific segments, resolve them:
findSegments(search: "<segment name>")
For each match, call describeSegment to verify it is the correct one:
describeSegment(segmentId: "<id>")
Show the segment definition summary to the user if there is ambiguity:
"I found two segments matching 'mobile users': Mobile Visitors (All Devices) and Mobile App Users. Which do you want to compare?"
1.2 From plain-English descriptions
If the user says "compare mobile vs desktop users" but there are no matching segments, offer to create ad hoc segments inline for the comparison:
"I don't see pre-built segments for mobile and desktop. I can create temporary ad hoc segments for this comparison using device type. Should I proceed with ad hoc segments, or would you like to create permanent segments first?"
Ad hoc segments are constructed using adhocSegments in runReport — no
save required for the comparison itself.
1.3 Segment count limit
Maximum 5 segments for a single comparison. More than 5 creates a matrix that is too wide to read meaningfully. If the user requests more, say:
"I'll limit to the 5 most relevant segments for readability. Would you like me to prioritize by usage count or stick with your list order?"
Phase 2 — Identify Metrics to Compare
2.1 From user specification
Resolve named metrics via findMetrics and findCalculatedMetrics.
2.2 Default metric discovery
If the user did not specify metrics, pull the top metrics by usage. The
listComponentUsage tool does not support a limit parameter — it returns all
components ranked by usage count; take the top 6–8 from the result:
listComponentUsage(componentType: "metric")
listComponentUsage(componentType: "calculatedMetric")
Prefer calculated metrics over raw base metrics when they measure the same thing — calculated metrics reflect intentional KPI definitions.
2.3 Metric selection for a comparison
Good comparison metrics should be meaningful across all segments. For example, "Revenue" is meaningful for both mobile and desktop users; "App Installs" is only meaningful for mobile. Remove metrics that would be trivially zero for one segment.
If unsure, ask: "Should I use your standard KPI set, or focus on specific metrics like conversion rate, revenue, and engagement?"
Phase 3 — Run the Comparison
For each segment, run a runReport with that segment applied and all
comparison metrics included. Note that runReport takes metricIds as a
comma-separated string, startDate/endDate (not dateRange), and a
dimensionIds (required even for summary-only reports — use a low-cardinality
dimension like variables/daterangeday or variables/web.webPageDetails.name).
The summary totals for all metrics are in summaryData.filteredTotals:
runReport(
dimensionIds: "variables/web.webPageDetails.name",
metricIds: "metrics/visits,metrics/revenue_1,metrics/orders_1_1",
startDate: "<period start>T00:00:00",
endDate: "<period end>T23:59:59",
page: 0,
limit: 1,
segmentIds: "<segment id>"
)
For ad hoc segments, use the full CJA segment definition object:
runReport(
dimensionIds: "variables/web.webPageDetails.name",
metricIds: "metrics/visits,metrics/orders_1_1",
startDate: "<period start>T00:00:00",
endDate: "<period end>T23:59:59",
page: 0,
limit: 1,
adhocSegments: [{
"func": "segment",
"version": [1, 0, 0],
"container": {
"func": "container",
"context": "visitors",
"pred": {
"func": "streq",
"val": { "func": "attr", "name": "variables/device_type" },
"str": "Mobile Phone"
}
}
}]
)
Read metric totals from summaryData.filteredTotals[i] where i is the
0-based index of the metric in the metricIds string.
Run one report per segment. Collect all results into a matrix:
- Rows = metrics
- Columns = segments
Phase 4 — Build the Comparison Matrix
For each cell (metric × segment):
value[metric][segment]= raw metric value fromrunReport
For each metric row:
winner= segment with the highest value (or lowest, for "lower is better" metrics)loser= segment with the lowest value (or highest, for inverse metrics)range= (max − min) / max × 100 — the spread across segments as a percentagesignificant= true if range > 10% (a meaningful difference worth acting on)
Phase 5 — Generate HTML Comparison Report
Generate the report inline and write to
/tmp/cja_segment_performance_comparator_report_<YYYY-MM-DD_HHMMSS>.html.
HTML Template
Read template.html and use it verbatim. Do not improvise the
HTML structure or CSS — only fill in the {PLACEHOLDER} tokens ({ORG_NAME},
{DATE_RANGE}, {DATA_VIEW}, {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}) and repeat segment chips,
matrix rows, and insight boxes once per data item. Use the cell-winner /
cell-loser classes per Phase 4 winner/loser rules.
Phase 6 — Narrative Insights
After building the matrix, generate 3–5 insight bullets for the Insights section:
- Overall Winner: "Returning Visitors outperform New Visitors on 5 of 7 metrics, with the largest gap in Revenue per Session (+82%)."
- Most Significant Difference: "The biggest gap is Conversion Rate: Mobile converts at 1.2% vs Desktop at 3.8% — a 68% gap worth prioritizing."
- Surprising Parity: "New vs Returning Visitors show nearly identical Bounce Rates (42% vs 44%), suggesting landing page quality is consistent."
- Actionable Signal: "Paid Search visitors have 2.3× higher Revenue per Session than Direct visitors — consider shifting budget toward Paid Search."
- Anomaly: "One segment shows near-zero values across all metrics — verify that the segment definition is correct and matches the current data view."
Insights should be plain English, not metric IDs. Name the specific segments and metric values.
Workflow Summary
- Resolve 2–5 segments (by name or ad hoc definition).
- Identify 5–8 comparison metrics (from user or top usage).
- Run one
runReportper segment with all metrics; collect results. - Build comparison matrix: rows = metrics, columns = segments.
- Mark winner/loser per row; compute spread; flag significant differences.
- Generate HTML report with matrix and insight bullets.
- Write to
/tmp/cja_segment_performance_comparator_report_<YYYY-MM-DD_HHMMSS>.html. - Open with
open /tmp/cja_segment_performance_comparator_report_<YYYY-MM-DD_HHMMSS>.html. - Deliver inline summary: which segment wins overall, biggest gap metric, one actionable recommendation.
Important Guardrails
- Read-only analysis. Never delete or modify segments or calculated metrics.
- Always confirm segments before running. Ambiguous segment names (e.g., "Mobile" could be several) should be resolved by showing the user the matched segment IDs and definitions.
- Use the same date range for all segments. Comparisons across different time windows are misleading.
- Note overlap between segments. If two segments share substantial audience overlap, note it — the "difference" may be exaggerated.
- Cap the number of segments compared. Comparing more than 5–6 segments in a single report makes the output unreadable; ask the user to prioritize.
- Distinguish statistical significance from practical significance. A 0.1% difference is rarely actionable — focus on differences of 5%+ unless the user specifies otherwise.
Example Interaction
"Compare our mobile vs. desktop segment performance for last quarter."
- Setup: Confirm data view. Call
findDataViews, user selects. CallsetDefaultSessionDataViewId. - Segment resolution: Call
findSegmentsto locate the "Mobile Users" and "Desktop Users" segments. Show matched names and IDs to confirm. User approves. - Metrics: Ask "Which metrics should I compare?" User: "Sessions, Conversion Rate, Revenue, and Average Order Value."
- Analysis: Run
runReportfor Q1 2026 with both segments applied. Tabulate results side-by-side. - Findings: Mobile: 45% of sessions, 2.1% CVR, $0.84 RPV. Desktop: 55% of sessions, 4.8% CVR, $2.10 RPV. Desktop converts 2.3× better. Present a comparison table and 3 recommended next steps.
Version history
-
plugin/stardust/v0.43.4
GitHub ↗
Original release notes
## [0.43.4](https://github.com/adobe/skills/compare/plugin/stardust/v0.43.3...plugin/stardust/v0.43.4) (2026-11-21)
-
rollout-v1.3.1
GitHub ↗
Original release notes
## [1.3.1](https://github.com/adobe/skills/compare/rollout-v1.3.0...rollout-v1.3.1) (2026-11-21)
-
plugin/aem-edge-delivery-services/v1.3.5
GitHub ↗
Original release notes
## [1.3.5](https://github.com/adobe/skills/compare/plugin/aem-edge-delivery-services/v1.3.4...plugin/aem-edge-delivery-services/v1.3.5) (2026-11-20) ### Bug Fixes * **deps:** update dependency playwright to v1.65.1 ([#777](https://github.com/adobe/skills/issues/777)) ([c6c5233](https://github.com/adobe/skills/commit/c6c5233558a28bb8fde8ede408c35ac47c81cf8e)) * **deps:** update dependency pnpm to v12.21.0 ([#778](https://github.com/adobe/skills/issues/778)) ([a9e7de9](https://github.com/adobe/skills/commit/a9e7de976a969259a1d30ef8d24a4ef699d6d49e))
-
migrate-header-v1.0.4
GitHub ↗
Original release notes
## [1.0.4](https://github.com/adobe/skills/compare/migrate-header-v1.0.3...migrate-header-v1.0.4) (2026-11-20) ### Bug Fixes * **deps:** update dependency pnpm to v12.21.0 ([#778](https://github.com/adobe/skills/issues/778)) ([a9e7de9](https://github.com/adobe/skills/commit/a9e7de976a969259a1d30ef8d24a4ef699d6d49e))
-
personalize-v1.0.1
GitHub ↗
Original release notes
## [1.0.1](https://github.com/adobe/skills/compare/personalize-v1.0.0...personalize-v1.0.1) (2026-11-20) ### Bug Fixes * **deps:** update dependency playwright to v1.65.1 ([#777](https://github.com/adobe/skills/issues/777)) ([c6c5233](https://github.com/adobe/skills/commit/c6c5233558a28bb8fde8ede408c35ac47c81cf8e))
Only the five most recent versions are shown. View full version history at the source ↗
Current listing version
1.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供受众群体关键指标并排比较功能,解决实际业务决策需求
- 适用于产品决策、个性化策略和预算分配等多个业务场景
- 支持2-5个群体的灵活比较,满足不同规模分析需求
Highlights
- 触发词覆盖全面,包含多种变体表达
- 边界清晰,能够准确识别用户比较需求
- 提供具体示例帮助理解触发条件
Highlights
- 文档结构清晰,分阶段详细说明执行流程
- 包含完整的端到端示例和交互演示
- frontmatter完整,符合规范要求
Highlights
- 正确使用CJA MCP工具调用方式,参数格式准确
- 包含异常处理机制和用户确认流程
- 强调只读分析原则,确保数据安全
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
1. Call `findDataViews` to list available data views. 2. If the user hasn't specified a data view, present the list and ask which to use. 3. Call `setDefaultSessionDataViewId` with the chosen ID. 4. Ask the user which segments to compare if not already specified. Confirm the metrics to compare them on.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.