# A/B testing

Also called: A/B test, split testing, split test, bucket testing

A/B testing is an experiment that shows two versions of a page, email or feature to randomly split groups of visitors and compares how each group converts. Because the split is random, a difference that passes a significance test can be put down to the change rather than to who happened to visit.

## How it is calculated

Choose one metric that decides the test, usually a conversion rate, and work out the sample size you need before you start. A testing tool then assigns each visitor to version A or B, keeps them there on later visits, and counts visitors and conversions per version.

At the planned sample size, compare the two rates with a significance test such as a two-proportion z-test. Report the relative lift and its confidence interval, not only the winner.

```
relative lift = (rate B − rate A) ÷ rate A
```

## Example

A shop tests a shorter checkout. Version A gets 10,000 visitors and 300 orders (3.0%); version B gets 10,000 visitors and 360 orders (3.6%). The relative lift is (3.6% − 3.0%) ÷ 3.0% = 20%, and a two-proportion z-test gives p = 0.0175, below the 0.05 the team set in advance, so B ships.

## Common mistakes

- Stopping the moment the result looks significant. Checking every day and stopping on the first good reading raises the false positive rate well above the alpha you chose.
- Testing with too little traffic. Small changes on low-converting pages need tens of thousands of visitors per version to detect.
- Changing several things at once and crediting one of them. A test tells you that version B won, not which of its five changes did the work.
- Picking the deciding metric after the results are in. With enough metrics, one of them will look significant by chance.

## How CrispStats shows it

CrispStats does not run A/B tests: it does not split traffic, assign variants or pick winners, so use a dedicated testing tool for that. It can count the outcome on your own data. For a page test, send a [custom event](/glossary/custom-event) when a visitor sees the variant and another when they convert, each with the variant as a property: the events report lists unique visitors per property value. For ad or email variants, tag each version's link with `utm_content` and filter [goals](/glossary/goal) and [funnels](/features/funnels) by it. Then check the difference with the significance calculator.

## Related terms

- [Statistical significance](/glossary/statistical-significance)
- [Conversion rate](/glossary/conversion-rate)
- [Goal](/glossary/goal)
- [Custom event](/glossary/custom-event)
- [Call to action (CTA)](/glossary/call-to-action)
- [Micro-conversion](/glossary/micro-conversion)
