Sub topic 14
Sending the winner to the rest of the list
This chapter assumes you can already run a two-proportion z-test, size a test before sending, and avoid peeking. It covers the last step: using the result to send the winning variant to everyone else.
How test-and-send-winner works
A test-and-send-winner campaign splits your list into two parts:
- Test group: a fraction of the list, for example 20%, divided evenly among the variants.
- Holdout: everyone else, who receive nothing until the test ends.
When the test ends, you send the winning variant to the holdout. The holdout is the only reason this setup pays off. The test group helps you learn, and the holdout gets the better email.
Size the test group from the sample size
Use the sample-size calculation from the earlier chapter to set the test group. If you need 20,000 recipients per variant and have 100,000 on the list, two variants take 40,000 recipients. That leaves a 60,000 holdout. If the required test group is most of your list, the rollout gains little. In that case, run the test as a plain experiment and use what you learn in later campaigns.
Fix the rule before you send
Decide three things before launch:
- The primary metric. Use clicks, not opens. Mail Privacy Protection inflates opens, so an automatic winner chosen by open rate can reward a variant for being loaded by Apple's proxy.
- The wait window. Choose it in advance, for example 24 to 48 hours. A short window of 2 to 4 hours favors people who check email immediately, who may not represent the rest of the list.
- The fallback. If the test shows no clear difference, send your default variant. A tie is a valid result.
A decision rule in code
This function applies a significance threshold and a minimum lift. The lift requirement stops a statistically significant but trivial difference from overriding your default.
from math import sqrt
from statistics import NormalDist
def choose_rollout(clicks_a, sent_a, clicks_b, sent_b,
alpha=0.05, min_lift=0.002, default="A"):
p_a = clicks_a / sent_a
p_b = clicks_b / sent_b
pooled = (clicks_a + clicks_b) / (sent_a + sent_b)
se = sqrt(pooled * (1 - pooled) * (1 / sent_a + 1 / sent_b))
z = (p_b - p_a) / se
p_value = 2 * (1 - NormalDist().cdf(abs(z)))
diff = p_b - p_a
if p_value < alpha and abs(diff) >= min_lift:
winner = "B" if diff > 0 else "A"
return winner, f"significant (p={p_value:.4f}, lift={diff:.4f})"
return default, f"no clear winner (p={p_value:.4f}, lift={diff:.4f})"
print(choose_rollout(400, 20000, 470, 20000))With these counts, B wins: the lift is 0.0035 and the p-value is about 0.016.
Limits of the rollout
- Expect a smaller gain. The winner was picked because it looked best, so its measured lift is probably a little too high. Plan for a smaller gain on the holdout.
- Send-time tests fit poorly. The holdout cannot get "the winning send time" unless you send it later than the test group. That adds day-of-week and freshness differences. Treat the result as guidance for future campaigns.
- Check the holdout's results. If the winner performs far below the test, investigate before assuming the test was right.
Exercise
Your list has 50,000 contacts. The sample-size calculation says each of two variants needs 30,000 recipients. Should you run a test-and-send-winner campaign? What would you do instead?
Show answer
No. The two variants need 60,000 recipients, which exceeds the list, so no holdout would remain and the test cannot reach its planned power. Either accept a larger minimum detectable effect, which lowers the required sample, or send the two variants as a full-list split and apply the result to future campaigns.
Exercise
A test ends with p = 0.03 but a lift of only 0.0004 in click rate. Your minimum lift is 0.002. Which variant do you send to the holdout, and why?
Show answer
The default variant. The result is statistically significant, but the lift is below the minimum worth acting on, so the rule treats it as no clear winner.