How to read an A/B test without fooling yourself
Most A/B tests mislead people in the same few ways. They are stopped as soon as the result looks good, judged on whichever metric moved, or read from a p-value without looking at how uncertain the effect is. Each habit makes a random difference look like a win.
The protection is to decide the rules before the test starts and follow them when it ends. Write down one primary metric, the sample size, the end date and the checks the data must pass. Then read the result against that plan.
What to decide before the test starts
Decide the primary metric, the smallest effect worth detecting and the sample size needed to detect it. These three choices stop you from adjusting the rules after you see the data.
The primary metric is the one number that decides the test. For a checkout change it is usually conversion rate or revenue per visitor. Other metrics can be watched, but they do not decide the outcome.
The sample size comes from a power calculation. Statistical power is the chance that a test detects an effect of a given size if that effect is real. A common choice is 80% power at a 5% significance level. Small effects on low conversion rates need large samples. For an illustrative shop converting at 2%, detecting a relative lift of 10% (from 2.0% to 2.2%) needs roughly 80,000 visitors in each variant.
Run the test for whole weeks. Shoppers behave differently on weekdays and weekends, and a test that covers only part of a week can be skewed by that alone.
Why stopping early gives false wins
Checking results every day and stopping the first time the p-value drops below 0.05 makes a false win far more likely than 5%. The p-value moves up and down as data arrives, and with enough looks it will cross the line by chance at some point.
A p-value answers a narrow question. If the change had no effect, how often would you see a difference at least this large? It does not say how likely the variant is to be better, or how much better.
If you need to look during the test, use a method designed for it. Sequential testing methods adjust the threshold for repeated looks. Many testing tools offer one, and the documentation should say which method it uses.
A worked example: a result that looks like a win
Take an illustrative test on a checkout page, with 20,000 visitors in each variant.
| Variant | Visitors | Orders | Conversion rate |
|---|---|---|---|
| Control | 20,000 | 400 | 2.0% |
| New checkout | 20,000 | 440 | 2.2% |
The new checkout shows a 10% relative lift, and a dashboard might colour it green. A standard two-proportion test gives a p-value of about 0.16, which does not meet a 0.05 threshold.
The 95% confidence interval for the difference runs from about minus 0.08 to plus 0.48 percentage points. In relative terms, the true effect could be anywhere from a 4% loss to a 24% gain. The data fits a real improvement, no effect and a small loss.
This test was also too small. The power calculation above asked for about 80,000 visitors per variant, and it ran with a quarter of that. The honest reading is "inconclusive", and the decision to ship depends on cost and risk, since the data does not settle it.
Checks to run before you trust any result
Run these checks before reading the primary metric.
- Check the traffic split. If you planned 50/50 and got 20,000 against 19,400, a chi-squared test shows that gap is very unlikely by chance. That is a sample ratio mismatch, and it usually means a bug in assignment, redirects or tracking.
- Check that both variants record orders the same way. Compare test orders with orders in your shop platform for the same period.
- Check for outliers in revenue. A few very large orders can swing revenue per visitor, so look at the result with and without them, or cap order values at a set level decided in advance.
- Count the comparisons. Every extra metric and segment you test is another chance of a false positive. This is the multiple comparisons problem. A win in one segment, such as mobile visitors from one country, is a hypothesis for the next test.
Look at the effect over time as well. A new design sometimes gets a short lift because returning visitors notice something different, known as a novelty effect. If the gap shrinks week by week, wait before calling it.
Our loops run tests this way: one experiment, one primary metric (conversion or revenue per visitor), a sample size set in advance and these checks before any result is reported.
Questions
- How long should an A/B test run?
- An A/B test should run until it reaches the sample size you calculated before starting, and for whole weeks, so that weekday and weekend behaviour are both included. Stopping early because the result looks good raises the chance of a false win.
- What does a p-value of 0.05 mean in an A/B test?
- It means that if the change had no real effect, a difference at least as large as the one you saw would appear about 5% of the time by chance. It does not tell you the probability that the variant is better, or how large the effect is.
- What is a sample ratio mismatch?
- A sample ratio mismatch happens when the traffic split between variants differs from the planned split by more than chance allows. It usually points to a bug in assignment or tracking, and results from such a test should not be trusted until the cause is found.