A/B tests · GuideA/B testing: how to run a test
An A/B test, also called a split test, is an experiment that splits traffic into groups and compares versions of a page. Here are 7 steps, a hypothesis template, 12 common mistakes and a glossary of 25 terms — with calculators built in.
Your numbers stay in the browser and are never sent anywhere
What an A/B test is
A/B test
Traffic is split at random into two groups: A sees the current version, B the changed one. One metric is compared.
Example: A green “Buy” button against a red one.
A/B/n test
Several variants against one control. Needs a multiple-comparisons correction and more traffic.
Example: Three landing headlines against the current one.
A/A test
Two identical versions. Tests the system: the split, the metrics and the false-win rate — it should be about 5%.
Example: Before the first test on a new platform.
Multivariate test
Several elements change at once and every combination is tested. Shows interactions but needs a lot of traffic.
Example: 2 headlines × 2 images × 2 buttons = 8 variants.
A test in 7 steps
Hypothesis
One sentence: what changes, which metric moves and why. A hypothesis without a “because” is a lottery, not a test.
If we add reviews to the product card, then purchase conversion grows by 10%, because shoppers hesitate less.
Metric
One primary metric decides. Secondary metrics explain why it moved. Guardrails — speed, bounces, complaints — must not drop even if the primary one grows.
MDE and sample size
What is the smallest gain worth shipping? The smaller it is, the more visitors you need: half the effect takes four times the traffic.
Sample sizeα = 0.05 · power 80% · two-sidedPer group36,693Duration
Sample ÷ traffic, rounded up to whole weeks and at least one week. Set the end date before the start.
Launch and SRM
On day one, check that traffic splits as planned. A mismatch signals a technical fault, and then the results cannot be trusted.
Analysis
Only after the planned end date. Look at the uplift interval, not just the p-value, and go through the “Can you trust the test?” checklist.
SignificanceDecision and report
Ship, reject or rerun with another hypothesis. Write down the hypothesis, data, conclusion and caveats — in six months it will save an argument.
Experiment report
12 common mistakes
01Peeking
20 checks instead of one raise false wins from 5% to about 24%.
02Stopping at the first significance
“Significant on day 5” — by the end the uplift was gone. Noise got shipped.
Significance03A partial week
Monday to Thursday: weekdays give +8%, weekends −3%, the result is biased.
04Traffic mismatch
50,800 / 49,200 with a 50/50 plan — p = 4·10⁻⁷. The result cannot be trusted.
05Many metrics, no correction
With 20 metrics at least one is “significant” in 64% of tests even with no effect.
06A small test for a small effect
+6% on a 2% conversion needs 220,000 per group. With 80,000 the result is a coin toss.
Sample size08Seasons and sales
A test during a sale: a different audience and motivation, the conclusion does not carry over to normal days.
09Different audiences in the groups
B was shown only on mobile — you compared devices, not page versions.
10Changing the test midway
B's layout was fixed on day 10 — one test now holds two hypotheses.
11Revenue means with outliers
One 500,000 order decides the test. You need winsorizing or a bootstrap.
12“Significant but useless”
+0.3% on a million visitors is significant but does not pay for the work. Look at the effect size.
Glossary
25 terms- A/B/n test
- Several variants against one control. Needs a multiple-comparisons correction.
- Multivariate test (MVT)
- Several elements change at once and every combination is compared. Needs a lot of traffic.
- Null hypothesis
- The assumption that the versions do not differ. The test looks for data that fit it poorly.
- Significance level α
- The accepted share of false wins, usually 5%. The threshold the p-value is compared with.
- Type I error
- A false win: the test found an effect that is not there. Its rate is set by α.
- Type II error
- A miss: the effect is real but the test did not see it. Its rate is 1 − power.
- Standard error
- How much an estimate wobbles from sample to sample. Shrinks as 1/√n.
- z statistic
- The difference measured in standard errors. Above 1.96 in absolute value is significant at α = 0.05.
- Novelty effect
- A short-lived spike of interest in something new. First-week uplift often fades.
- Practical significance
- Whether the effect is big enough to pay for the change. Statistical significance does not promise that.
- Bootstrap
- Resampling your own data with replacement. Gives an interval without assuming normality.
- Delta method
- A way to get the variance of a ratio metric, such as revenue per order, at the user level.
- Bayesian test
- Answers how likely B is to beat A and how much you could lose by choosing it.
- A/A test
- A test of two identical versions. Checks that the split and the metrics are honest: about 5% of such tests should come out “significant”.
- MDE
- The smallest effect the test will reliably detect at the chosen power. Smaller effects will be missed.
- p-value
- If the versions did not differ, a difference this large or larger would show up in p·100% of cases. It is not the probability that B is better.
- Power
- The probability of detecting an effect that is really there. Usually 80%: one real effect in five is missed.
- Confidence interval
- The range where the true effect most likely lies. If it includes zero, the difference is not proven.
- SRM
- Sample ratio mismatch: the groups did not get the planned shares. A sign of a technical fault — the results cannot be trusted.
- Control
- The current version the variants are compared with. Labelled A.
- Uplift
- The relative change of the variant against control: (p_B − p_A) / p_A.
- Peeking
- Checking the result every day and stopping at the first significance. False wins rise to 20–30% instead of 5%.
- CUPED
- Adjusting the metric for each user's behaviour before the test. Cuts noise and the sample you need.
- FDR
- The share of false discoveries among all “significant” results. The Benjamini–Hochberg correction keeps it in check.
- Guardrail metric
- A metric that must not drop — speed, bounces, complaints — even when the main metric grows.
What to run a test with
Varioqub
Yandex's experiment platform: traffic split, flags and reports on Metrica metrics.
Google Optimize
Shut down in September 2023. Mentioned for history: many old guides still point to it.
Your own setup
Flags in code and a deterministic split by user ID — for instance by a hash of the ID. Compute the metrics here — the data never leaves the browser.
Frequently asked questions
Updated