Sub topic 11
Measuring what works: incrementality tests and marketing mix modeling
This chapter assumes you know what a conversion, a funnel and a UTM-tagged link are, and that you have read the earlier chapters on why cross-site tracking signals are shrinking. It also assumes basic comfort with ratios and percentages. The code uses Python and no statistics library except NumPy.
The question attribution cannot answer
Last-click and other click-path attribution models answer this question: which touchpoints did converting customers pass through? They do not answer the question budget owners care about: how many of those conversions would have happened without the ad?
Retargeting shows the gap clearly. People who visited your pricing page and then saw a retargeting ad convert at a high rate. Many of them were already likely to buy. Attribution credits the ad, but the ad may have caused very little.
Causal measurement is a response to signal loss and also a fix for a problem that existed before it. Browser limits, consent refusals and mobile opt-outs remove the user-level paths that attribution depends on. Incrementality tests and marketing mix models (MMM) do not need those paths. Both work from aggregate or randomized data.
| Question | Click-path attribution | Incrementality test | Marketing mix model |
|---|---|---|---|
| What does it estimate? | Credit for observed touchpoints | Conversions caused by a specific campaign | Contribution of each channel over time |
| Needs user-level tracking? | Yes | No, if groups are assigned by randomization | No, uses aggregate data |
| Speed | Near real time | Weeks per test | Weekly or monthly refresh |
| Main weakness | Counts conversions that would have happened anyway | One campaign at a time, and it costs reach | Needs history and variation in spend, and gives estimates with uncertainty |
Incrementality testing
An incrementality test randomly splits a population into two groups. The test group can see the ads. The control group is held out and cannot. Everything else stays the same. Because assignment is random, any difference in conversion rate is attributable to the ads.
Common designs
- User-level holdout. The ad platform withholds ads from a random share of eligible users. This is the simplest design, but you depend on the platform's randomization and reporting.
- Geo experiment. You split regions into matched test and control sets. You run ads only in the test regions and compare sales. It needs no user identifiers, so it fits a low-signal world well. It requires enough regions and stable regional sales patterns.
- Ghost ads or public service announcement (PSA) control. The control group is eligible to be shown ads but is not shown yours. Some platforms log where an ad would have been shown, which keeps the comparison fair between users who would have been reached.
- Time-based on/off test. You pause a channel for a period and compare sales. It is easy to run, but seasonality and other campaigns easily contaminate it. Treat it as a last resort.
Computing lift
The function below compares an exposed group with a held-out control group. It also adds a two-proportion z-test and a cost per incremental conversion.
import math
def incremental_lift(test_conversions, test_size, control_conversions, control_size):
"""Compare conversion rates of an exposed group and a held-out control group."""
test_rate = test_conversions / test_size
control_rate = control_conversions / control_size
absolute_lift = test_rate - control_rate
relative_lift = absolute_lift / control_rate if control_rate else float("nan")
return test_rate, control_rate, absolute_lift, relative_lift
def z_score(test_conversions, test_size, control_conversions, control_size):
"""Two-proportion z-test using a pooled rate."""
pooled = (test_conversions + control_conversions) / (test_size + control_size)
se = math.sqrt(pooled * (1 - pooled) * (1 / test_size + 1 / control_size))
diff = test_conversions / test_size - control_conversions / control_size
return diff / se
test_conv, test_n = 540, 10000
ctrl_conv, ctrl_n = 450, 10000
spend = 9000.0
test_rate, ctrl_rate, abs_lift, rel_lift = incremental_lift(test_conv, test_n, ctrl_conv, ctrl_n)
incremental_conversions = abs_lift * test_n
print(f"Test rate {test_rate:.2%}, control rate {ctrl_rate:.2%}")
print(f"Relative lift {rel_lift:.1%}")
print(f"Incremental conversions: {incremental_conversions:.0f}")
print(f"Cost per incremental conversion: {spend / incremental_conversions:.2f}")
print(f"z = {z_score(test_conv, test_n, ctrl_conv, ctrl_n):.2f}")The test group converts at 5.40% and the control group at 4.50%. That is a 20% relative lift, about 90 incremental conversions and a cost of about 100 per incremental conversion. The z-score is near 2.9, which is beyond the common 1.96 threshold for 95% confidence.
Here is how the numbers differ from a platform report. Suppose the platform reports 540 attributed conversions and a cost per conversion of 16.67. The test shows that only 90 of those 540 were caused by the ads. The real cost of a caused conversion is six times higher.
Design rules that prevent bad tests
- Decide the sample size before you start. Small baseline rates need large groups. If you expect a 10% relative lift on a 1% conversion rate, you need many tens of thousands of users per group.
- Randomize at the unit you intend to analyze. If households share devices, randomize by household. In a geo test, randomize regions, not individual people.
- Fix the duration and the outcome metric in advance. Stopping the moment the result looks good inflates false positives.
- Keep other changes out. A price change or a large email campaign in the test window can distort the comparison.
- Account for consent. If conversions are only observed for consenting users, make sure the missing data affects both groups equally. Sales or order data from your own back end is safer than tag-based conversions.
Marketing mix modeling
An MMM is a statistical model, usually a regression, that explains a business outcome such as weekly sales using channel spend and other drivers: price, promotions, seasonality, holidays, competitor activity and macroeconomic factors. It needs only aggregate data, typically two or more years of weekly figures. It also covers channels where no click exists, such as TV, radio, out-of-home and sponsorships.
Two ideas make MMM realistic for advertising:
- Adstock (carryover). Ads keep working after the spend happens. A decay rate carries part of last week's effect into this week.
- Saturation (diminishing returns). Doubling spend does not double the response. A saturation curve flattens as spend grows.
import numpy as np
def adstock(spend, decay):
"""Geometric adstock: each period keeps a share of the previous period's effect."""
out = np.zeros(len(spend))
carry = 0.0
for i, s in enumerate(spend):
carry = s + decay * carry
out[i] = carry
return out
def saturate(x, half_saturation, shape=1.0):
"""Hill curve: response rises toward 1 as x grows, 0.5 at half_saturation."""
x = np.asarray(x, dtype=float)
return x**shape / (x**shape + half_saturation**shape)
spend = np.array([100, 0, 0, 0])
carried = adstock(spend, decay=0.5)
print(carried)
print(saturate(carried, half_saturation=50))A one-week burst of 100 decays to [100, 50, 25, 12.5]. The saturation curve then maps those values to roughly [0.67, 0.50, 0.33, 0.20]. In a full model, the transformed series become regression inputs, and the fitted coefficients give each channel's contribution. Open-source tools such as Meridian and Robyn and PyMC-based libraries handle fitting, priors and uncertainty, so you rarely write this from scratch.
What MMM can and cannot do
- It gives channel-level return estimates and response curves, so you can ask where the next unit of budget does the most good.
- It is slow-moving. It informs quarterly and annual allocation, and it does not tell you which ad creative to switch off tomorrow.
- It cannot separate channels whose spend moves together. If you raise search and social spend in the same weeks every time, the model cannot tell them apart. Planned variation in spend, such as staggered flights or geo-level differences, gives it something to learn from.
- It is correlational. Modern practice calibrates it against experiment results so that its channel estimates agree with measured lift.
Using the methods together
No single method covers speed, causality and breadth. Teams usually combine them, as in the diagram.
A practical cadence looks like this:
- Use attribution and UTM tags for fast, directional campaign and creative decisions.
- Run a test on your largest or most doubtful channel every quarter.
- Refit the MMM at least quarterly, calibrated with the latest test results.
- Reallocate budget based on the model's response curves, then test the reallocation.
Common errors
- Treating platform-reported lift as independent. Check how the platform builds its control group and whether you can see raw counts.
- Ending a test early. A promising interim result is the most common source of false wins.
- Testing only retargeting. Retargeting looks efficient in attribution and often weak in tests. Test prospecting too, since its effects are harder to see.
- Overfitting the MMM. With dozens of variables and a hundred weekly rows, a model can fit history well and predict poorly. Hold out recent weeks and check forecast error.
- Ignoring uncertainty. Present ranges. A channel return of "2.1, plausible range 1.2 to 3.0" supports a different decision than a single point value.
Exercise
A holdout test gives 300 conversions from 20,000 exposed users and 250 conversions from 20,000 held-out users. The campaign cost 6,000. What is the relative lift, and what is the cost per incremental conversion?
Show answer
The test rate is 300 / 20,000 = 1.5% and the control rate is 250 / 20,000 = 1.25%. The absolute lift is 0.25 percentage points, so the relative lift is 0.25 / 1.25 = 20%. Incremental conversions are 0.0025 × 20,000 = 50. The cost per incremental conversion is 6,000 / 50 = 120. You should also run a significance test before acting on the result.
Exercise
Your MMM shows strong returns for search and social, but you always raised both budgets in the same weeks. Which problem does this cause, and what is one way to fix it?
Show answer
Collinearity: the model cannot separate the two channels' effects because their spend moves together. Fix it by introducing planned variation, for example staggering flight dates or running a geo test where only one channel changes. You can then use the test result to calibrate the model.