Preferences

Privacy is important to us, so you have the option of disabling certain types of storage that may not be necessary for the basic functioning of the website. Blocking categories may impact your experience on the website. More information (Cookie Policy)

A/B Testing in Marketing: How to Run Tests That Give Real Answers

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.

Published on
23/11/2026
Updated on
23/11/2026
Reading time
19 min
A/B Testing in Marketing: How to Run Tests That Give Real Answers

Tools

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?

Question 1 of 425%
What do you want to know first?

What is A/B testing in marketing?

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

A/B test
  • Both versions run at the same time
  • Visitors are split at random
  • Needs enough traffic to read
Before and after
  • Quick to set up
  • Season, ads and news change too
  • Cannot prove the cause

Five test designs and when to use each

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.

A/B test

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.

A/B/n test

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.

Multivariate test

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.

Split URL 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.

Before and after comparison

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.

DesignVersions testedTraffic neededBest useMain risk
A/B test2ModerateOne change on one pageSmall gains take many visitors
A/B/n test3 or moreHigherPicking from a short listEach version gets less traffic
Multivariate test4 or more combinationsVery highFinding the strongest elementHard to read and slow
Split URL test2 pagesModerate to highFull redesign or new flowThe pages differ in more than one way
Before and after2 periodsAnyA quick signal when no split is possibleOutside factors cannot be removed
Two web page versions shown side by side, one highlighted in blue, linked to a bar chart.
Two versions of a page compared in an A/B test.

How an A/B test works, step by step

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

  1. Find the problemPick a page or message that underperforms on one metric, such as the sign-up rate of a landing page.
  2. Write the hypothesisName the change, the expected result and the reason.
  3. Build one variantChange one element only, so a result points to one cause.
  4. Set the rulesFix the sample size, the significance level and the metric before launch.
  5. Split and runSend half the traffic to each version at random and leave both versions unchanged.
  6. Read and actRead the result once, at the end, then keep the winner or log what you learned.

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.

Write a hypothesis that can fail

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.

Pick a page with a clear job

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.

Change one thing

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.

Use the hypothesis template

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

Weak
  • "Make the page better"
  • "Test a new design"
  • No metric, so no result
Strong
  • "If we move the price above the fold, then trial starts go up, because visitors can judge the cost before they scroll"
  • One change and one metric are named
  • The reason can be proved wrong

Set the sample size and the significance level before launch

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.

Why the sample size comes first

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.

A simple rule of thumb

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.

Check the number with a calculator

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.

Evan Miller's sample size calculator form, with fields for baseline conversion rate, minimum detectable effect, power and significance level.
Source: Evan Miller, sample size calculator for A/B tests

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.

Significance and power in plain words

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.

Choose one primary metric and a few guardrails

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

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.

Guardrail metrics

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.

ElementPrimary metricGuardrail
Landing page headlineSign-up ratePaid conversion rate
Call to action buttonClick-through rateForm completion rate
Email subject lineOpen rateUnsubscribe rate
Paid ad copyCost per conversionRefund or cancellation rate
Blog introClick on the next stepTime on page

Marketing elements worth testing, with examples

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.

Landing pages

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.

Emails

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.

Social posts

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 posts and pages

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.

ChannelElement to testExample variant BPrimary metric
Landing pageHeadline"Start your trial in 2 minutes"Sign-up rate
EmailSubject line"Your report is ready" against "3 changes for this week"Open rate
Paid adsAngleSpeed against priceCost per conversion
Social postFirst lineA question against a statementClicks to the link
Blog postCall to action placementMid-article against end of articleCTA clicks

Read the result without fooling yourself

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.

What significance means in practice

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.

Optimizely glossary page defining statistical significance in A/B testing.
Source: Optimizely, optimization glossary, statistical significance

The peeking problem

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.

Reported cut-off to keep a real 5% false positive rate

1 check2.9%
2 checks2.2%
3 checks1.8%
5 checks1.4%
10 checks1.0%

Source: Evan Miller, "How Not To Run an A/B Test", 2010

What to do instead

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

26.1%false winners when a test with no real effect is stopped at the first 5% result, in the 50% baseline example
3600visitors per version for a 10% rate and a 2 point gain, by the rule of thumb

Sources: Evan Miller, "How Not To Run an A/B Test", 2010 (peeking example and rule of thumb)

The mistakes that create false winners

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.

Error 1: stopping the test early

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.

Error 2: changing several elements at once

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.

Error 3: running the test for a few days

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.

Error 4: an uneven split or traffic that moves

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.

Error 5: broken goal tracking

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.

Error 6: no written hypothesis

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

  • The sample size you set before launch is reached
  • The test ran for at least one full week
  • Only one element changed between the versions
  • The traffic split is close to the planned split
  • Both versions fire the same goal event

Run tests in Google Ads and in paid campaigns

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.

Google Ads Help page 'Set up a custom experiment', describing the experiment split and budget options.
Source: Google Ads Help, 'Set up a custom experiment'

According to Google's Help page "Set up a custom experiment", several rules matter before you launch:

  1. The budget is split evenly between the original campaign and the experiment, and you choose what share of the original budget goes to the experiment.
  2. For Search campaigns, you choose a cookie-based split or a search-based split. Display campaigns always use cookie splits.
  3. The experiment depends on the base campaign. If the base campaign is paused or ends before the experiment does, the experiment does not run.
  4. You can schedule up to 5 experiments per campaign, but only one runs at a time.
  5. Changes made to the original campaign do not carry over to the experiment, so make the changes you want to test in the experiment itself.

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.

Apply or discard the winner

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.

Landing pages and email tools

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 A/B test, in order

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.

  1. Choose one page or email with steady traffic and a measurable next step.
  2. Write the hypothesis in the template, with the reason.
  3. Pick the primary metric and two guardrails.
  4. Compute the sample size per version with the rule of thumb, then check it with a calculator.
  5. Build one variant and test the goal on both versions before launch.
  6. Launch the test and leave it alone until the end date.
  7. Read the result once, log it, and choose the next test from the same list.

Your first test plan

  • Choose one page with steady traffic
  • Write the hypothesis and the primary metric
  • Compute the sample size per version
  • Build one variant and test the goal on both versions
  • Launch and leave it alone until the end date
  • Log the result, win or lose, in one shared sheet

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.

Frequently asked questions

What is A/B testing in marketing?

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.

How long should an A/B test run?

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.

How many visitors do you need for an A/B test?

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.

Get your content plan for 30 days for free

We analyse your competitors, your website and your AI visibility to create a tailored content plan for free.

Our free SEO tools

See all our free tools

Get your content plan for 30 days for free

We analyse your competitors, your website and your AI visibility to create a tailored content plan for free.

Man with dark hair and beard wearing a light brown shirt speaks in front of a microphone on a podcast or recording setup.Portrait of a man with short dark hair wearing a white shirt and dark jacket, looking directly at the camera with a neutral expression.Man with short dark hair, beard, and clear glasses wearing a black t-shirt with a white circular logo, standing in front of a stone wall.Celio fabianoSmiling young woman with long brown hair wearing a red top and necklace, outdoors in a tree-filled background.Profile photo of Xavier Breull, Sorank customer
Google
Solid yellow five-pointed star icon on transparent background.Solid yellow five-pointed star icon on transparent background.Solid yellow five-pointed star icon on transparent background.Solid yellow five-pointed star icon on transparent background.Solid yellow five-pointed star icon on transparent background.
5/5
+5,000
users

Testimonials from ambitious founders

0 to 10000 visitors in 5 months

Celio Fabianomonrobotlavevitre.frGoogleE-commerce

0 to 5000 visits in 8 months

Thibault BMsorank.comGoogleSoftware

0 to 1104 clicks in 4 months

Dominiqueflight-sensations-idf.comGoogleLeisure and aviation

0 to 163 clicks in 6 months

Coworking Pariscoworking-paris.frGoogleOffice broker

x92 clicks in 7 months

Guide Zanzibarguidezanzibar.comGoogleTravel