Sub topic 2
Writing a Hypothesis and Changing One Thing at a Time
This chapter assumes you know basic email marketing terms (list, campaign, open rate, click rate) and are comfortable with percentages. You do not need statistics yet. The Python snippet is short and optional.
A test without a hypothesis is a comparison with no question attached. You send two emails, one wins, and you cannot say why or whether it will happen again. This chapter covers two habits that prevent that: writing the hypothesis before you send, and making sure the two variants differ in exactly one respect.
Why write the hypothesis first
A hypothesis is a specific, falsifiable claim about what a change will do to a measurable outcome. Writing it before the send protects you in three ways:
- It fixes the success criterion. If you pick the metric after seeing results, you will tend to pick whichever one looks best. With enough metrics, one of them will look good by chance.
- It forces a reason. "Because" statements tell you what to try next if the test fails. A test with no mechanism teaches nothing when it loses.
- It sets the size of the effect worth caring about. Later chapters use this number to calculate sample size. If you cannot name a lift you would act on, the test is not ready.
The parts of a testable hypothesis
| Part | Question it answers | Example |
|---|---|---|
| Change | What is different in variant B? | Subject includes the recipient's first name |
| Population | Who is in the test? | Active subscribers on the weekly newsletter list |
| Metric | What number decides it? | Click rate (unique clicks divided by emails sent) |
| Direction and size | How much, and which way? | From 2.0% to at least 2.5% |
| Reason | Why do you expect that? | Personal subjects look less like bulk mail and get more attention |
A full statement reads: "For active newsletter subscribers, adding the first name to the subject line (B) will raise the click rate from 2.0% to at least 2.5% compared with the current subject (A), because personalization signals a one-to-one message."
Behind this sits the null hypothesis: the two subject lines have the same true click rate and any observed gap is chance. Your significance test in a later chapter asks how surprising the data would be if the null hypothesis were true. You never prove your hypothesis. You collect evidence against the null.
The click rate here is provisional. The next chapter explains how to choose a primary metric and why open rate is a poor default.
A send-time hypothesis
Send-time tests need the same structure, and the change is easier to get wrong:
"For subscribers on the weekly newsletter list, sending at 08:00 in each recipient's local time (B) instead of 14:00 in each recipient's local time (A) will raise the click rate by at least 0.4 percentage points, because people check email before work more than mid-afternoon."
Notice that the time is expressed in recipient local time. If A went out at 14:00 UTC and B at 08:00 UTC, some recipients would get B at 3 a.m. The test would then mix "morning versus afternoon" with "who happens to live where". The chapter on send-time design and confounders handles this in detail. For now, the point is that the hypothesis must name the exact variable and how it is held fixed.
What "one thing" means
The rule is that variant A and variant B differ in one controlled variable, and everything else is identical. The reason is attribution. If B changes the subject and the send time and the sender name, a win cannot be credited to any of them.
Hidden differences are the usual way this rule breaks:
- Preheader text. Many clients show the preheader next to the subject. If it is auto-pulled from the first line of the body, a new subject might leave it unchanged, but a new body would not.
- From name and address. Changing "Dana at Acme" to "Acme Team" is a separate variable.
- Send time. Variants queued at different moments differ in timing even if you did not intend it.
- Body, links, and images. Any edit to content after the click-through decision is made changes what clicks mean.
- Audience. Hand-built lists for A and B, such as "older subscribers get A", add a difference that has nothing to do with the email.
- Personalization tokens. A first-name token that falls back to blank for some recipients changes the subject for them in a second way.
"One variable" does not mean "one word". A subject line test can compare two different wordings, as long as they differ along a single dimension you can name, such as a question versus a statement, or a number versus no number. A treatment that is a bundle (a longer subject, with an emoji, in a question form) is allowed only if you accept that you are testing the bundle. You then learn whether the bundle works, not which part made it work.
Enforcing the rule in code
Reviewing by eye misses things. If your campaign is described as structured data, a few lines can compare variants and refuse to proceed when more than one field differs.
from dataclasses import dataclass, asdict
@dataclass(frozen=True)
class Variant:
subject: str
preheader: str
from_name: str
send_time_local: str
body_id: str
def changed_fields(a, b):
da, db = asdict(a), asdict(b)
return [name for name in da if da[name] != db[name]]
def require_single_change(a, b):
diff = changed_fields(a, b)
if len(diff) != 1:
raise ValueError(f"Variants differ in {len(diff)} fields: {diff}")
return diff[0]
control = Variant("Your weekly digest", "Five reads for Friday", "Acme Team", "14:00", "digest-47")
treatment = Variant("Dana, your weekly digest", "Five reads for Friday", "Acme Team", "14:00", "digest-47")
bad_treatment = Variant("Dana, your weekly digest", "Five reads for Friday", "Acme Team", "08:00", "digest-47")
print(require_single_change(control, treatment))
try:
require_single_change(control, bad_treatment)
except ValueError as err:
print(err)This prints subject, then Variants differ in 2 fields: ['subject', 'send_time_local']. The check cannot see everything, since it only knows the fields you list. Add a field for any setting your email platform exposes that could differ between variants.
Common errors
- A vague claim. "The new subject will perform better" has no metric, size, or reason. You cannot fail it, so it cannot teach you anything.
- Several metrics, no primary. If you track opens, clicks, and unsubscribes and then declare victory on whichever moved, your false-positive rate is much higher than you think. Name one primary metric. Treat the others as guardrails or context.
- Testing for its own sake. If you would ship variant B regardless of the result, for example because legal requires it, there is nothing to decide. Do not run a test.
- Changing the variant mid-test. Fixing a typo in B after half the sends makes B two different treatments. Fix and restart, or accept the typo.
- Too small a change. A hypothesis of a 0.05 percentage point lift may be true but needs a huge list to detect. Pick a difference big enough to matter and to be detected.
Edge cases
Interacting variables. Sometimes you suspect two things only work together, such as a question subject that works only at a morning send time. A factorial design tests all combinations (2 subjects times 2 times gives 4 cells). It can separate the effects, but each cell needs the full sample size, so you need roughly double the recipients of a two-variant test for the same power per comparison. On small lists, run one test, then the other.
Directional versus two-sided claims. If you write "B will be higher", you are tempted to ignore a result where B is clearly lower. Decide in advance that the test is two-sided: you care about a difference in either direction. This is also the default in the z-test you will use later.
Exploratory versus confirmatory tests. A test with no prior expectation is exploratory. It can generate a hypothesis, but a win is a lead, not a conclusion. Rerun it as a confirmatory test with a written hypothesis before changing your standard practice.
Exercise
A teammate proposes this test: "Variant B uses a shorter subject line, an emoji, and is sent on Tuesday instead of Thursday. We'll see which gets more engagement." Name three problems and rewrite it as a single-variable hypothesis for a subject line test.
Show answer
Problems: (1) three variables change at once (length, emoji, day), so a win cannot be attributed to any of them; (2) "engagement" is not a single named metric, and there is no target size; (3) there is no stated reason, so a loss teaches nothing. Rewrite, for example: "For active newsletter subscribers, a subject line under 40 characters (B) instead of the current 65-character subject (A), sent to both at the same Thursday time, will raise the click rate from 2.0% to at least 2.5%, because shorter subjects are not truncated on mobile." The emoji and the day are held fixed and not tested.
Exercise
You run the check from this chapter and require_single_change reports that subject and preheader differ, because the preheader auto-fills from the subject. What are your two options, and what does each cost?
Show answer
Option one: set the preheader explicitly to the same fixed text in both variants, so only the subject differs. This keeps the test clean and costs a little setup. Option two: accept that the treatment is "subject plus its auto preheader" and state that in the hypothesis. This is faster, but you learn about the bundle, not the subject alone.