Sub topic 12
Testing whether segmentation works
This chapter assumes you can write the segment rules from earlier chapters and know terms such as click rate and conversion. Basic SQL helps with the examples. Segmentation takes effort to build and maintain. You should check that it beats sending the same message to everyone.
Why a before-and-after comparison misleads
A common check is to compare this month's segmented campaign with last month's broadcast. This fails for several reasons. Seasonality, a different offer, or a different send day can change results on its own. Segments also tend to contain your most engaged people, so they look better even if segmentation added nothing.
The reliable method is a controlled comparison. You run both versions at the same time, on comparable people, and you change one thing.
Use a holdout group
A holdout is a random slice of an eligible segment that does not get the segmented message. It receives the standard message instead, or nothing at all. Everything else stays the same: send time, subject line style, and offer type.
The holdout must be random. If you pick holdout members by hand or by activity, you bias the result.
Assign the holdout in SQL
This PostgreSQL example takes the "active customers interested in running" segment from the previous chapter and assigns each member to a group. It hashes the subscriber id, so the same person always lands in the same group. The experiment name is part of the hash, so a new test gets a new split.
-- PostgreSQL: deterministic 90/10 split for one experiment
-- Assumes a table segment_members(subscriber_id uuid) holding the segment
SELECT subscriber_id,
CASE
WHEN abs(hashtext(subscriber_id::text || ':running_q4')) % 100 < 10
THEN 'holdout'
ELSE 'test'
END AS grp
FROM segment_members;Store the result in a table with the experiment name. You need it later to join against outcomes.
Choose the metric before you send
Pick one primary metric and write it down before the send. Open rate is a weak choice because mail privacy features inflate it. Prefer clicks, or better, a business outcome such as purchases within seven days.
Measure both groups over the same window, counted from the send time.
-- PostgreSQL: purchase rate within 7 days of send, by group
-- Assumes experiment_groups(subscriber_id, grp), orders(subscriber_id, ordered_at)
-- and a send time of 2026-11-20 09:00 UTC
SELECT g.grp,
COUNT(*) AS people,
COUNT(o.subscriber_id) AS purchasers,
ROUND(100.0 * COUNT(o.subscriber_id) / COUNT(*), 2) AS purchase_rate_pct
FROM experiment_groups g
LEFT JOIN LATERAL (
SELECT subscriber_id
FROM orders
WHERE subscriber_id = g.subscriber_id
AND ordered_at >= timestamptz '2026-11-20 09:00+00'
AND ordered_at < timestamptz '2026-11-27 09:00+00'
LIMIT 1
) o ON true
GROUP BY g.grp;The lateral subquery returns at most one row per person, so someone who buys twice counts once.
Read the result with care
The difference between the two rates is the lift. A lift on its own does not tell you whether it is real or just noise from a small sample.
- Look at group sizes. A holdout of 40 people can swing widely from chance alone.
- Use a significance test, such as a two-proportion z-test, or the calculator in your email provider.
- Report the size of the lift as well as whether it is significant. A tiny but significant lift may not repay the upkeep.
- Check that opted-out and bounced contacts are excluded from both groups, as covered in the hygiene chapter.
Common errors
| Error | Effect | Fix |
|---|---|---|
| Holdout chosen by hand | Biased comparison | Assign by a random or hashed split |
| Comparing segment to whole list | Selection bias | Compare against a holdout from the same segment |
| Changing the offer and the segment together | You cannot tell which one worked | Change one variable at a time |
| Measuring opens only | Inflated, unreliable signal | Use clicks or purchases |
| Holdout too small | Noisy result | Size groups before the send |
Keep the holdout honest over time
One test tells you about one campaign. Segmentation can also decay as data ages and segments drift. Keep a small permanent holdout, around 5 percent, and repeat the comparison each quarter. If the lift shrinks toward zero, review your rules and data before adding more segments.
Exercise
You send a "lapsed customer" win-back email to the whole lapsed segment. Two weeks later the segment's purchase rate is 4 percent, against 2 percent for the previous broadcast. A colleague says segmentation doubled results. What is wrong with that conclusion, and how would you test it properly?
Show answer
The two sends differ in time, and probably in offer and audience, so the difference may come from those and not from segmentation. Randomly split the lapsed segment, for example 90/10, send the win-back email to the test group and the generic message to the holdout at the same time, then compare purchase rates over the same window. Check group sizes and run a significance test before claiming a lift.