How to Run A/B Tests for Conversion Optimization

Updated:

Would showing a sample page help more people buy your ebook, or would it just give them something else to click?

You can make the change and watch sales, but a better week might come from different visitors or a promotion. With limited traffic, choosing the wrong version means wasting visits you worked hard to earn.

A useful test makes that decision clearer. This guide follows an ebook sample-page test from the first hypothesis to the final result, including how to check whether your traffic can support it and when the evidence justifies keeping the change.

1. Define the Conversion You Want to Improve

Choose one main outcome before you design a variation. It should answer the business question behind the test.

An A/B test runs your existing experience, A, alongside a deliberate variation, B. Eligible visitors are randomly assigned to a version, and you compare their outcomes using the same rules.

Throughout this guide, imagine you sell a $29 ebook about painting beginner watercolor landscapes. You want to test whether a sample project page beside the purchase button increases sales. The business, customer observations and numbers are illustrative.

1. Define The Conversion You Want To Improve: How To Measure A/B Test Purchases; Eligible Sales-Page Visitors; Random Assignment; A; B; Count Every Assigned Visitor Once; Unique Purchasers Within The Window; Unique Assigned Visitors; × 100 =

Your primary metric is purchase conversion rate. Count assigned visitors who buy the ebook within a set period, then divide by everyone assigned to that version:

Purchase conversion rate = unique purchasers within the conversion window ÷ unique assigned visitors × 100

Define the group before assignment. Here, eligible visitors are people reaching the ebook’s sales page. Count each visitor once, including those who leave without clicking anything.

1. Define The Conversion You Want To Improve: A/B Test Conversion Windows Explained; First Exposure Starts The Clock; 7-Day Purchase Window; Purchase Within Window: Count It; Final Enrollment Day; Still Receives A Full 7 Days; Use Identical Rules

Next, choose a conversion window: how long after first seeing the experiment a purchase can count. Use your normal buying delay to choose it. For this example, assume seven days fits that pattern. Someone who joins on the final enrollment day still gets seven days to buy.

Calculate your baseline from comparable traffic using those same rules. Match recorded purchases against actual orders before trusting the figure.

Keep a few supporting measures:

  • Business Value: Revenue per assigned visitor.
  • Guardrails: Outcomes that must stay acceptable, such as checkout errors.
  • Diagnostic Measures: Actions that help explain behavior, such as purchase-button clicks.

These measures serve different purposes. More button clicks can help explain a result, but they do not establish that sales improved. Microsoft’s experimentation guidance makes the same distinction between outcome, diagnostic and guardrail metrics.

2. Choose a Change With a Clear Hypothesis

Start with evidence of a problem. Review where people leave the buying process, then look for customer questions or usability observations that might explain the gap.

A sales report tells you that people left. A customer asking, “What will I actually paint?” gives you something concrete to investigate.

On one digital-product page, I caught myself listing file formats before showing a finished example. I had spent so long making the product that I forgot what a stranger still needed to see. Now I check the page against the questions a buyer can reasonably answer from it.

For the watercolor ebook, suppose several visitors ask what the projects include. That suggests uncertainty about the content, so a sample project is a reasonable test.

Write the hypothesis before building it:

Because visitors keep asking what the projects include, showing a sample project page beside the purchase button should increase purchase conversion by making the ebook’s contents easier to judge.

2. Choose A Change With A Clear Hypothesis: Test An Ebook Preview, Not A Whole New Page; A: Existing Sales Page; $29; Buy Ebook; B: Add A Sample Project; Keep Price, Checkout And Unrelated Copy Constant; Bundled Edits Measure The Whole Package

Then define the contrast:

VersionWhat Visitors See
AThe existing sales page
BThe same page with a sample project preview beside the purchase button

Keep the price, checkout and unrelated copy consistent.

I would prioritize this over a button-color test because it addresses an observed buying question. When comparing ideas, weigh the evidence, likely business value, eligible traffic and effort required.

Fix confirmed faults directly. A broken payment link does not need to earn its repair through an experiment.

You can test several coordinated edits as one coherent idea, such as a redesigned product-preview section. Just remember that the result measures the whole package. It cannot tell you which individual edit helped.

3. Plan a Test Your Traffic Can Finish

Estimate the Required Sample

Check the traffic requirement before spending an afternoon building B.

Use a sample-size calculator for comparing two conversion rates. Match its settings to your planned analysis, using the inputs below.

Estimate The Required Sample: Plan Your A/B Test Sample Before Building; Baseline: 5%; Target: 6%; 20% Relative Lift; Two-Sided Significance: 5%; Power: 80%; Allocation: 50% A / 50% B; About 8,158 Visitors Per Version; Round Up: 8,200 Per Version

For the ebook preview, suppose a 0.2-percentage-point increase would justify its upkeep. The sample plan below targets a larger increase, from 5% to 6%, because detecting smaller changes requires more traffic.

Here is the sample calculation we will use:

SettingExample Input
Baseline5% purchase conversion under the chosen measurement rules
Detectable improvement20% relative lift, taking conversion from 5% to 6%
Significance level5% false-positive rate when rates are equal; two-sided to detect increases or decreases
Power80% chance of detecting the specified improvement if it exists
Allocation50% of eligible visitors to A and 50% to B
Required sampleAbout 8,158 visitors per version; round up to 8,200
Estimate The Required Sample: A/B Test Detection Targets And Business Thresholds; 5% Baseline; 5.2%: +0.2 Percentage Points; Business Threshold; 6%: +1 Percentage Point; Sample-Design Target; Detecting Smaller Improvements Needs More Traffic; 5% To

Applying the sample-size method documented by Statsmodels to these inputs gives about 8,158 visitors per version.

Notice the difference between relative lift and percentage points. Moving from 5% to 6% is a one-percentage-point increase and a 20% relative increase.

Set the Endpoint Before Launch

To estimate enrollment time, divide the total required sample by eligible new visitors per day. Count people newly entering the experiment, not repeat page views.

For the ebook test:

16,400 visitors ÷ 800 eligible new visitors daily = 20.5 enrollment days

Set The Endpoint Before Launch: How Long Will Your A/B Test Take?; 16,400 Visitors ÷ 800 Daily; 20.5 Enrollment Days; About 21 Days Of Enrollment; Then Allow 7 Days For Final Purchases; If The Sample Is Still Short:; Stop Enrollment At 28 Days; Then

That means roughly 21 days of enrollment, followed by seven days for the final participants to complete their conversion windows.

Before launch, set:

  • Sample Target: About 8,200 visitors per version.
  • Calendar Coverage: Enough time to include normal weekday and weekend patterns.
  • Maximum Runtime: For this example, stop enrollment after 28 days if the sample target is unmet, then allow seven more days for purchases.
  • Analysis Rule: The statistical comparison and decision criteria you will use.
  • Safety Limits: Reasons to stop for broken checkout, failed tracking or unacceptable harm.

For this guide, use a fixed-sample approach: judge performance at the planned endpoint. Ending an ordinary significance test the first time the result looks favorable increases false positives. Evan Miller explains why repeated checks followed by early stopping cause this problem.

Save these decisions, your hypothesis and your measurement rules in a short experiment brief.

Set The Endpoint Before Launch: Set A/B Test Stopping Rules Before Launch; Sample Target; Maximum Runtime; Analysis Rule; Safety Limits; Compare Performance At The Planned Endpoint; Early Favorable Result ≠ Permission To Stop; Safety Faults Can

You do not need to write the brief from a blank page. This AI Skill drafts it around your actual change and flags the measurement choices you still need to settle.

Lead Magnet Cover
FREE AI SKILL

Free AI Conversion Experiment Planner

Use AI to spell out what changes between page versions and what stays the same.
Send My AI Conversion Experiment Planner ❯
Instantly delivered to your inbox
Customer Avatar 1
Customer Avatar 2
Customer Avatar 3
Customer Avatar 4
Rated highly by 9,000+ users

For the ebook preview, the confidence interval will describe uncertainty around the estimated increase. Adopt B only if the whole interval is above +0.2 percentage points, costs are acceptable and fewer than 0.1% of assigned visitors encounter a checkout error. The 80% power setting concerns detecting a difference from zero, not clearing this stricter adoption threshold.

Detecting an improvement and showing that it is worth the work can require different amounts of traffic. Use your own numbers to compare both requirements and see what fits your available runtime.

Lead Magnet Cover
FREE CALCULATOR

Free Test Feasibility Calculator

Use our free calculator to find out whether your traffic, time or budget can show the improvement you want, and whether that improvement would be worth it.
Send My Free Calculator ❯
Instantly delivered to your inbox
Customer Avatar 1
Customer Avatar 2
Customer Avatar 3
Customer Avatar 4
Rated highly by 9,000+ users

If the maximum runtime arrives before the sample target, record the shortfall. You have less information than planned, and the result may remain inconclusive.

Choose Another Approach When Traffic Is Insufficient

At 100 eligible new visitors daily, the same test needs about 164 enrollment days, plus the final conversion window.

I would usually skip that experiment. Too much can change while a small business waits five months for an answer.

Choose Another Approach When Traffic Is Insufficient: Can Your Traffic Finish This A/B Test?; Same Target: 16,400 Assigned Visitors; 800 Eligible New Visitors Daily; 20.5 Enrollment Days; 100 Eligible New Visitors Daily; 164 Enrollment Days

Instead, consider whether you can:

  • Test a stronger change supported by clear customer evidence.
  • Test a relevant page with more eligible traffic.
  • Use interviews or usability checks to uncover problems worth fixing.

Recalculate the sample whenever the design changes.

Choose Another Approach When Traffic Is Insufficient: What To Do When A/B Test Traffic Is Too Low; Test A Stronger, Evidence-Backed Change; Consider A Relevant, Busier Page; Use Interviews Or Usability Checks; Use A Frequent Action Only If It

You can also measure a more frequent action, such as starting checkout, when that action answers the question you actually need to resolve. Continue tracking purchases, and describe the result accurately: more checkout starts establish more checkout starts.

Customer research can reveal confusion without a large sample. It does not establish that a later sales increase was caused by your edit.

4. Build the Variation and Verify the Setup

Choose a Suitable Testing Setup

Start by checking whether your existing website or selling platform has a suitable testing feature. I would pay for a separate tool only after confirming that the experiment is feasible and the decision is worth the cost.

Your setup needs to:

  • Randomly assign eligible visitors.
  • Serve the correct version and preserve that assignment.
  • Connect purchases to the assigned version.
  • Support your sample plan and statistical analysis.
  • Flag problems with the traffic split.

Analytics and experiment delivery have different jobs. One measures outcomes; the other assigns and serves versions. Google Analytics requires an integrated third-party testing tool to run and manage A/B tests, according to Google’s A/B-testing guidance.

If you already sell through WordPress and WooCommerce, assess tools that work with that checkout before rebuilding your sales process elsewhere. Include setup time and maintenance in the cost comparison. A cheap subscription can still come with an expensive weekend.

Build the Variation and Verify Tracking

Build B, then check both versions on the devices your customers use. Confirm that the preview is readable, purchase buttons work and the page loads properly.

For a first test, use a 50/50 random split. Keep returning visitors in their original group using a stable identifier. Reassigning them on every page view mixes the experiences you are trying to compare.

Build The Variation And Verify Tracking: Keep A/B Test Assignment Through Checkout; 1. Assign Once; Visitor Id; Variant B; 2. Record First Exposure; Experiment; Variant; First Exposure; 3. Preserve The Connection; 4. Join The Successful Order; Order

Record enough information to connect exposure and purchase:

  • Experiment and variant.
  • Visitor identifier.
  • First exposure time.
  • Successful purchase, order identifier and revenue.

Preserve that connection through checkout and payment redirects.

Build The Variation And Verify Tracking: Count A/B Test Purchasers Without Duplicates; Confirmation Refresh; Same Order: Count Once; Failed Payment; Not A Purchase; One Visitor, Two Successful Orders; Unique Purchasers: 1; Revenue Can Include Both

Complete a test purchase through both versions. Confirm that:

  • A successful order counts once.
  • Failed payments do not count as purchases.
  • Refreshing the confirmation page does not duplicate an order.
  • Returning visitors retain their version.
  • Caching does not accidentally serve the same version to everyone.

For the primary metric, one visitor who purchases twice is still one purchaser. Their additional order can contribute to revenue separately.

Apply your predefined exclusions for internal and known automated traffic. For a straightforward first experiment, I would also avoid another test changing the same buying journey.

5. Run the Test and Monitor Its Health

Launch A and B concurrently. Showing A this week and B next week leaves you comparing different periods as well as different pages.

Check assignment and purchase logging immediately after launch. Then monitor checkout faults, missing data and your predefined safety limits.

5. Run The Test And Monitor Its Health: Run A/B Test Versions At The Same Time; A; B; A First, B Later; Page Changes Mix With Timing Changes; Concurrent Random Assignment; Keep Versions And Measurement Rules Stable; Record Interruptions And Major

Also check for sample ratio mismatch. This means the observed group counts differ from the planned split by more than random variation reasonably explains.

A 50/50 plan does not require perfectly equal counts. Use the testing tool’s allocation check rather than judging the split by eye. An unexplained mismatch can signal missing visitors, faulty assignment or tracking problems, so investigate it before interpreting conversions. Microsoft’s guidance shows how these faults can reverse an apparent result.

5. Run The Test And Monitor Its Health: Check A/B Test Sample Ratio Mismatch; Planned Split: 50% A / 50% B; Exact Equality Is Not Required; Use The Tool’s Allocation Check; Is The Imbalance Beyond Plausible Random Variation?; Missing Visitors

Keep allocation, targeting, metric definitions and page versions stable. Record outages, promotions and major traffic changes so you can judge whether the conditions resemble normal use.

If an interruption affects one version differently or loses its purchase data, the comparison may be invalid. Do not quietly remove the awkward hours after seeing the result.

Monitor the test’s health throughout, but follow the planned performance endpoint. When enrollment closes, preserve existing participants’ assigned experiences through their remaining conversion windows.

6. Interpret the Result Before Choosing a Winner

Calculate Lift and Its Uncertainty

First confirm that tracking and allocation checks passed and that every participant received the full conversion window.

Then calculate each version’s purchase rate. For illustration, suppose A records 410 purchasers among 8,200 assigned visitors, and B records 492 among 8,200.

  • A: 410 ÷ 8,200 × 100 = 5%
  • B: 492 ÷ 8,200 × 100 = 6%

The absolute difference subtracts A’s rate from B’s:

6% − 5% = +1 percentage point

Calculate Lift And Its Uncertainty: Calculate A/B Test Lift Without Mixing Units; A: 410 Purchasers / 8,200 Visitors; 5% Purchase Conversion; B: 492 Purchasers / 8,200 Visitors; 6% Purchase Conversion; Absolute Difference; 6% − 5% = +1 Percentage

Relative lift compares that difference with A’s rate:

(6% − 5%) ÷ 5% × 100 = +20%

The observed lift still needs an uncertainty estimate.

The planned statistical comparison of the two purchase rates gives approximately p = 0.005. If the versions truly had equal purchase rates, a difference at least this large in either direction would occur in about 0.5% of tests under the method’s assumptions. The calculation uses a two-sided, pooled two-proportion z-test, following the large-sample method documented by NIST.

Calculate Lift And Its Uncertainty: Read An A/B Test Confidence Interval; Percentage-Point Increase; +1.70; +0.30; +1.00 Observed; +0.20 Business Threshold; 0: No Increase; Approximate 95% Confidence Interval; Two-Sided P ≈ 0.005; Compatible Effect

The estimated increase has a 95% confidence interval of approximately +0.30 to +1.70 percentage points. The calculation uses the normal-approximation Wald interval, one of the methods documented by Statsmodels.

These are independently calculated teaching results. For the guardrail illustration, also assume two assigned visitors in each group encountered a checkout error, below a predeclared limit of 0.1% of assigned visitors.

VariantAssigned VisitorsPurchasersConversion RateCheckout Errors
A: Existing page8,2004105%2 of 8,200 visitors (0.024%); below 0.1% limit
B: Sample preview8,2004926%2 of 8,200 visitors (0.024%); below 0.1% limit

The interval gives a range of effect sizes compatible with the data under this method’s assumptions. Here, it supports an increase, but the improvement could be meaningfully smaller or larger than the observed one percentage point.

The p-value does not tell you the probability that B is better or whether the improvement pays for itself. The American Statistical Association explains that statistical significance does not measure an effect’s size or practical importance.

Assess Business Value and Make the Decision

Now translate the result into money.

Assume each purchaser buys one $29 ebook. Multiply purchasers by the price, then divide that revenue by everyone assigned to the version.

MeasureAB
Gross revenue$11,890$14,268
Gross revenue per assigned visitor$1.45$1.74
Assess Business Value And Make The Decision: Turn A/B Test Purchases Into Revenue Per Visitor; One $29 Ebook Per Purchaser; A: Existing Page; 410 × $29 = $11,890; $11,890 ÷ 8,200 = $1.45 Per Visitor; B: Sample Preview; 492 × $29 = $14,268; $14,268 ÷

That is an observed increase of $0.29 per assigned visitor before refunds, fees and other costs.

For this simple product, revenue follows purchases because the price and quantity are fixed. In a shop with different basket values, a higher purchase rate might produce less revenue per visitor, so check both.

Our example clears the planned purchase threshold: even the lower confidence bound, +0.30 percentage points, exceeds the illustrative business threshold of +0.20. The checkout-error guardrail also passes. I would deploy B after confirming that the expected extra net revenue covers its costs.

Assess Business Value And Make The Decision: Four Decisions After An A/B Test; First Confirm Measurement Is Sound; Implement B; Evidence, Costs And Guardrails Support It; Retain A; Supported Decline Or Safety Breach; Record An Inconclusive Result

Use the same decision rules when the result is less cheerful:

  • Implement B: Measurement is sound, the planned evidence rule supports improvement, costs make sense and guardrails pass.
  • Retain A: B shows a supported decline or breaches a safety limit.
  • Record an Inconclusive Result: The interval includes outcomes that would lead you to different decisions. Keep A while considering a more informative test.
  • Deprioritize the Idea: The interval rules out a gain large enough to justify the work.

An interval spanning a meaningful loss and a useful gain is uncertainty. Calling it “no difference” hides the decision you still cannot make.

Do not repeatedly extend a completed fixed-sample test until significance appears. Likewise, an unexpected mobile-only win can suggest a follow-up test, but it needs its own support before becoming a deployment rule.

7. Apply the Result and Improve the Next Test

Deploy the supported version permanently, then verify checkout and measurement again. Keep a way to restore the previous page if deployment introduces a fault.

Finish the experiment record while the details are fresh. Save:

  • Setup: Hypothesis, versions, eligibility, allocation and conversion window.
  • Evidence: Dates, final sample, estimated effect and confidence interval.
  • Business Checks: Revenue, guardrails, costs and interruptions.
  • Decision: What you kept and what question remains.
7. Apply The Result And Improve The Next Test: Turn Each A/B Test Into Better Next Questions; Deploy And Verify; Recheck Checkout; Keep A Rollback Path; Save The Experiment Record; Setup; Evidence; Business Checks; Decision; Separate Outcome From

Keep the measured result separate from its explanation. Higher purchases support keeping the preview. They do not prove exactly why visitors responded. The preview might have clarified the contents, demonstrated quality or done both.

A losing or inconclusive test should change your next question. Revisit the evidence of friction before producing another slightly different preview.

Use the retained experience as your next control and update the baseline. Let useful questions and available traffic set the testing cadence. “One test every week” sounds organized until each test needs a month of visitors.

What Next?

Choose one page and write down its primary conversion, eligible visitors and baseline rate. Check the sample requirement before building a challenger.

Use the social buttons to share this guide when a discussion about website changes needs a clearer way to choose what stays.

Which buying obstacle has enough evidence to deserve your next test? Share your thinking in the comments, along with any other questions.

Share this post with your friends & followers:
Abhishek is a data scientist by day & an online entrepreneur by night. He is known for his ability to simplify complex concepts and make them accessible to a wider audience. He started Passive Book to share his insights and experiences on how to effectively build an online business, which has quickly become a go-to resource for anyone looking to bootstrap an online business from scratch.

Leave a Comment

Build an Online Business 
Without Quitting Your Job

Join 10,000+ solopreneurs building six-figure online businesses from scratch with limited time & tight budgets using smart systems & AI automations.
Optin Form - Main

Free Bonus: Get access to our AI workflows & cheat sheets
Person sitting with laptop in home office environment with launching rocket, coffee mug, sleeping dog, bookshelf, and house plant illustrating work-from-home online business lifestyle. Decorative image.
Thank you for sharing

Follow Us On: