Sub topic 5
Splitting Results by Segment
This chapter assumes you can compute CTR, conversion rate (CVR), cost per acquisition (CPA), and return on ad spend (ROAS) from raw totals. It also assumes you know that small samples are noisy. Python helps for the code, but the ideas apply in a spreadsheet.
Why one overall number is not enough
A campaign total is an average over many different groups of people. A segment is one of those groups, defined by a shared attribute such as device, channel, or audience. An average can hide a strong segment and a weak one that cancel out. Splitting results shows where the campaign earns its money and where it loses it.
Segmentation answers "where does performance differ?" It does not answer "why?" or "is this real?" Those questions come later, in the significance and hypothesis chapters.
Choosing segment dimensions
Pick the dimensions before you look at the numbers, and choose ones you can act on. If you cannot change your bid, creative, or targeting for a segment, knowing it is weak gives you no lever.
| Dimension | Example values | What it can reveal | Watch for |
|---|---|---|---|
| Device | mobile, desktop, tablet | Landing page or checkout problems on one device | Mobile often has high CTR and low CVR |
| Channel or placement | search, social, email | Where budget should move | Different channels get credit differently (see attribution) |
| Audience | new vs returning, age band, region | Who responds to the offer | Small groups with few conversions |
| Creative or message | headline A, headline B | Which message works | Each creative may have run in a different audience |
| Time | weekday vs weekend, week 1 vs week 3 | Seasonality, ad fatigue | Short windows with too little data |
A worked example
The script below breaks the campaign totals from the core metrics chapter into three device segments. The segment rows sum to the same totals: 200,000 impressions, 3,000 clicks, 120 conversions, 1,000 spend, and 6,000 revenue.
rows = [
{"segment": "mobile", "spend": 600, "impressions": 120000,
"clicks": 1800, "conversions": 36, "revenue": 1800},
{"segment": "desktop", "spend": 300, "impressions": 60000,
"clicks": 1000, "conversions": 70, "revenue": 3600},
{"segment": "tablet", "spend": 100, "impressions": 20000,
"clicks": 200, "conversions": 14, "revenue": 600},
]
fields = ("spend", "impressions", "clicks", "conversions", "revenue")
total = {k: sum(r[k] for r in rows) for k in fields}
total["segment"] = "all"
def line(r):
ctr = r["clicks"] / r["impressions"]
cvr = r["conversions"] / r["clicks"]
cpa = r["spend"] / r["conversions"]
roas = r["revenue"] / r["spend"]
share = r["spend"] / total["spend"]
return f"{r['segment']:<8}{ctr:>8.2%}{cvr:>8.2%}{cpa:>9.2f}{roas:>7.1f}{share:>8.1%}"
print(f"{'segment':<8}{'ctr':>8}{'cvr':>8}{'cpa':>9}{'roas':>7}{'spend':>8}")
for r in rows + [total]:
print(line(r))Running it prints:
segment ctr cvr cpa roas spend
mobile 1.50% 2.00% 16.67 3.0 60.0%
desktop 1.67% 7.00% 4.29 12.0 30.0%
tablet 1.00% 7.00% 7.14 6.0 10.0%
all 1.50% 4.00% 8.33 6.0 100.0%The overall ROAS of 6.0 looks healthy. The split shows that mobile takes 60% of spend and returns only 3.0, while desktop returns 12.0 on 30% of spend. Mobile users click as often as anyone (1.50% CTR), but only 2% of them convert. That points to what happens after the click, such as the landing page, the form, or checkout on a phone. It does not point to the ad.
Read the mix, not only the rates
Two things determine a segment's effect on the total: its rate and its share of volume. A segment with a great rate and a tiny share cannot move the total much. A mediocre segment with a large share can drag it down.
For each segment, read both columns together:
- Compare the segment's rate with the overall rate and with your baseline.
- Check its share of spend, clicks, and conversions.
- Ask what the total would be if you moved budget between segments.
Be careful with the last step. Moving budget does not move the rate with it. Desktop's ROAS of 12.0 applies to the audience your current spend reaches. The next dollar usually buys people who are less likely to convert, so marginal returns are lower than average returns.
Simpson's paradox: when the total points the wrong way
Segment mix can reverse a comparison. Suppose you test variant A against variant B, and each receives 1,000 visitors. The traffic mix differs between them.
| Variant | Desktop visitors | Desktop conversions | Mobile visitors | Mobile conversions | Overall CVR |
|---|---|---|---|---|---|
| A | 700 | 49 (7.0%) | 300 | 6 (2.0%) | 5.5% |
| B | 100 | 8 (8.0%) | 900 | 24 (2.7%) | 3.2% |
B wins on desktop (8.0% vs 7.0%) and on mobile (2.7% vs 2.0%). Yet its overall rate is lower, because most of its traffic came from the low-converting mobile segment. This is Simpson's paradox. It appears whenever the groups being compared have different segment mixes.
To avoid it, make sure variants in a test receive comparable audiences, for example through random assignment. When the mix differs, compare within segments before you trust the total.
How much data does a segment have?
Every split divides your sample. The tablet row above has 14 conversions. Its CVR of 14 / 200 = 7.0% has a standard error of about sqrt(0.07 × 0.93 / 200) = 1.8 points. A rough 95% range is therefore 7.0% ± 3.5 points, or 3.5% to 10.5%. That range is wide enough to include the overall rate of 4.0%. The data cannot tell you that tablet users convert better than average.
Two working rules help:
- Count conversions per segment, not only visitors. Rates built on fewer than about 30 conversions move a lot from day to day. Treat them as directional.
- Compare segments with the two-proportion test from the significance chapter before you act on a gap. Mobile versus desktop CVR (2% vs 7%, on 1,800 and 1,000 clicks) is a large, well-supported gap. Desktop versus tablet (7% vs 7%) is not a gap at all.
The many-cuts problem
Each extra split is another chance to find a difference by luck. At a 5% significance threshold, 20 independent segment comparisons will produce about one false positive even if nothing is truly different. Cutting by device, region, hour, age, and creative can easily give you dozens of comparisons.
Defend against this in three ways:
- Write down 2 to 4 segment dimensions before reviewing results.
- Treat any surprising pattern found outside that list as a hypothesis to test, not a finding.
- Look for consistency. A segment that underperforms in week 1, week 2, and week 3 is more believable than one that underperforms in a single week.
A workflow for segment review
Common errors
- Ranking segments by rate alone. A segment with a 20% CVR on 5 clicks is not a winner. Always show the count next to the rate.
- Averaging segment rates. The overall CVR is total conversions divided by total clicks, not the mean of the segment CVRs. The simple mean of the three CVRs above is 5.3%, but the true overall CVR is 4.0%.
- Dividing by zero. A small segment with no conversions makes CPA undefined. Handle it explicitly, for example by reporting "no conversions" instead of a number.
- Mixing attribution rules. If one channel is credited by last click and another by first click, their segment ROAS values are not comparable.
- Treating a segment as a cause. Mobile having a low CVR does not prove that mobile users are less interested. The mobile page may simply be slower or harder to use.
- Over-slicing. A split into device × region × creative can leave cells with a handful of clicks. Use the coarsest split that answers your question.
What to do with the result
A segment finding is useful when it leads to a specific, testable change. For the example above, the weakest large segment is mobile: 60% of spend, 2% CVR, and a CPA of 16.67 against 8.33 overall. A reasonable next hypothesis is that the mobile post-click experience loses buyers. The funnel diagnosis chapter shows how to locate the exact stage. Meanwhile, a small, reversible budget shift toward desktop is a low-risk response, as long as you watch whether desktop's returns hold as spend rises.
Exercise
A campaign has two segments. New visitors: 4,000 clicks and 80 conversions. Returning visitors: 1,000 clicks and 70 conversions. What are the CVR of each segment and the overall CVR? Why is the overall CVR not the average of the two segment CVRs?
Show answer
New visitors convert at 80 / 4,000 = 2.0%. Returning visitors convert at 70 / 1,000 = 7.0%. The overall CVR is (80 + 70) / (4,000 + 1,000) = 150 / 5,000 = 3.0%. The simple average of the two segment rates would be 4.5%, which is wrong because new visitors supply four times as many clicks. The overall rate is a weighted average, so the larger segment pulls it toward its own value.
Exercise
Variant B beats variant A in every device segment, but A has the higher overall CVR. Name the effect, give its usual cause, and say what you should do before declaring a winner.
Show answer
This is Simpson's paradox. The usual cause is that the two variants reached different mixes of segments, for example B received far more traffic from a low-converting segment such as mobile. Before declaring a winner, compare the variants within each segment, check how traffic was assigned, and if possible rerun the test with random assignment so that both variants get a comparable mix.