Sub topic 9
How much traffic is enough, and how to read a conversion rate
This chapter assumes you can read short Python snippets and know what a conversion rate is. It also assumes you have a fake door experiment plan with a metric, a success threshold and a failure threshold, as in the earlier chapters. Here you answer two questions. How many visitors do you need before the result means anything? And what does a click rate of, say, 4.5% actually tell you?
Why a rate needs a range
A conversion rate from a test is an estimate. If 18 of 400 unique visitors click your fake door button, the observed rate is 4.5%. That is the rate for those 400 people in those 14 days. The rate you would see if you ran the test forever on the same audience is the true rate. It is unknown, and the observed rate is only a noisy measurement of it.
The noise comes from sampling. Even if every visitor has exactly a 4% chance of clicking, one batch of 400 might produce 13 clicks and another 20. Small samples swing a lot, and large samples swing less.
A confidence interval expresses this. A 95% interval is a range computed so that, across many repeated experiments, about 95% of such ranges contain the true rate. In practice, read it as the set of true rates your data cannot rule out.
What drives the width of the interval
Two things set the width: the number of visitors and the rate itself. The simple normal approximation for the half-width of a 95% interval is:
1.96 × sqrt(p × (1 − p) / n)
where p is the rate and n is the number of unique visitors. Notice that n is under a square root. To halve the width, you need four times the traffic.
The table below uses the formula at a true rate of 4%. The half-widths are approximate.
| Unique visitors | Approximate half-width | Plausible range around 4% |
|---|---|---|
| 100 | ±3.8 points | about 0.2% to 7.8% |
| 400 | ±1.9 points | about 2.1% to 5.9% |
| 1,600 | ±1.0 points | about 3.0% to 5.0% |
| 6,400 | ±0.5 points | about 3.5% to 4.5% |
At 100 visitors the interval is nearly as wide as the whole range of rates you might care about. A result from 100 visitors can support a rough hunch but not a go or no-go decision.
Why not use the simple formula alone
The normal approximation has two known problems at the rates fake door tests usually see, which are low single digits. It can produce a lower bound below zero. It also behaves badly when there are very few clicks. The Wilson interval fixes both and needs no special library, so use it by default.
import math
def wilson_interval(successes, n, z=1.96):
"""Approximate 95% confidence interval for a conversion rate."""
if n == 0:
return (0.0, 1.0)
p = successes / n
denom = 1 + z**2 / n
centre = (p + z**2 / (2 * n)) / denom
margin = z * math.sqrt(p * (1 - p) / n + z**2 / (4 * n**2)) / denom
return (centre - margin, centre + margin)
# 18 clicks from 400 unique visitors is 4.5%.
low, high = wilson_interval(18, 400)
print(f"{18/400:.1%} observed, 95% interval {low:.1%} to {high:.1%}")
# Prints about: 4.5% observed, 95% interval 2.9% to 7.0%Compare this interval with the plan from the experiment file: success at 4% and failure at 2%. The observed 4.5% is above the success threshold. The interval runs from 2.9% to 7.0%, so it contains 4%. The data do not rule out a true rate below the success line. The lower bound of 2.9% is above the 2% failure line, so you can fairly say the idea is probably not a failure.
An honest summary is: "Likely better than failure, success not yet confirmed." The decision rule in your plan says what to do with a point estimate at or above success. If you wrote the rule in terms of the observed rate, follow it. Note in your write-up that the interval was wide. If the cost of being wrong is high, extend the test.
Choosing the number of visitors before you launch
Choose the sample size up front from the precision you need. A practical rule is to pick a target half-width, then solve for n:
n = z² × p × (1 − p) / margin²
The p is the rate you expect, and margin is the half-width you can tolerate. For a threshold-based decision, a good target margin is about the gap between your thresholds, or half of it. If the thresholds are 2% and 4%, a margin of 2 points is the loosest target that still lets a 4% result sit clear of the failure line.
import math
def min_visitors(expected_rate, margin, z=1.96):
"""Visitors needed so a 95% interval has about the given half-width."""
return math.ceil(z**2 * expected_rate * (1 - expected_rate) / margin**2)
print(min_visitors(0.04, 0.02)) # 369
print(min_visitors(0.04, 0.01)) # 1476
print(min_visitors(0.02, 0.01)) # 753The first line shows where the 400-visitor minimum in the experiment plan comes from: about 369 visitors, rounded up to a clean figure. The second shows that tightening the margin from 2 points to 1 costs about four times as much traffic. The third shows that lower rates need more visitors for the same absolute margin.
This is a planning estimate, not a guarantee. It uses the normal approximation and assumes your expected rate is close to the truth.
Turning visitors into days
Convert the sample size into time using your real traffic:
- Count unique visitors per day to the page that holds the button. Use unique visitors, matching the metric, not sessions or page views.
- Divide the required visitors by that daily count.
- Round up to full weeks. Behavior differs between weekdays and weekends, so a test that covers whole weeks is easier to trust.
If the page gets 50 unique visitors a day, 400 visitors takes 8 days, so you would run 14. If it gets 10 a day, you would need 40 days or more. At that point, the test is too slow, and you should consider buying traffic, using a higher-traffic page, or choosing a different experiment.
Zero and near-zero results
Sometimes nobody clicks. Zero clicks from 400 visitors does not mean the true rate is zero. A useful shortcut called the rule of three says that if you see zero events in n trials, the 95% upper bound on the true rate is about 3 / n. For 400 visitors that is 0.75%.
This is often useful. If your failure threshold is 2% and you saw zero clicks in 400 visitors, the upper bound of about 0.75% sits well below it. You have strong evidence that demand at this page and with this wording is low. It says nothing about other pages, audiences or wordings.
Reading the result against your thresholds
Place the interval on a number line with your two thresholds, and note which of three cases applies.
| Where the interval sits | What you can say | Typical action |
|---|---|---|
| Entirely at or above the success threshold | Demand at this level is supported | Proceed to the next experiment |
| Entirely at or below the failure threshold | Demand is clearly too low here | Drop or rethink |
| Entirely between the thresholds | A middling result | Revise the copy or audience and retest |
| Spans one or more thresholds | Not enough data to say | Collect more data, up to the plan |
The last row is the most common result from small tests. The correct response to an inconclusive result is to collect the sample you planned. Do not declare a winner from the point estimate.
Mistakes that break the numbers
Stopping when the number looks good
If you check the result every day and stop as soon as it crosses the success line, you will often stop on a lucky streak. This is called peeking. The conversion rate wanders early on, and each look is another chance to see a fluke. Fix the sample size or the end date in advance, and read the final result once. If you must monitor, watch for technical problems such as a broken event, not for success.
Counting people twice
If one person clicks three times, they should count once. This is why the metric in the plan divides unique clickers by unique viewers. A rate computed from raw click events inflates the numerator. Likewise, if people visit on two devices or after clearing cookies, you may overcount viewers. This usually makes the rate look lower than it is, so treat it as noise you accept and note it.
Mixing populations
Traffic from a newsletter to existing fans, traffic from search ads, and traffic from a partner site behave differently. Pooling them gives a rate for a blend that you may never see again. Report each source separately if you can, and make sure each source has enough visitors on its own. Splitting data after the fact multiplies the noise, since each slice has a smaller n.
Testing several versions at once
If you test five wordings and pick the best, the best one is partly luck. The more variants you compare, the more likely one looks good by chance. Either decide on one main comparison in advance, or treat the winner as a candidate for a confirmation run with fresh traffic.
A short checklist
Before launch:
- Write the expected rate, the thresholds and the margin you can tolerate.
- Compute the minimum visitors and convert it to days using real traffic.
- Fix the end date or the sample size.
After the test:
- Compute the rate from unique visitors who saw the button.
- Compute the Wilson interval.
- Compare the interval to both thresholds and apply the decision rule from the plan.
- Report the rate, the interval and the sample size together, never the rate alone.
Exercise
A fake door test with the thresholds from this chapter (success 4%, failure 2%) ends with 8 clicks from 200 unique visitors. The observed rate is 4.0%, and the 95% Wilson interval is about 2.0% to 7.7%. What do you conclude, and what do you do next?
Show answer
The observed rate sits exactly on the success threshold, but the interval spans both thresholds. The lower bound is right at the failure line and the upper bound is well above the success line. The result is inconclusive. The planned minimum was 400 visitors, and this test has only half of that. Continue collecting until you reach the planned sample, then recompute the interval and apply the decision rule. Do not declare success from the 4.0% point estimate.
Exercise
Your page gets 25 unique visitors per day. You expect a 3% click rate and want a 95% interval with a half-width of about 1.5 points. Use the sample size formula to estimate the visitors needed and the number of days. Is the test practical?
Show answer
n = 1.96² × 0.03 × 0.97 / 0.015² = 3.8416 × 0.0291 / 0.000225, which is about 497 visitors. At 25 visitors a day that takes about 20 days, so roughly three weeks when rounded up to whole weeks. That is practical for a single test. If you needed a margin of 0.75 points instead, you would need about four times as many visitors, around 2,000, or about 80 days. At that point you should look for more traffic or a different experiment.