Learn what A/B testing in marketing is, how to set a hypothesis and sample size, which elements to test first, and how to avoid false winners in your results.

On this page
In short
A/B testing in marketing shows two versions of one element, such as a headline or a button, to random groups of visitors. You keep the version that gets more of your goal. A sound test has one hypothesis, one changed element, a sample size set in advance, and no early stop.
Want to go further? Ask
Quick quiz
Which way of measuring your marketing fits you?
Sorank matches your answers
Test it for 3 days on your own site and see where you stand on Google, ChatGPT and the other AIs.
Start 3-day free trial3 days free, then stop whenever you want. 90-day results guarantee, conditions apply.
A/B testing in marketing is a controlled experiment. Half of your visitors see version A, the control, which is your current page or message. The other half sees version B, the variant, which differs in one element. You compare both groups on one goal, such as sign-ups, clicks or sales. Because each visitor lands in a group at random, a clear gap points to your change, not to luck or timing.
Here is a simple example. Your landing page headline says "Grow your traffic." You test "Get found on Google and in AI answers" against it. Both versions run at the same time, for the same kind of visitor. If version B gets more sign-ups once you have enough visitors, you make it the default and start the next test.
The method is simple, but the discipline is what makes it useful. A test that ends with "it looked better" teaches you nothing. A test with a written hypothesis, a fixed sample and one clear metric teaches you something you can reuse on the next page, the next email or the next ad.
If the wider practice is new to you, the conversion rate optimization glossary entry explains how teams improve pages for the actions they want. A/B testing is one of its main tools.
Why a random split beats a before and after comparison
The A/B test is one of five common designs. Pick the simplest one that answers your question, because every extra version or element needs more visitors before the result can be read.
Principle: one control and one variant, with one change between them. Use it when you have a single idea to check, such as a new call to action on a pricing page. Advantage: the result is easy to read and the cause is clear. Limit: small effects need many visitors. Example: "Start free trial" against "Try it for 3 days" on the same button.
Principle: one control and two or more variants of the same element. Use it when you have a short list of strong options and want the best one. Advantage: several options are compared in one go. Limit: each new version takes a share of the traffic, so every version needs more visitors to reach the same certainty. Example: three subject lines for one email send.
Principle: several elements change at once, and every combination is shown to a share of visitors. Use it when you have very high traffic and want to know which element matters most. Advantage: it shows how elements interact, for example whether a headline works better with one image than another. Limit: it needs much more traffic, and the results are hard to read when many combinations are involved. Example: two headlines, two images and two buttons give 8 combinations to test.
Principle: two different pages, on two different web addresses, each receive a share of the traffic. Use it when you rebuild a whole page or a checkout flow and want to test the full change. Advantage: it tests a big change in one go. Limit: the two pages can differ in speed and layout in more ways than the one you wanted to test. Example: the current checkout page against a shorter new one. If the test could affect search rankings, read our split testing guide for search rankings first.
Principle: you measure one period, make a change, then measure the next period. Use it when a random split is impossible, for example for a change that applies to all visitors at once. Advantage: it needs no testing setup. Limit: seasons, promotions and news can change the result, and you cannot remove them. Example: comparing sales in the month before and the month after a new price page. Use it as a rough signal, never as proof.
| Design | Versions tested | Traffic needed | Best use | Main risk |
|---|---|---|---|---|
| A/B test | 2 | Moderate | One change on one page | Small gains take many visitors |
| A/B/n test | 3 or more | Higher | Picking from a short list | Each version gets less traffic |
| Multivariate test | 4 or more combinations | Very high | Finding the strongest element | Hard to read and slow |
| Split URL test | 2 pages | Moderate to high | Full redesign or new flow | The pages differ in more than one way |
| Before and after | 2 periods | Any | A quick signal when no split is possible | Outside factors cannot be removed |

An A/B test works in six steps. You find a problem with a measured metric, write a hypothesis, change one element, set the rules, split the traffic at random, and read the result once at the end. Skipping a step makes the result hard to trust, and the steps depend on each other: a hypothesis without a metric cannot be checked, and a metric without a sample size can be read in the wrong way.
The six steps of an A/B test
The rest of this guide goes through each step in order, then covers the mistakes that create false winners and the tools you can use to run the test on ads and on your own pages.
A good hypothesis names the change, the metric and the reason. If a test cannot prove the hypothesis wrong, it is a wish, not a hypothesis, and no result will teach you anything.
Start where the funnel leaks. Look for the page that many visitors reach but few leave with the next action: a pricing page that gets steady visits but few trial starts, or an email that gets opened but rarely clicked. These pages have room to improve, and a single change there can show a clear result. Avoid a page with very little traffic, because the test would take months to read.
If you change the headline, the image and the button at once, a win tells you that the new page works, but not which change helped. Keep the test to one element. If you need to know how several elements work together, use a multivariate test, and only when your traffic can support it.
The template is: "If we change [element] to [variant], then [metric] will [increase or decrease], because [reason]." The reason is the part most teams skip, and it matters most. It tells you what to learn when the test loses. A result that goes against your reason is still useful, because the reason was wrong and you now know it.
Weak hypothesis or strong hypothesis
Set the number of visitors per version, the significance level and the end date before the test starts. These three numbers stop you from deciding the result while the test is still running, which is the most common way a test goes wrong.
A small test produces random winners. With a few dozen sign-ups per version, a 10 percent difference can appear and disappear from one day to the next. Significance tests assume that the sample size was fixed in advance. If you check the test every day and stop when it looks good, the reported significance is no longer valid. Evan Miller made this point in his 2010 article "How Not To Run an A/B Test", and it still holds for any test run by hand.
The rule of thumb in Evan Miller's article gives a quick estimate of the number of visitors needed per version. Use it to decide whether a test is possible before you build anything.
n = 16 × σ² / δ²
σ² = p × (1 − p)
n = visitors per version
p = current conversion rate (0.10 for 10%)
δ = smallest absolute gain you want to detect (0.02 for 2 points)
Take a page that converts 10 percent of its visitors. The variance is σ² = 0.10 × 0.90 = 0.09. If you want to detect a gain of 2 percentage points, δ is 0.02, so n = 16 × 0.09 / 0.0004 = 3600 visitors per version. The smaller the gain you want to detect, the more visitors you need. Halving the gain multiplies the sample size by about four, because δ is squared.
The sample size calculator on Evan Miller's site gives a more exact number. It asks for four inputs: the baseline conversion rate, the minimum detectable effect, the statistical power and the significance level. Its default example, a 10.2 percent baseline with a gain up to 13.2 percent, gives 2545 subjects per variation.

Enter your current rate first. If you do not know it, the conversion rate calculator on our site gives it from your visits and sign-ups.
Tip
Write the sample size on the test sheet before launch, next to the end date. When someone asks to stop the test early, the number is the answer.
The significance level is the risk of a false win: the chance of declaring a winner when the two versions are in fact the same. Optimizely's glossary defines statistical significance as the likelihood that the difference in conversion rates between a variation and the baseline is not from random chance. Power is the chance that the test finds a real difference when one exists. Many teams use a 5 percent significance level and a power of 80 percent. These are common choices, not laws, and a higher bar means a larger sample.
Pick one primary metric that matches the business goal, then watch two or three guardrail metrics that would reveal a harmful win. The primary metric decides the winner. The guardrails stop you from choosing a version that wins on paper and loses money.
The primary metric should be the closest measurable step to the outcome you need. If the goal is paying customers, a sign-up is a better primary metric than a click, and a paid conversion is better than a sign-up when you can measure it. Our conversion metrics guide gives the formulas for each step, so you can pick the right one before you start.
A guardrail is a metric you do not want to damage. A headline that raises sign-ups can also bring in visitors who never pay. A shorter form can lift form completions but lower the quality of the leads. Name the guardrail before launch, and read it with the primary metric when the test ends.
Warning
Do not use clicks as the goal when the business needs paying customers. A headline that gets more clicks can bring less qualified visitors, and the test will look like a win while revenue stays flat.
| Element | Primary metric | Guardrail |
|---|---|---|
| Landing page headline | Sign-up rate | Paid conversion rate |
| Call to action button | Click-through rate | Form completion rate |
| Email subject line | Open rate | Unsubscribe rate |
| Paid ad copy | Cost per conversion | Refund or cancellation rate |
| Blog intro | Click on the next step | Time on page |
The elements that influence a buying decision most are usually the headline, the offer, the call to action, the proof and the form. Start with the element where visitors drop off, not with the element that looks the oldest in the design.
Test the headline first, because it is the first thing a visitor reads. Then test the subheadline, the call to action text, the way the price is shown (above or below the fold, with or without a monthly amount), where testimonials sit, and how many fields the form has. Each one is a clean test with one change. The guide to 18 conversion levers ranks these options so you can pick the first test from a list rather than from habit.
Subject lines are the easiest test to run, because the open rate arrives within hours. Test one subject line against another, then test the sender name, the preview text, the number of calls to action and the send time. Read the subject line test on opens, but read the body and the call to action on clicks. Always check the unsubscribe rate as a guardrail, because a louder subject line can win opens and lose trust.
Ad copy is a good place to test an angle: price, speed or social proof. Compare two headlines that make different promises, or an image against a short video, with the same budget and the same audience. The metric is the cost per conversion, not the click-through rate alone. Google Ads has a built-in way to split a campaign, described in the section on running tests in Google Ads below.
On social media, test the first line of the post, the visual, and the hour of posting. A social test needs many posts before a pattern appears, so run the same test over several weeks and read the total. Measure clicks to your link, not likes alone, when the post is meant to bring visitors.
Blog tests usually check the placement of the call to action, the introduction and the title. A title that changes search clicks needs a different method from a test that changes on-page clicks, and it can affect rankings. Our SEO testing guide covers that case. For a list of tools that run the split for you, see the 10 best A/B testing tools.
| Channel | Element to test | Example variant B | Primary metric |
|---|---|---|---|
| Landing page | Headline | "Start your trial in 2 minutes" | Sign-up rate |
| Subject line | "Your report is ready" against "3 changes for this week" | Open rate | |
| Paid ads | Angle | Speed against price | Cost per conversion |
| Social post | First line | A question against a statement | Clicks to the link |
| Blog post | Call to action placement | Mid-article against end of article | CTA clicks |
A test is valid when you read it once, at the end, against the sample size you set. Checking it every day and stopping at the first good number creates false winners, even when the change does nothing at all.
A result can be statistically significant and still too small to matter. Check the size of the gap as well as the label. A 0.2 point difference between two versions can be significant with a very large sample, and still not pay for the work of rolling out the change. Decide in advance what size of gain would make the change worth shipping.

Peeking means checking a running test and acting on what you see. In Evan Miller's example, a new logo that does nothing still produced a false winner in 26.1 percent of tests when the test was stopped at the first 5 percent significant result, with a 50 percent baseline. The more often you check, the more likely a random swing looks like a win. His article also shows that after ten checks, a result that looks 1 percent significant is really close to 5 percent.
Set the sample size in advance and keep to it. If you need to look at the test while it runs, use a method built for it. Evan Miller's article points to sequential designs with set checkpoints, and to Bayesian designs, which allow valid conclusions at any time. Most testing platforms now describe which method they use, so read that page before you trust a live result.
What early stopping and sample size change
Sources: Evan Miller, "How Not To Run an A/B Test", 2010 (peeking example and rule of thumb)
The most common mistakes are stopping early, changing several things at once, running the test for too few days, splitting the traffic unevenly, and counting the goal wrongly in one version. Each one can be spotted in the data, and each one can be fixed before the next test starts.
What it is: you end the test as soon as one version leads, because the result looks clear or because you need the answer quickly.
How to spot it: the test end date in your tool is later than the day you called the winner, or the sample size is below the number you set before launch.
How to fix it: leave the test to its end date and to the sample size. If the team needs an answer sooner, accept a smaller change as the goal, or pick a method built for ongoing checks.
What it is: the new version has a new headline, a new image and a new button, so the test cannot say which change won.
How to spot it: the hypothesis names more than one change, or the team cannot say which element they expected to move the metric.
How to fix it: split the redesign into single tests, ordered by the size of the expected gain. Keep the big redesign for a split URL test, and read it as one change.
What it is: the test ends after two or three days, so it only saw one kind of visitor, for example weekday office traffic or the weekend shoppers.
How to spot it: the test window does not include a full week, or the result flips when you compare weekdays with weekends.
How to fix it: run every test for at least one full week, so both weekday and weekend visitors are included, and longer if the sample size needs it.
What it is: the tool sends 60 percent of visitors to one version, or a new ad, an email send or a promotion starts during the test and changes who arrives.
How to spot it: the share of visitors in each version is far from the planned split. Compare the traffic sources of both versions, day by day.
How to fix it: check the split on the first day. If it is off, stop, fix the setup and restart the test. Do not start or stop campaigns that send traffic to the test while it runs.
What it is: the sign-up event fires twice in one version, or not at all in the other. The test then compares two different measurements.
How to spot it: the goal count is much higher or lower than the number of sign-ups you see in your CRM, or only one version shows a goal.
How to fix it: test the goal on both versions before launch, and check the setup with the conversion tracking guide for your tools.
What it is: the test runs without a reason, so the result teaches nothing even when it is clear.
How to spot it: the team says "let us see what happens" or "the new one looks nicer" at the end of the test.
How to fix it: write the hypothesis in the template, with the reason, before you build the variant. Log the result against it.
Before you call a winner
Google Ads has a built-in custom experiment. It shares the original campaign's traffic and budget with a test version, so you can compare two campaign setups side by side, then apply the winner to the original campaign or turn it into a new campaign.

According to Google's Help page "Set up a custom experiment", several rules matter before you launch:
A cookie-based split keeps each user in one version for the whole test, which gives the cleanest comparison. A search-based split assigns each search at random, so the same person can see both versions. Use the cookie-based split when you want to know how a version affects a visitor over time, and the search-based split when you only want to compare the ads themselves. Pick one before launch and do not switch during the test.
Read the result on the primary metric and the cost per conversion, then apply the experiment to the original campaign or convert it into a new campaign. If the result is unclear, keep the original and log the test. A test that loses still tells you which angle does not work for this audience.
Google Ads only splits the ads. Your landing page and your email tool need their own split, and each of them has its own setup. Check the test options of your platform before you start, and use the same sample size and end-date rules as in this guide. For a comparison of software that runs these splits for you, read the A/B testing software list.
Your first test should be on one page with steady traffic, one element, and a written plan. Run it to the end and log the result, whether it wins or loses. The plan matters more than the first result, because the second and third tests will use the same habits.
Your first test plan
If your site has many old pages that need better wording, Sorank's content optimization feature fixes and rewrites them on autopilot. Measure those rewrites like any other change: keep the version that gets more of your goal, and log what changed. A rewrite you cannot measure is only a guess.
A/B testing in marketing shows two versions of one element to random groups of visitors. You compare which version gets more of a goal, such as sign-ups or clicks. The winning version becomes the new default only after the test ends with a clear result.
Run it until it reaches the sample size you set before launch, and cover at least one full week so weekday and weekend visitors both count. Do not stop early because one version is ahead, since early leads often disappear.
It depends on your current conversion rate and the smallest gain you want to detect. A 10% rate and a 2 point gain need about 3600 visitors per version, using a common rule of thumb. Smaller gains need many more visitors.
