From 8c25333f6436ff9488ef3fcbc8e8bb3e533bc3e2 Mon Sep 17 00:00:00 2001 From: guitavano Date: Wed, 8 Jul 2026 00:24:13 -0300 Subject: [PATCH] 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 --- web/tools/experiments/index.tsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/web/tools/experiments/index.tsx b/web/tools/experiments/index.tsx index 7b559ff..d2c8376 100644 --- a/web/tools/experiments/index.tsx +++ b/web/tools/experiments/index.tsx @@ -386,9 +386,8 @@ function ResultsView({ callTool, ]); - // Tables (Funnel / By Goal) show every goal including the visitors baseline, - // matching the admin. The bar chart drops visitors (its conversion would - // always be 100% and would flatten the other goals). + // Every goal, visitors baseline included — used by the tables and the chart, + // matching the admin. const sortedGoals = useMemo( () => (data ? sortByTotal(data.goals) : []), [data], @@ -418,13 +417,11 @@ function ResultsView({ "Test Variant 1": point.variant, })) ?? []; - const barData = sortedGoals - .filter((g) => g.goal !== "visitors") - .map((g) => ({ - goal: g.goal, - Default: percentage(g.default, visitors.default), - "Test Variant 1": percentage(g.variant, visitors.variant), - })); + const barData = sortedGoals.map((g) => ({ + goal: g.goal, + Default: percentage(g.default, visitors.default), + "Test Variant 1": percentage(g.variant, visitors.variant), + })); return (