Let's talk

Knowledge

A/B tests – how to start and avoid basic mistakes

Persooa Editorial · January 12, 2024 · 7 min read

Go deeper into how classic A/B tests work, learn the real meaning of statistical significance and discover the traps that threaten the results of your tests.

A/B tests are one of the broadest techniques for optimizing websites. They let you make smarter, data-based decisions. Proposed changes are not judged on intuition alone (or by someone with more advanced argumentation skills than you), but rather rest on desired outcomes that are visible immediately (such as CTR) or on long-term ones (such as becoming a paying customer). At the same time a test protects you from making a serious mistake that could drastically damage user engagement. Let us take a closer look at classic A/B tests, get to know the meaning of statistical significance and discover the traps waiting on the road to results. The final element will be presenting several alternatives for optimizing classic A/B tests.

an A/B test example
an A/B test example

Intuitively the procedure is simple: first you create a different option for your original page. Then you split the traffic on the site randomly between the two versions being tested (assigning visitors at random according to some probability). The final stage is collecting the data, choosing the better performing option and removing the one that fared decidedly worse. Sounds trivial? It is not at all.

ab tests - conversion
ab tests - conversion

01 How do you start the hypothesis testing process?

First you need to understand where a mistake can be made. There are two ways: firstly, it is possible to reject the null hypothesis wrongly. After a brief look at the data you may conclude that there is a difference between how the new and the original version of the page perform. In reality, however, no such difference exists, and the change observed is random. This kind of error is called a type I error or a false positive.

The second possible trap is looking too superficially at how each version performs (the new one and the current one), which means there is a risk of failing to notice a bigger difference between them and drawing the wrong conclusion that no difference exists. This kind of error is called a type II error or a false negative.

02 How can mistakes be avoided?

Put simply: establish the right sample size. To determine it, you first have to define several test parameters:

  • to avoid false positive errors, you should set a confidence level, also called statistical significance. This should be a small positive number, often defined as 0.05, which means there is a 5% risk of making a type I error. Put simply, there is a 5% chance of noticing a difference in how the two variants perform when in reality that difference does not exist (a 5% chance of making a mistake). This common constant is described as having "95% confidence".

  • many people running tests would stop at the first parameter in order to avoid false negative errors. It is worth defining two additional properties, though: the minimum difference in performance (if any) you want to detect, and the probability of observing that difference if it does exist. The second of these parameters is called statistical power and is often set at a default level of 80%.

Calculating sample size may seem exhausting, and the result often gives the impression of being too large; the standard approach requires careful monitoring of the process, otherwise it may turn out that you are doomed to fail. In reality, even if you follow the rules above, there is always a risk of observing an incorrect result. It is worth considering why.

03 Can you trust test results completely?

Although hypothesis testing looks promising, in reality it is often far from ideal. It rests on certain hidden assumptions that in practice are often not satisfied. The first of them is usually fairly safe – you assume that the samples (that is, the visitors seeing the variant being tested) are independent of each other, and that their behavior and the eventual outcome do not influence one another directly. This assumption is usually valid, unless you repeatedly show the same audience different events. The second assumption is that the samples are of identical size. Simplified, this means that the probability of conversion is the same for all the visitors to your site. That is of course not true. The conversion rate may depend on time, location, user preferences, the person recommending a product or category and many other factors. For example, if a marketing campaign is running during your tests, it may cause an increase in traffic from, say, Facebook. That in turn may lead to a drastic, sudden change in CTR, based on the fact that leads coming from that specific campaign have different characteristics than the whole group of users visiting the site. As a consequence, some of the more advanced optimization techniques depend on these differences. The last assumption is that the measures you take as your benchmark, e.g. CTR or conversion rate, have a normal distribution (a Gaussian distribution). This may sound like an obscure mathematical term, but all kinds of formulas for confidence level depend precisely on this assumption – the more varied it is, the more realistic it becomes at the same time. Generalizing, the larger the sample and the higher the conversion level, the stronger the hypothesis (this is described by a mathematical theory called the central limit theorem).

04 Which traps should you watch out for and which assumptions should you rely on when running A/B tests?

There are two kinds of risk. Firstly, A/B testing platforms often offer a real-time view of the results collected so far. On one hand this gives you transparency and a sense of control. On the other it can result in overreactions, or even panic, in response to results that are not yet complete. Stopping a test before reaching the previously determined sample while continuously analyzing current results, and stopping at the first moment the statistical significance threshold is reached, is a guarantee of making a mistake during the research. This not only creates a statistical bias toward finding a difference (that does not exist), but on top of that the bias cannot be corrected (for example by demanding a higher significance level). The second trap is generating excessive expectations about the performance of the winning variant from the test you ran. Because of a statistical effect called regression toward the mean, the performance of the better performing option may not be as valuable as it was during the test. Put plainly – the winning variant may have earned that title not only because it really was significantly better than the other, but also because it simply had more "luck". Its good run comes to an end and performance starts to decline.

05 Do we have an alternative to A/B tests?

Of course we do! The world of website optimization offers a very wide range of use cases, and A/B tests fit only some of them. Let us assume you are running a test on a page that has been performing well for a long time, while the change you want to make is meant to be permanent and applicable to all users, also over the longer term after the test ends. In such a situation it is important to make an accurate comparison of how the two variations perform, which is often simply impossible.

For example, if you want to test which headline performs best for a given article and you know it will be displayed on your homepage for only a few hours. That means you have to notice quickly which of them has a higher open rate and then use that knowledge as soon as possible. In this case you can apply the multi-armed bandit method, which will help you with that. It works by splitting traffic between the variants used depending on the performance observed so far and the level of confidence. That brings you closer to recognizing which option is "really" the best, for faster convergence. It is also the first level of optimization.

Optimization goes deeper when you aim for genuine personalization, where you can match users to different variants both manually and automatically. As an example of manual control, you can set visitors from the Netherlands on King's Day to see an orange background on the homepage.

Such manual control makes sense in many situations, but it does not work all that well: let us say you have a special promotion for visitors redirected from Facebook. What should you show them? Once you start inventing new variants and user segments, the rules quickly become complicated – and there is an element of guesswork here: you think you should hit the bullseye, but nobody really knows what it looks like. That is precisely why another approach that can work better in some cases is automatic personalization (including marketing automation). Let us assume you run a recipe site. You have a planned slot where you want to show the user a recipe you recommend, based on their earlier visits to cooking pages. In this case automatic personalization will work perfectly.

Allocation of variability across different research methodologies
Allocation of variability across different research methodologies

Read our article on personalization as well - How to design personalization that delivers measurable results?

To sum up

A/B tests can be extremely effective, but at the same time very misleading if they are not run properly. Reaching the point of statistical significance is crucial for obtaining credible results. To get there, you have to establish the required parameters, estimate the sample size and then stick to it. Checking test results frequently is a classic mistake that can result in losing the intended outcome of the test. If you need short-term optimization, you should consider methods such as the multi-armed bandit mentioned earlier or intelligent personalization based on machine learning.

Let’s talk

Let us talk about your growth.

Book a free consultation — we will show you where a measurable result lands fastest.