A/B Testing for Ecommerce: How to Run Tests You Can Trust

10xgrowth.club Editorial7 min read

Key takeaways

  • An A/B test splits visitors at random between two versions and compares an outcome. Its value is that it separates the effect of your change from everything else that moved that week.
  • Decide the metric, the minimum effect worth detecting and the sample size before you start, then do not stop early because the dashboard looks good.
  • Many stores do not have the traffic to detect small differences. When you do not, test bigger changes, or use research and before-and-after checks and call them what they are.

A/B testing for ecommerce means showing two versions of a page, price, message or flow to randomly assigned visitors and comparing an outcome such as orders per visitor. Done well, it tells you whether a change caused a difference. Done badly, it produces confident wrong answers. This guide covers what to test, how much traffic you need, the most common way tests go wrong, and how to read a result without overselling it.

What an A/B test can and cannot tell you

Random assignment is the whole trick. If visitors are split by chance, the two groups should be similar in everything except the change, so a difference in outcome can be traced to the change, plus some noise. A before-and-after comparison cannot do this, because the week after a redesign also differs in traffic mix, promotions, weather and what competitors did.

A test answers a narrow question: for this audience, in this period, did version B produce a different result on this metric than version A? It does not tell you why, it does not guarantee the result holds next season, and it says nothing about metrics you did not measure. Treat each result as evidence, and keep a record of what you tested and what you decided.

What to test first

Start where the money is. Find the steps with the most visitors and the biggest drop-off, then test changes that could plausibly move them. The research firm Baymard Institute, which studies checkout design, lists reasons shoppers give for abandoning a cart. On its [cart abandonment statistics page](https://baymard.com/lists/cart-abandonment-rate), among shoppers who gave a reason other than just browsing, 40% cite extra costs being too high, 18% say the site wanted them to create an account and 17% cite a too long or complicated checkout. Those are hypotheses worth testing in your own store, not guarantees about it.

Improvement loop: measure, change one thing, read, keep or revertA repeating loop of five steps: Measure, then Pick one change, then Run the test, then Read the result, then Keep or revert. After keeping or reverting, return to measuring.Measurewhere shoppers drop offPick one changethe biggest leak firstRun the testsplit traffic fairlyRead the resultwith the metric you choseKeep or revertlog what you learnedRepeat
Change one thing at a time so a result can be traced to a cause, and write down what you learned either way.
Data table for this figure
StepDetail
Measurewhere shoppers drop off
Pick one changethe biggest leak first
Run the testsplit traffic fairly
Read the resultwith the metric you chose
Keep or revertlog what you learned
Where to look for test ideas
AreaExample changePrimary metric
Product pageReorder images, change the lead benefit, add size guidanceAdd-to-cart rate
CartShow shipping cost and delivery date earlierCart to checkout rate
CheckoutOffer guest checkout, cut optional fieldsCheckout completion rate
Pricing and offersFree-shipping threshold, bundle structureRevenue per visitor
EmailSubject line, send time, first-flow offerOrders per recipient
Collection pagesDefault sort, filter placementProduct-view rate and revenue per visitor

Prefer revenue per visitor or orders per visitor as the final judge when you can measure it, because a change that lifts add-to-cart but lowers completed orders is not a win. Keep one primary metric per test. Others are for diagnosis.

Write the hypothesis before you build

A usable hypothesis has four parts: the change, the audience, the metric and the reason. For example (an illustration, not a tested result): showing delivery date on the cart page, for all mobile visitors, will raise the cart-to-checkout rate, because shoppers cite slow delivery as a reason to leave. If you cannot state the reason, you are guessing, and a guess that wins teaches you nothing you can reuse.

  1. State the change in one sentence.
  2. Name the single primary metric and where it is measured.
  3. Name the smallest improvement that would be worth shipping.
  4. Write down the sample size and the planned end date.
  5. Record who decides, and what happens on a win, a loss or a flat result.

How much traffic you need

Sample size depends on your baseline conversion rate and the smallest effect you want to detect. Evan Miller, a statistician who writes about experiment design, gives [a rule of thumb: n = 16 × σ² ÷ δ²](https://www.evanmiller.org/how-not-to-run-an-ab-test.html), where δ is the minimum effect you wish to detect and σ² is the sample variance you expect. For a conversion rate, he says, the variance is p × (1 − p). His page does not say whether n is per variant or in total. The standard two-group calculation at 5% significance and 80% power gives roughly this figure per variant, so the table below treats it that way; his interactive sample size calculator lets you set power and significance yourself.

The numbers below are assumptions to show the arithmetic, not a result from any store.

Illustrative arithmetic: sample size for a conversion-rate test
Assumption or stepValue
Baseline conversion rate (p)3.0%
Smallest lift worth detecting (δ)0.6 percentage points (3.0% to 3.6%)
Variance, p × (1 − p)0.03 × 0.97 = 0.0291
Sample per variant, 16 × 0.0291 ÷ 0.006²about 12,900 visitors
Total for two variantsabout 25,900 visitors

If a page gets 2,000 visits a week to the tested step, that test would take about thirteen weeks. That is a realistic picture for many small stores. Halving the detectable lift roughly quadruples the sample, because δ is squared in the denominator, so chasing small effects is expensive. When the arithmetic says you cannot reach the sample in a reasonable time, you have three honest options: test a bigger change, test somewhere with more traffic, or skip the test and use qualitative research.

Run whole weeksShopping behaviour differs by day of the week. Run a test for complete weeks, so each day appears equally in both groups, even if the sample size is reached sooner. Avoid starting a test just before a major sale unless you want to test the sale.

Want the evidence, not the theory?

Every growth figure on this site is computed from a dated start and end value with linked sources.

Browse the cases

The peeking problem

The most common error is stopping a test the moment it shows a significant result. Evan Miller's article is blunt about it: if you say “we’ll run it until we see a significant difference,” the reported significance levels become meaningless. In his worked example, a test with a 50% baseline conversion rate, stopped at the first 5% significance or after 150 observations, wrongly finds a significant result 26.1% of the time when the change does nothing, against the 5% most people assume.

Conversion funnel with one question per stageFive stages from visit to purchase: Visit, View a product, Add to cart, Start checkout, Purchase. The funnel narrows at each step. Bar widths are illustrative, not data.Illustrative shape, not dataVisitWho arrives, and fromwhich channel?View a productDoes the page answerthe shopper's questions?Add to cartAre price, proof anddelivery clear?Start checkoutDo fees or stepssurprise them here?PurchaseCan they pay the waythey expect to?
Illustrative shape: widths are not data. Measure your own drop-off at each step, then fix the stage with the largest leak first.
Data table for this figure
StageQuestion to ask
VisitWho arrives, and from which channel?
View a productDoes the page answer the shopper's questions?
Add to cartAre price, proof and delivery clear?
Start checkoutDo fees or steps surprise them here?
PurchaseCan they pay the way they expect to?

He also gives a table of the reported significance you would need to see to have an actual 5% level if you peek: 2.9% after one peek, 2.2% after two, 1.4% after five and 1.0% after ten. His advice is to decide the sample size in advance and wait until the experiment is over before believing the dashboard's figures. If you need to stop early for business reasons, use a method designed for it, such as sequential or Bayesian designs, which he names as alternatives.

  • Set the end date and sample size before launch and write them in the test record.
  • Look at the dashboard to check the test is running and tracking, not to decide.
  • Do not add variants midway; start a new test.
  • Do not change traffic allocation midway unless the tool is built for it.

Reading the result

How to read the three outcomes
OutcomeWhat it meansWhat to do
B clearly better, sample reachedEvidence the change helped on the primary metricShip it; keep monitoring revenue and returns
No clear differenceThe change did not move the metric by an amount your test could detectDo not call it a loss; decide whether a bolder version is worth testing
B clearly worseEvidence the change hurtDo not ship; write down what you learned about the audience

Look at the interval around the estimate, not just whether it passed a threshold. A hypothetical result of plus 4% with an interval running from minus 3% to plus 11% cannot rule out no effect, or even a loss. Check that the split was even, that there was no tracking fault, and that the winning version did not pull orders forward from next week through a discount.

Segment cautiously. If you cut a result by device, country, new versus returning and traffic source, some segment will look significant by chance. Treat segment findings as ideas for the next test rather than conclusions.

What the cases tell us, and what they do not

Our case records do not report A/B test results, and we do not infer any. A few records do mention testing or trial steps. Brooklinen used “Kickstarter pre-orders ($236,888) as launch demand test”, a demand test at the product level rather than the page level, and also lists “Kickstarter pre-orders ($236,888) as launch demand test” among its levers. For Dollar Shave Club, the record lists “Viral launch video (about $4,500 to produce) used as launch and fundraising asset”.

Nutrisystem tested TV and radio in 2004 before scaling. The record describes “Direct-response media scaled from 2004: TV and radio testing in 2004, then print and infomercials (Wharton, 10-K marketing spend $3.5M in 2003 to $118.5M in 2006)”, with revenue going $22.6M to $568.2M in 36 months. Of the 30 cases, 5 list email or SMS among their channels. Email is a convenient place to run frequent tests because you control the audience and can split it, though how fast results arrive depends on your list size.

Cases mentioned in this article

When you do not have the traffic

  • Test bigger changes. A larger effect needs a smaller sample, so a new offer structure is easier to detect than a button colour.
  • Use email and ads as test beds. Subject lines, creative and landing-page variants reach thousands of people quickly.
  • Read support tickets and watch real shoppers before inventing hypotheses.
  • Treat before-and-after checks as weaker evidence than a randomised test.

A simple testing routine

  1. Keep a backlog of ideas, each with a reason and the step it targets.
  2. Rank by the traffic at the step, the size of the leak and the effort to build.
  3. Write the test record: hypothesis, metric, sample size, dates, decision rule.
  4. Log the outcome, the decision and what you will do next, including for flat results.

The metrics a test should move are defined in ecommerce analytics metrics. For credit across channels, see ecommerce attribution, and for what to test on the page itself, read ecommerce product page SEO and browse the case database.

About the author: 10xgrowth.club Editorial

Articles are written by the editorial team from the case database and from general e-commerce practice. Every figure is computed from the case files or links to a source. Read how we work or the 10x rule.

Spotted a mistake?

There is no comment form on this site. Errors are tracked on the corrections list described in the method.

Related articles

See the numbers behind every guide.

Browse the case database: dated start and end figures, linked sources, evidence level on every record.

Browse the cases