Sub topic 12
Testing whether segmentation works
Segmentation takes effort to build and maintain. This chapter covers how to tell whether it improved your results. It assumes you have read the earlier chapters and can write segment rules, including time windows. It also assumes you know campaign terms such as open rate, click rate, and conversion. The optional SQL examples use PostgreSQL.
Why a good-looking segment is not evidence
A segmented campaign often shows a higher click rate than a broadcast to the whole list. That alone proves little. Segments are usually built from people who already clicked, bought, or signed up recently. These people are more likely to respond to anything you send them.
Suppose you send a running-shoe offer to subscribers who clicked running content twice in 60 days. If 6% of them click, and the whole list clicks at 2%, you have not shown that segmentation worked. You have shown that engaged people click more. The result is the same whether or not the message was tailored.
To measure the effect of segmentation, you need to compare the segmented treatment against what would have happened without it, for the same kind of people. The standard tool for this is a holdout group.
Choose a question first
Before you send, write down the question the test answers. Different questions need different comparisons.
| Question | Compare | Primary metric |
|---|---|---|
| Does a targeted message beat no message? | Segment members who get the message vs. a holdout of the same segment who get nothing | Conversion or revenue per subscriber |
| Does a targeted message beat a generic one? | Segment members who get the tailored message vs. a random half who get the generic message | Click rate or conversion rate |
| Does the segmented approach beat broadcasting? | Whole-list strategy A (segmented sends) vs. whole-list strategy B (one broadcast) | Total revenue or conversions per subscriber over the test period |
The first question measures whether the message adds value. The second measures whether the tailoring adds value. The third measures whether the whole segmentation programme adds value. Most teams need the second one.
Pick one primary metric before you look at results. If you check five metrics afterwards and report the best one, you will often find an apparent win that is only chance.
Holdouts and control groups
A holdout group is a random slice of an eligible audience that does not receive the treatment. A control group is a random slice that receives the baseline version, such as the generic message. Both exist to give you a fair comparison.
The key word is random. Do not build the control by picking subscribers who seem less engaged, or by taking the first rows of a list sorted by signup date. Those choices introduce the same bias you are trying to remove.
Assigning subscribers randomly and stably
Assign each eligible subscriber to a group once, and keep the assignment for the length of the test. A hash of the subscriber ID gives a stable, repeatable split. This SQL puts about 10% of eligible subscribers in a holdout.
-- PostgreSQL: assign active customers interested in running to test groups
WITH eligible AS (
SELECT id
FROM subscribers
WHERE status = 'subscribed'
AND last_purchase_at >= now() - interval '90 days'
)
SELECT id,
CASE
WHEN abs(hashtext(id::text || 'running-offer-2026-11')) % 100 < 10 THEN 'holdout'
ELSE 'treatment'
END AS test_group
FROM eligible;The string 'running-offer-2026-11' is a salt. Changing the salt for each test gives each test an independent split. Without it, the same people would always land in the holdout, and they would never receive your best offers.
The hashtext function is specific to PostgreSQL. In other databases, use an equivalent hash function or let your email platform's split feature do the assignment. The principle is the same: the assignment depends on nothing except the subscriber and the salt.
Create the test groups after you have defined the eligible audience, and only once. If you rebuild a dynamic segment during the test, people can enter and leave, and a person who joins the segment mid-test has no group. Store the assignments in a table or as a static segment so that the groups stay fixed.
Choosing a holdout size
A larger holdout gives you a more reliable comparison and costs more missed messages. A smaller holdout is cheap but noisy. A practical range is 5% to 20% of the eligible audience. Use the larger end when the segment is small or the response rate is low.
Check the numbers before you commit. If your segment has 2,000 people and a 10% holdout leaves 200, a conversion rate of 2% means only about 4 conversions in the holdout. A difference of two conversions would swing the result by a full percentage point, which is random noise. In that case, either enlarge the holdout, extend the test, or accept that the test cannot detect small effects.
Measuring the right outcome
Opens and clicks are easy to measure but are weak evidence of value. The earlier chapter on engagement signals explained why. Mail privacy features can trigger automatic opens, and link scanners can trigger clicks. Prefer outcomes that happen after the email, such as purchases, signups, or reactivations.
Use the conversion window you set before the test. For a promotional email, 7 days is common. For a lifecycle message such as a win-back, a longer window may fit. Apply the same window to every group, and do not extend it for the group that is losing.
Count the outcome per person assigned, not per person who opened. This is called an intent-to-treat comparison. If you only count openers in the treatment group, you will compare engaged people against the entire holdout, and the result will be biased in favour of the treatment.
Computing results
This query compares conversion between groups. It assumes a test_assignments table with subscriber_id, test_group, and assigned_at, and an orders table with subscriber_id, placed_at, and total.
-- PostgreSQL: conversion and revenue per assigned subscriber, by group
SELECT
a.test_group,
COUNT(*) AS subscribers,
COUNT(DISTINCT o.subscriber_id) AS converters,
ROUND(100.0 * COUNT(DISTINCT o.subscriber_id) / COUNT(*), 2) AS conversion_pct,
ROUND(COALESCE(SUM(o.total), 0) / COUNT(*), 2) AS revenue_per_subscriber
FROM test_assignments a
LEFT JOIN orders o
ON o.subscriber_id = a.subscriber_id
AND o.placed_at >= a.assigned_at
AND o.placed_at < a.assigned_at + interval '7 days'
GROUP BY a.test_group;The join happens from assignments to orders, so everyone assigned appears in the denominator. Subscribers with no orders count as zero. Note that COUNT(*) counts rows after the join, so a subscriber with two orders appears twice. This inflates the subscribers count and the revenue-per-subscriber denominator. To avoid this, first aggregate orders to one row per subscriber in a subquery, then join.
The corrected form looks like this.
-- PostgreSQL: one row per subscriber before the join, so counts stay correct
WITH per_subscriber AS (
SELECT
a.subscriber_id,
a.test_group,
COUNT(o.subscriber_id) AS order_count,
COALESCE(SUM(o.total), 0) AS revenue
FROM test_assignments a
LEFT JOIN orders o
ON o.subscriber_id = a.subscriber_id
AND o.placed_at >= a.assigned_at
AND o.placed_at < a.assigned_at + interval '7 days'
GROUP BY a.subscriber_id, a.test_group
)
SELECT
test_group,
COUNT(*) AS subscribers,
COUNT(*) FILTER (WHERE order_count > 0) AS converters,
ROUND(100.0 * COUNT(*) FILTER (WHERE order_count > 0) / COUNT(*), 2) AS conversion_pct,
ROUND(AVG(revenue), 2) AS revenue_per_subscriber
FROM per_subscriber
GROUP BY test_group;Use this second version for real reporting.
Reading the difference
Suppose the results are:
| Group | Subscribers | Converters | Conversion |
|---|---|---|---|
| Treatment | 9,000 | 360 | 4.0% |
| Holdout | 1,000 | 30 | 3.0% |
The treatment converted at 4.0% and the holdout at 3.0%. The absolute lift is 1.0 percentage point. The relative lift is one third, or 33%. Report both, but lead with the absolute number, because a relative lift on a small base sounds larger than it is.
The holdout converted at 3.0% without any message. That is your baseline. Only the extra 1.0 point is attributable to the email. If you had credited the full 4.0% to the campaign, you would have overstated its effect by a factor of four.
Is the difference real?
With 1,000 people in the holdout and 30 converters, chance matters. A significance test for two proportions tells you how often a gap this size would appear if the email had no effect. Many email platforms and spreadsheet tools provide one. A common threshold is a p-value below 0.05, which means that such a gap would occur less than 5% of the time by chance alone.
Treat this as a guide, not a verdict. A few habits keep you honest:
- Decide the sample size and the end date before the test, and do not stop early because the numbers look good on day two.
- Report the size of the difference, not only whether it passed a threshold.
- Run important tests more than once. A single result can be a fluke.
- If you test many segments at once, some will look significant by chance. Expect roughly one in twenty to cross the 0.05 line with no real effect.
Common errors
These mistakes appear again and again in segmentation tests.
- Comparing a segment to the whole list. The segment was chosen for being responsive, so the comparison is biased. Compare within the same segment.
- Letting the holdout receive other campaigns. If holdout members get your regular newsletter and promotions, the difference is smaller than the true effect of the targeted email, or the groups drift apart. Decide up front whether the holdout is excluded from one campaign or from all marketing for the period. State which one you measured.
- Building groups after the send. If you pick the control after seeing who opened, the test is invalid.
- Counting only openers. This removes the people the email failed to reach and makes every email look better than it is.
- Overlapping segments. A subscriber who belongs to two segments may receive two messages. The overlap contaminates both results. Check overlap, as covered in the previous chapter, before you interpret anything.
- Ignoring consent. Holdouts and test groups must still respect suppression and preference rules. A holdout is a decision not to send, so it never justifies sending to someone who opted out.
- Judging by short-term clicks. A segment that gets more clicks but more unsubscribes may be a net loss. Track unsubscribes and complaints per group alongside conversion.
Watching the cost side
Segmentation can lower list health if it leads to over-mailing. Add guardrail metrics to every test: unsubscribe rate, spam complaint rate, and total messages received per subscriber. If the treatment raises conversion by 0.5 points but doubles unsubscribes, a short test will not show the long-term cost. Look at list size and engagement a few weeks later.
The testing cycle
Testing is not a one-time check. Each result feeds the next round of rules and segments.
Deciding what to do with the result
A result gives you one of three decisions.
- Clear lift. Keep the segmented approach. Retest after a few months, because behaviour and list composition change.
- No detectable lift. The segment may be too small to measure, the message may not differ enough from the generic one, or segmentation may add no value for this goal. Do not keep a segment alive only because it took work to build. The cost of maintenance is real.
- Negative result. Check the guardrails. A segment that suppresses people from messages they would have wanted can reduce revenue. Review the rules for time windows that are too tight, as covered in the chapter on writing segment rules.
Record each test with its question, dates, group sizes, metrics, and decision. A short log stops you from repeating tests and lets you see which segments consistently help.
Exercise
You email a "running interest" segment (about 3,000 people) a tailored offer and see a 5% conversion rate. The whole list, which got a generic newsletter last month, converted at 1.5%. A colleague says this proves the segment works. Describe a better test and name two measures you would add besides conversion.
Show answer
The comparison is biased because the running segment was chosen for repeated engagement and would probably convert better on any message. A better test keeps the same eligible segment and randomly splits it by hashing subscriber ID with a per-test salt. A holdout of 10% to 20% gets no offer, or a random half gets the generic offer, depending on whether you are testing the message or the tailoring. Count conversions per assigned subscriber over a fixed window set in advance, such as 7 days. Compare the groups, report the absolute lift, and check whether the gap is larger than chance. Add guardrail measures: unsubscribe rate and spam complaint rate per group. Messages received per subscriber is also a valid choice.
Exercise
A treatment group of 4,000 shows 200 converters. A holdout of 400 shows 12 converters. Calculate each conversion rate, the absolute lift, and the relative lift. Why is the holdout result alone too small to settle the question?
Show answer
Treatment is 200 / 4,000 = 5.0%. Holdout is 12 / 400 = 3.0%. Absolute lift is 2.0 percentage points. Relative lift is 2.0 / 3.0, about 67%. The holdout has only 12 converters, so one or two extra converters would change its rate by 0.25 to 0.5 points. The apparent lift could partly be chance, so run a significance test for two proportions, consider a larger holdout, and repeat the test before relying on it.