Guide · A/B testing

A/B testing best practices for e-commerce

How to plan, run and read an A/B test, with a worked example and two free calculators.

What an A/B test is

Instead of changing a page and hoping, you show half your visitors the current version (the control) and half a new one (the variant). Both run at the same time, to the same kind of visitors. If one converts better, the only explanation is the one thing that differs.

Worked example

A skincare store shows 1,200 cart visitors a day. 4.0% of them place an order. The team wants to add a bar to the cart that shows how far the visitor is from free shipping.

Why sample size matters

With 20 visitors per version, 2 orders against 3 looks like a +50% lift. A gap like that shows up about 6 times in 10 even when nothing has changed.

Measured on thousands of visitors, the same lift would be a real finding. Work out how many visitors your test needs before you start, and let it run until it has them.

Step 1

Write a hypothesis

Write down what you expect to happen and why. This makes you choose one metric and gives you something clear to judge the result against.

If we [change], then [metric] will [move], because [reason].
Worked example

“If we show a free-shipping progress bar in the cart, the order rate will rise by 15%, because visitors close to the threshold will add one more item instead of leaving.”

Step 2

Check you have enough traffic

Before you set anything up, calculate how long the test needs. You need three numbers:

  • your current conversion rate
  • the smallest lift that would be worth acting on
  • how many visitors a day will see the test

If the answer is more than two months, change the plan. Over that long, seasons, campaigns and site changes start to affect the result.

Worked example

4.0% today, a 15% lift to detect, 1,200 visitors a day, 95% confidence and 80% power:

17,943visitors per version
35,886visitors in total
30 daysto reach significance

If you don't have enough traffic, test a metric higher in the funnel. More visitors click than buy, so a click or add-to-cart test reaches significance much faster and still shows whether the funnel improves.

  • Views
  • Clicks
  • Add-to-carts
  • Orders

Before launching, check that the test fits in under two months, that the lift you need is realistic, and that no other test is running on the same visitors.

Free tool

How many days will your test take?

Open the duration calculator →
Step 3

Set up the test

  1. Duplicate the current version as your control, so both start from the same base
  2. Add one variant and change only the element your hypothesis names
  3. Split traffic 50/50, which reaches significance fastest
  4. Pick one primary metric, or the closest one your tool can track
  5. Launch and leave copy, design and audience untouched until the date you calculated
Step 4

Track the test

Your testing tool tells you whether the variant won on the primary metric.

Your analytics tool tells you what the win is worth in revenue and order value, and whether the lift holds further down the funnel. Check both before you decide.

Step 5

Read the result

  1. Did the metric move in the direction your hypothesis predicted?
  2. Is the lift big enough to matter, compared with the effort to roll it out?
  3. Did it reach the confidence level you set before the test?
Worked example, 30 days later

18,000 visitors per version. The control converted 720 (4.00%), the variant 820 (4.56%).

+13.9%uplift
99.1%confidence
p = 0.009p-value

The lift is a little below the 15% the team hoped for, and it is significant, so they roll it out.

You seeDo this
Uplift, significantRoll outShip the variant.
Drop, significantKeep controlThe change hurts. Note why.
Close to the lineExtendRun to the planned sample if you can.
Far from the lineMove onNo real difference. Try a bolder idea.

Free tool

Is your result significant?

Open the significance calculator →
Step 6

After the test

  • Log the hypothesis, dates, sample size, result and what you learned, including for tests that lost
  • Apply what worked to similar pages, popups and emails
  • Rate your next ideas on impact, confidence and effort, and run the highest score first

Common mistakes

  • Stopping the test early because the first days look good, when results usually move a lot before they settle
  • Editing the versions or the audience while the test is running
  • Running the test during a sale or holiday and treating the result as normal
  • Changing several things at once, so you can't tell which one made the difference
  • Rolling out a lift that is real but too small to be worth the work

What to test

The same method works on every channel. Good places to start are pages with a lot of traffic and changes that are cheap to make.

Onsite messages

  • Headline and offer
  • Button copy
  • Design and position
  • Number of form fields
  • Single vs multi-step forms

Email and SMS

  • Subject line and preview
  • Send time and delay
  • Offer vs no offer
  • Flow length
  • Product blocks and layout

When and to whom

  • Trigger: delay, scroll, exit intent
  • New vs returning visitors
  • Traffic source and device
  • Frequency caps and cooldowns
  • Hiding after purchase

Frequently asked questions

What is the difference between a one-sided and a two-sided test?
A two-sided test checks if the variant is better or worse than the control. A one-sided test only checks if it is better. One-sided needs about 20% fewer visitors, but it can't confirm that a change hurts, so two-sided is the safer default for most tests.
Can I A/B test with low traffic?
Yes, if you test bigger changes or a metric with more volume. Clicks and add-to-carts happen far more often than orders, so they reach significance sooner. If a test would need more than two months, don't run it as planned.
How many versions can I test at once?
Two is best for most stores. Each extra version adds a full share of traffic to the total and raises the risk of a lucky winner. With three or more, use 99% confidence.
What is the difference between A/B and multivariate testing?
An A/B test compares whole versions that differ in one thing. A multivariate test changes several elements at once and measures every combination, which needs many times more traffic. Most e-commerce sites should stick to A/B tests.
Should traffic always be split 50/50?
For a standard test, yes. An even split reaches significance fastest. Only shift the split, say 80/20, if the new version carries real risk and you want to limit exposure, and accept that the test will take longer.
How long should an A/B test run?
Until it reaches the sample size you calculated before starting, in whole weeks, and never less than seven days. Use the duration calculator to get the number of days for your traffic.

Want a testing roadmap?

Get a list of tests for your store, ranked by impact.

Book a call →