The business question

A B2B software company tested a simplified pricing page (three tiers, no feature matrix) against the control page. The numbers on this page are made-up (synthetic) numbers built to teach one point. They are not results from a real company. The outcome that matters is started_trial: a visitor who lands on pricing and opens a demo account.

Have results from your own experiment? Upload them to the free A/B test tool and see whether any variant beat the control, and by how much.

The test ran four weeks. Weeks 1 to 2 split traffic evenly. From week 3 the team ramped the simplified page to about 70% of traffic: a normal progressive rollout, and the reason the two arms did not end with equal exposure.

The weekly growth review looked at one number: trials started per variant. That number says the simplified page won. This worked example is about why that number is the wrong one, and what the right one does to the answer.

The data

One row per pricing-page visitor: who, when, which page they saw, and whether they opened a trial. This is the shape the platform’s A/B tool consumes directly: row level, not pre-aggregated, because only row-level data can be split by week or by any other column after the fact. (Visitor and trial counts per page would carry the denominator; a table of trials alone would not.)

The dataset is SYNTHETIC (made up): per-week exposure and trial counts are fixed, then row order is shuffled with a fixed seed. Re-knitting reproduces abtest_visitors.csv byte-for-byte. Because we wrote the counts ourselves, the page can show how the method behaves, but it cannot tell you how a real pricing page would do.

set.seed(20260824)

weeks           <- sprintf("2026-W%02d", 23:26)
week_start      <- as.Date(c("2026-06-01", "2026-06-08", "2026-06-15", "2026-06-22"))

# progressive rollout: 50/50 for two weeks, then 30/70 toward the simplified page
control_visitors   <- c(275, 275, 180, 170)   # 900
simplified_visitors<- c(275, 275, 420, 430)   # 1400
control_trials     <- c( 39,  38,  25,  24)   # 126
simplified_trials  <- c( 28,  27,  42,  43)   # 140

rows <- do.call(rbind, lapply(seq_along(weeks), function(i) {
  mk <- function(variant, n_vis, n_trial) {
    data.frame(
      visit_date    = week_start[i] + rep(0:6, length.out = n_vis),
      variant       = variant,
      started_trial = c(rep(1L, n_trial), rep(0L, n_vis - n_trial)),
      stringsAsFactors = FALSE
    )
  }
  rbind(mk("control", control_visitors[i], control_trials[i]),
        mk("simplified", simplified_visitors[i], simplified_trials[i]))
}))

rows <- rows[sample(nrow(rows)), ]
rows$visitor_id <- sprintf("v_%05d", seq_len(nrow(rows)))
rows <- rows[, c("visitor_id", "visit_date", "variant", "started_trial")]
rownames(rows) <- NULL
write.csv(rows, "abtest_visitors.csv", row.names = FALSE)

nrow(rows)
## [1] 2300
head(rows, 6)
visitor_id visit_date variant started_trial
v_00001 2026-06-12 control 0
v_00002 2026-06-26 simplified 0
v_00003 2026-06-14 control 0
v_00004 2026-06-01 control 0
v_00005 2026-06-16 control 0
v_00006 2026-06-26 control 0

The weekly report the team was reading

weekly <- data.frame(
  week               = weeks,
  control_visitors   = control_visitors,
  control_trials     = control_trials,
  control_rate       = sprintf("%.1f%%", 100 * control_trials / control_visitors),
  simplified_visitors= simplified_visitors,
  simplified_trials  = simplified_trials,
  simplified_rate    = sprintf("%.1f%%", 100 * simplified_trials / simplified_visitors),
  traffic_split      = c("50 / 50", "50 / 50", "30 / 70", "28 / 72")
)
knitr::kable(weekly, align = "lrrrrrrr",
             col.names = c("week", "visitors", "trials", "rate",
                           "visitors", "trials", "rate", "split (C/S)"),
             caption = "Weekly pricing-page test. Left block: control. Right block: simplified.")
Weekly pricing-page test. Left block: control. Right block: simplified.
week visitors trials rate visitors trials rate split (C/S)
2026-W23 275 39 14.2% 275 28 10.2% 50 / 50
2026-W24 275 38 13.8% 275 27 9.8% 50 / 50
2026-W25 180 25 13.9% 420 42 10.0% 30 / 70
2026-W26 170 24 14.1% 430 43 10.0% 28 / 72

Read the trials columns down the page and the simplified page pulls ahead the moment the ramp starts. Read the rate columns and it never leads in a single week.

Two views of the same test

tab <- table(rows$variant, rows$started_trial)[c("control", "simplified"), c("1", "0")]
trials   <- tab[, "1"]
visitors <- rowSums(tab)
rate     <- trials / visitors

views <- data.frame(
  variant          = names(trials),
  trials_started   = as.integer(trials),
  visitors         = as.integer(visitors),
  conversion       = sprintf("%.2f%%", 100 * rate),
  row.names        = NULL
)
knitr::kable(views, align = "lrrr",
             col.names = c("variant", "trials started", "visitors", "conversion"),
             caption = "The count view and the rate view disagree about who won.")
The count view and the rate view disagree about who won.
variant trials started visitors conversion
control 126 900 14.00%
simplified 140 1400 10.00%

Count view: simplified 140 vs control 126: the simplified page is ahead by 14 trials.

Rate view: control 14.0% vs simplified 10.0%: the control page converts better.

Both numbers are correctly computed from the same rows. They answer different questions. The count answers “which page produced more trials?”, which is a question about traffic allocation. The rate answers “which page persuades better?”, which is what a test is for.

The test

pt <- prop.test(trials, visitors)   # two-sided, Yates continuity correction (R default)
pt
## 
##  2-sample test for equality of proportions with continuity correction
## 
## data:  trials out of visitors
## X-squared = 8.1835, df = 1, p-value = 0.004227
## alternative hypothesis: two.sided
## 95 percent confidence interval:
##  0.01150374 0.06849626
## sample estimates:
## prop 1 prop 2 
##   0.14   0.10
diff_pp <- unname(rate["control"] - rate["simplified"]) * 100
ci_pp   <- pt$conf.int * 100
uplift  <- unname(rate["control"] / rate["simplified"])
round(c(diff_pp = diff_pp, ci_lo = ci_pp[1], ci_hi = ci_pp[2], uplift = uplift), 4)
## diff_pp   ci_lo   ci_hi  uplift 
##  4.0000  1.1504  6.8496  1.4000
chisq.test(tab)      # same machinery as prop.test on a 2x2
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  tab
## X-squared = 8.1835, df = 1, p-value = 0.004227
fisher.test(tab)     # exact sensitivity check
## 
##  Fisher's Exact Test for Count Data
## 
## data:  tab
## p-value = 0.004021
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  1.123106 1.909274
## sample estimates:
## odds ratio 
##   1.464819

The control page converts 4.0 percentage points better, 95% CI 1.15 to 6.85 pp, p = 0.0042. Relative, that is 1.40× the trial rate. The page the count view crowned is the page with the lower trial rate.

Charts

ci_each <- t(sapply(names(trials), function(v)
  prop.test(trials[[v]], visitors[[v]])$conf.int * 100))
par(mar = c(4, 4.5, 3, 1))
bp <- barplot(rate * 100, ylim = c(0, 20), col = c("#F97316", "#5fa9dd"),
              ylab = "trial start rate (%)", border = NA,
              names.arg = c("control", "simplified"),
              main = "Conversion with 95% confidence intervals")
arrows(bp, ci_each[, 1], bp, ci_each[, 2], angle = 90, code = 3, length = 0.08, lwd = 2)
text(bp, ci_each[, 2] + 1.4, sprintf("%.1f%%", rate * 100), font = 2)

Bar chart of trial start rate with 95% confidence intervals: control about 14 percent, simplified about 10 percent.

par(mar = c(4, 4.5, 3, 1))
m <- rbind(control = control_visitors, simplified = simplified_visitors)
barplot(m, beside = FALSE, col = c("#F97316", "#5fa9dd"), border = NA,
        names.arg = weeks, ylab = "pricing-page visitors",
        main = "Exposure was never equal: the rollout ramp")
legend("topleft", c("control", "simplified"), fill = c("#F97316", "#5fa9dd"),
       bty = "n", border = NA)

Stacked bars of weekly pricing-page visitors by page: equal in weeks 1 and 2, then the simplified page gets more than twice the control visitors in weeks 3 and 4.

The second chart is the whole problem in one picture: in weeks 3 and 4 the simplified page is served to more than twice as many visitors as the control, so it collects more trials while converting worse.

The counter-check: does the ramp explain it?

If the rate gap were an artifact of when traffic was served rather than which page, it would appear in the ramp weeks only. It does not.

byweek <- data.frame(
  week            = weeks,
  control_rate    = 100 * control_trials / control_visitors,
  simplified_rate = 100 * simplified_trials / simplified_visitors
)
byweek$gap_pp <- byweek$control_rate - byweek$simplified_rate
knitr::kable(byweek, digits = 2, align = "lrrr",
             col.names = c("week", "control %", "simplified %", "gap (pp)"),
             caption = "The control page leads in every week, ramp or no ramp.")
The control page leads in every week, ramp or no ramp.
week control % simplified % gap (pp)
2026-W23 14.18 10.18 4.00
2026-W24 13.82 9.82 4.00
2026-W25 13.89 10.00 3.89
2026-W26 14.12 10.00 4.12

A pooled comparison is only fair if each page saw a similar mix of weeks, and the ramp means it did not: the simplified page got more of its visitors late. The direct check is a stratified one, comparing the pages within each week and combining the four comparisons (a Mantel-Haenszel test).

d <- read.csv("abtest_visitors.csv")
d$wk <- as.integer(floor(as.numeric(as.Date(d$visit_date) - min(as.Date(d$visit_date))) / 7)) + 1
tab3 <- table(d$variant, factor(d$started_trial, levels = 1:0), d$wk)
mh <- mantelhaen.test(tab3, correct = TRUE)   # same continuity correction as the pooled prop.test above
wk_gap <- sapply(1:4, function(w) { x <- d[d$wk == w, ]
  c(gap = mean(x$started_trial[x$variant == "control"]) - mean(x$started_trial[x$variant == "simplified"]),
    n_c = sum(x$variant == "control"), n_s = sum(x$variant == "simplified")) })
wts <- wk_gap["n_c", ] * wk_gap["n_s", ] / (wk_gap["n_c", ] + wk_gap["n_s", ])
strat_gap_pp <- 100 * sum(wts * wk_gap["gap", ]) / sum(wts)
c(stratified_gap_pp = strat_gap_pp, mh_p = mh$p.value)
## stratified_gap_pp              mh_p 
##        4.00063755        0.00534197

Within weeks the control page still leads by 4.0 points (Mantel-Haenszel p = 0.0053, against the pooled p = 0.0042, both with continuity correction), the same gap as the pooled one. The weeks were close enough in baseline conversion that pooling them did no harm here. That is a property of this dataset, not a guarantee, which is why the stratified check is worth running whenever the split changes.

The chooser the lesson teaches

  1. Which denominator, before which test. Trials-started counts answer a question about traffic allocation. Conversion answers the question the test was run to settle. When exposure is unequal (a ramp, a staged rollout, an arm paused for a day) the count view stops being a weaker version of the rate view and becomes a different and wrong answer. Here it names the page with the lower rate as the winner.
  2. The test picks itself once the data is honest. Two-proportion z and chi-square are the same machinery on a 2×2, and Fisher’s exact agrees at these counts. The chooser was never which test; it was which denominator, and that is a data-shape decision.
  3. Unequal exposure is not bias, but it is not nothing. If visitors were assigned at random (we built this data that way, a real test has to confirm it), each visitor’s page was chosen by chance, just with unequal odds after the ramp. When the split changes over time, though, pooling the weeks is only fair if the weeks themselves were alike, because each page then gets a different mix of weeks. Check by comparing within each week and combining (above): here the answer barely moves. What unequal exposure destroys is the count comparison, and the count is what most dashboards show.
  4. Two-sided by default. One-sided is honest only when the direction was fixed before the data existed.

What this does not tell you

  • The data is synthetic, so the gap is a teaching number, not evidence about any real page.
  • A small p-value says the gap would be unusual if the two pages truly converted the same. It does not say how big or how useful the gap is, and it does not say the finding will repeat (Wasserstein and Lazar, 2016).
  • The checks here assume visitors were assigned to a page by chance. They cannot repair a test where assignment was not random, a visitor was counted twice, or the pages differed in some other way.
  • Four weeks of visitors say nothing about later seasons, other audiences or longer-term results such as trials that turn into paying customers.
  • The weekly check only handles the one thing we stratified on (the week).

Try it on your own data: export one row per visitor with the page they saw and whether they converted, then run the A/B tool linked at the top.

Sources

No cleared source on file covers the Mantel-Haenszel test or the continuity correction used here, so those two are not cited; R’s documentation describes them.

Your turn

Bring your own data and the question you actually need answered.

MCP AnalyticsData science by email Send us your data and your question, and we will reply. ds@mcpanalytics.ai