Sub topic 3
Choosing a primary metric
This chapter assumes you know the basic email terms (list, campaign, open rate, click rate) and can work with percentages. The Python snippets are short, and you can skip them if you prefer. By the end you should be able to pick one primary metric for a subject line or send-time test, say what it is measured against, and name the guardrail metrics that sit beside it.
Why a test needs exactly one primary metric
An email campaign produces many numbers: opens, clicks, purchases, unsubscribes, replies. If you compare two variants on all of them, some comparisons will favor A and others B. If you then pick whichever metric shows a winner, you are fishing, and the chance of a false winner rises with every metric you check.
The fix is to choose one primary metric before the send. It is the single number that decides the test. Everything else is either a secondary metric (useful context, not a decision rule) or a guardrail metric (something that must not get worse).
Write the metric down together with the hypothesis. For example: "Variant B's subject line will raise the unique click rate per delivered email, measured over 72 hours."
The email funnel and where each metric sits
Each recipient moves through a funnel, and each stage supports a different metric.
| Stage | Metric | Typical denominator | Main weakness |
|---|---|---|---|
| Delivered | Delivery rate | Sent | Reflects list quality, not the variant |
| Opened | Open rate | Delivered | Inflated or distorted by privacy features and image blocking |
| Clicked | Click rate (CTR) | Delivered | Low base rate, so tests need more recipients |
| Clicked, given opened | Click-to-open rate (CTOR) | Opened | Denominator depends on the variant |
| Converted | Conversion rate | Delivered | Very low base rate, long delay |
| Revenue | Revenue per recipient | Delivered | Heavy-tailed, so a z-test on proportions does not apply |
| Unsubscribed or complained | Unsubscribe rate, complaint rate | Delivered | Rare, but costly |
The chapter on open-rate caveats covers why opens are unreliable. Here the point is narrower: the metric you choose must still mean the same thing in both variants.
Four rules for a good primary metric
1. It must match the hypothesis
A subject line is meant to get people to engage. A send-time change is meant to get people to act when they are paying attention. If your goal is traffic or sales, an upstream metric such as opens only proxies that goal. A proxy can move while the real outcome stays flat, or move the other way. A clickbait subject line can raise opens and lower clicks.
Choose the metric closest to the outcome you care about that still has enough events to measure.
2. It must be measured on everyone you randomized
Randomization puts recipients into variants. The denominator of your metric should be the full set of recipients assigned to each variant, usually everyone delivered to. It should not be a subset that depends on what the variant did.
Click-to-open rate breaks this rule. Suppose subject line B attracts more casual openers. They click less often, so B's CTOR falls even though B produced more total clicks. The denominator (opens) is itself affected by the subject line, so the two groups being compared are no longer comparable. Clicks per delivered email avoids this problem, because the denominator is fixed by the assignment.
3. It should be one yes-or-no outcome per recipient
For the z-test used later in this tutorial, each recipient either did or did not do the thing. Count unique clicks (did this person click at least once?) rather than total clicks. One enthusiastic recipient who clicks nine times should count once. Total clicks violate the independence assumption behind the test and let a few people dominate the result.
4. It must have enough events to detect a realistic change
A metric is only usable if the list is big enough to detect the change you expect. The sample size depends heavily on the base rate. Using the normal-approximation formula from the sample-size chapter, with 5% significance and 80% power:
- Click rate from 2.0% to 2.5% needs about 13,800 recipients per variant.
- Conversion rate from 0.20% to 0.25% (the same relative lift) needs about 141,000 per variant, roughly ten times more.
If your list is 40,000 people, a conversion-rate test cannot give a clear answer. Click rate can. Choosing a metric that is nearer the top of the funnel is a legitimate trade-off, as long as you accept that it is a proxy and check it against the downstream outcome later.
Computing the metric correctly
The code below computes unique clicks per assigned recipient. It starts from the assignment table, not from the click log, so recipients who never clicked still count in the denominator. A common bug is to build the denominator from the event log, which silently drops everyone with no events.
from collections import defaultdict
def click_rate_by_variant(assignments, clicked_user_ids):
"""assignments: dict of user_id -> variant for every delivered recipient.
clicked_user_ids: iterable of user ids, possibly with repeats."""
clicked = set(clicked_user_ids) # unique clickers
sent = defaultdict(int)
hits = defaultdict(int)
for user, variant in assignments.items():
sent[variant] += 1
if user in clicked:
hits[variant] += 1
return {v: (hits[v], sent[v], hits[v] / sent[v]) for v in sent}
assignments = {"u1": "A", "u2": "A", "u3": "A", "u4": "B", "u5": "B", "u6": "B"}
clicks = ["u1", "u1", "u4", "u5"] # u1 clicked twice but counts once
for variant, (n_click, n_sent, rate) in sorted(click_rate_by_variant(assignments, clicks).items()):
print(f"{variant}: {n_click}/{n_sent} = {rate:.3f}")Variant A shows 1 of 3 and variant B shows 2 of 3. Counting u1 twice would have given A an inflated click count.
Choosing the window
Every metric needs a measurement window: how long after sending you count events. Fix it in advance and apply it to both variants.
- For subject line tests sent at the same moment, a window of 24 to 72 hours usually captures most clicks.
- For send-time tests, measure from each variant's own send time, using the same window length. If variant A goes out at 08:00 and variant B at 20:00, "clicks by noon the next day" gives A 28 hours and B 16 hours. Use a fixed number of hours after each send, and close the data pull only when the later variant's window has finished.
Guardrail metrics
A variant can win on the primary metric while harming something else. Add guardrails: metrics where you only test for harm.
- Unsubscribe rate. An aggressive subject line may lift clicks and also cause more people to leave the list.
- Spam complaint rate. Complaints damage sender reputation, which affects every future campaign.
- Delivery or bounce rate. This mostly checks that the two variants were sent the same way.
Decide the guardrail thresholds beforehand, for example "reject a winner if its unsubscribe rate is more than 0.1 percentage points higher." Guardrails are rare events, so you will often lack the power to prove harm. Treat a worrying trend as a reason to look more closely, not as a formal test.
How the choice flows
Common errors
- Choosing the metric after seeing the data. Whatever looks best gets promoted to "primary." Record the choice before the send.
- Using CTOR as the primary metric. The denominator depends on the variant, as described above.
- Counting total clicks. Use unique clickers.
- Different windows per variant. This is common in send-time tests.
- Building the denominator from events. Always start from the list of assigned recipients.
- Reporting several "primary" metrics. If you must track more than one, you have a multiple-comparison problem, which a later chapter handles.
- Optimizing a proxy blindly. Opens or clicks that never turn into value are not a win. Spot-check the downstream outcome when you can.
Exercise
You test two subject lines on 30,000 delivered recipients (15,000 each). Variant B gets more opens, but its click-to-open rate is lower than A's. A colleague proposes declaring A the winner on CTOR. Which primary metric would you choose instead, what is its denominator, and why is CTOR a poor choice here?
Show answer
Use unique clicks per delivered recipient, with the 15,000 assigned recipients in each variant as the denominator, measured over the same fixed window (for example 72 hours). CTOR divides by opens, and opens are themselves changed by the subject line. If B attracts more casual openers, its CTOR falls even if B produces more clicks overall, so the two groups are no longer comparable. Clicks per delivered email uses a denominator set by random assignment, so it compares like with like. Unsubscribe and complaint rates would serve as guardrails.