A/B testing is a controlled experiment for websites, apps, emails and ads. You keep the current version (A, the control), make one change (B, the variant), and show each to a random half of your visitors at the same time. After enough visitors, you compare which version reached your goal more often: more sign-ups, more purchases, more clicks on a button.
Because the visitors are split at random and see the versions in the same period, the difference you measure comes from your change, not from the season, a sale or a news story. That is what makes A/B testing more reliable than comparing "before" and "after".
You'll also hear it called split testing. A multivariate test is a bigger cousin: it changes several things at once and measures each change and how they work together. It needs much more traffic.
How to run an A/B test
- Pick one goal and one number. Usually a conversion rate: the share of visitors who sign up, buy or book. Decide this before you start, not after you see the results.
- Write down what you expect and why. "A shorter form will get more sign-ups, because people abandon it at the phone number field." A reason makes the result useful even when the test loses.
- Decide how many visitors you need. A sample size calculator takes your current conversion rate and the smallest change worth detecting, and tells you how many visitors each version needs. Run whole weeks, so weekday and weekend visitors are both counted.
- Split traffic at random. Each visitor should stay in the same version on every visit, or the groups blur.
- Don't stop early. Results swing a lot in the first days. If you stop the moment B looks ahead, you'll often "win" by chance.
- Read the result and act. Ship the winner, or keep A and write down what you learned.
An example
Say an online store wants more people to finish checkout. Today the button says "Continue". The team's guess: "Pay now" is clearer about what happens next.
They split checkout visitors 50/50 for three full weeks. Version A converts 3.1% of visitors, version B 3.4%. Their testing tool reports that a difference this large would be unlikely if the two buttons really performed the same. They switch to "Pay now", then test the next idea.
What a result can and can't tell you
"Statistically significant" means the difference you saw would be unlikely if both versions performed the same. It doesn't tell you the change is large enough to matter, and it doesn't explain why visitors behaved differently.
Keep three limits in mind:
- Small sites run out of visitors. With a few conversions a week, a test can take months. Test bolder changes, or learn from user interviews and session recordings instead.
- A win in one place may not carry over. A headline that wins on mobile may lose on desktop; a change that helps new visitors may annoy returning ones. Look at the main segments before you generalise.
- New things get a short bump. Returning visitors sometimes click something simply because it's new. A test that runs full weeks shows whether the effect lasts.
How to run tests without hurting your SEO
Google has clear rules for testing pages that search engines can see: Google Search Central
- Don't cloak. Never show Googlebot one version and people another. That breaks Google's spam policies, test or not.
- Point alternate URLs to the original. If version B lives at its own URL, give it a canonical tag pointing to the original page. Google recommends this over a noindex tag.
- Use a temporary redirect. If you send visitors from the original URL to a test URL, use a 302, not a 301, so search engines keep the original in their index. JavaScript redirects are fine too.
- End the test when it's done. Remove the test URLs and scripts once you have your answer. Google may treat a test that runs far longer than needed as an attempt to deceive.
Googlebot generally doesn't accept cookies, so if your test uses cookies to assign versions, Google sees the version a cookie-less visitor would get.
SEO tests work differently
A normal A/B test splits visitors. Search engines can't be split that way: they index one version of each page, and you can't choose which searchers see which. So to test an SEO change, such as a new title format, teams split pages instead. They take a large group of similar pages, change half of them, and compare the search traffic of the changed group with the unchanged group over the following weeks. It takes many similar pages and patience, and it answers a different question: did search engines respond, not did visitors.
Tools for A/B testing
Google's own testing tool, Google Optimize, closed on September 30, 2023. Google now points to third-party testing tools that connect to Google Analytics.
For ads, Google Ads has custom experiments: you run a trial version of a campaign on a share of its traffic and budget, and compare it with the original. For Search campaigns you can split by cookie, so each person sees only one version, or by search. Google Ads Help
A/B testing is one method inside conversion rate optimization: research finds the problems, and tests show which fixes actually work.