Skip to content

Commit 8c25333

Browse files
guitavanoclaude
andcommitted
Include visitors in A/B goals chart
The goal bar chart excluded the visitors baseline; include it so the chart matches the funnel tables and the admin screen. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 6534e3d commit 8c25333

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

web/tools/experiments/index.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,8 @@ function ResultsView({
386386
callTool,
387387
]);
388388

389-
// Tables (Funnel / By Goal) show every goal including the visitors baseline,
390-
// matching the admin. The bar chart drops visitors (its conversion would
391-
// always be 100% and would flatten the other goals).
389+
// Every goal, visitors baseline included — used by the tables and the chart,
390+
// matching the admin.
392391
const sortedGoals = useMemo(
393392
() => (data ? sortByTotal(data.goals) : []),
394393
[data],
@@ -418,13 +417,11 @@ function ResultsView({
418417
"Test Variant 1": point.variant,
419418
})) ?? [];
420419

421-
const barData = sortedGoals
422-
.filter((g) => g.goal !== "visitors")
423-
.map((g) => ({
424-
goal: g.goal,
425-
Default: percentage(g.default, visitors.default),
426-
"Test Variant 1": percentage(g.variant, visitors.variant),
427-
}));
420+
const barData = sortedGoals.map((g) => ({
421+
goal: g.goal,
422+
Default: percentage(g.default, visitors.default),
423+
"Test Variant 1": percentage(g.variant, visitors.variant),
424+
}));
428425

429426
return (
430427
<div className="flex flex-col gap-6">

0 commit comments

Comments
 (0)