An A/B test is a controlled experiment in which two versions of a page, email or interface element are shown to different groups of users, to compare which one achieves a measurable goal better, such as sign-ups or purchases. The original version is called the control (A) and the alternative is the variant (B).

How it works

Visitors are randomly assigned to one of the two versions, and the system records their behaviour during the test period. Before launching, you define a hypothesis, a primary metric, the required sample size and a minimum duration. At the end, you analyse whether the observed difference is statistically significant, meaning it is unlikely to be due to chance.

Randomisation is essential: it ensures both groups are comparable, so differences in results can be attributed to the change and not to other factors such as traffic source or day of the week.

Practical example

An online store wants to check whether a more prominent buy button improves add-to-cart rate. The hypothesis is that a contrasting colour will make the action easier to notice. Traffic is split 50/50 between the current page (A) and the variant (B) for two full weeks, so that weekly purchasing cycles are covered. When the test closes, the team reviews the confidence interval and significance before deciding whether the result is reliable enough to implement.

How to apply it

  • Start from prior analysis (analytics data, heatmaps, surveys) to formulate a specific hypothesis.
  • Define one primary metric and a set of secondary metrics to monitor for side effects.
  • Calculate the sample size and duration before launching, and do not stop the test at the first favourable result.
  • Change one relevant variable per test, or use a multivariate test if you need to evaluate combinations.
  • Document all results, including negative ones, to feed future experiments.

Common mistakes

  • Stopping the test early when an early difference appears that may just be noise.
  • Testing changes without a hypothesis, which makes it hard to understand why they work or fail.
  • Using an insufficient sample, leaving the experiment without the power to detect real effects.
  • Running several overlapping tests on the same audience without control, which contaminates results.
  • Ignoring segmentation by device, since behaviour on mobile and desktop can differ.