Media Mix Modeling: How to measure the effectiveness of advertising with Python & LightweightMMM

Jimmy Hajime Takeda17 Dec 2022

Problem

Advertisers with several paid channels, including offline ones such as TV, print and direct mail, need to know what each channel adds to sales and how to split next year's budget. Channel reports cannot answer this: customers see several channels at once, offline exposure cannot be tracked, and privacy rules (GDPR, Apple's IDFA deprecation) reduce tracking accuracy. A randomized lift test with a no-ads control group is the clean answer, but companies will not hold back ads for long.

Example from the article: four years of weekly data for seven channels (Direct Mail, Insert, Newspaper, Radio, TV, Social Media, Online Display) with holiday and seasonality controls. The model estimates channel ROI and proposes a new budget split.

Solution in brief

Fit a Bayesian regression of weekly sales on media spend and controls. First pass each channel's spend through ad-stock, which spreads its effect over later weeks, and saturation, which makes each extra unit less effective. Read contributions and ROI from the posterior, then optimize the budget on the fitted curves.

Questions this case answers
  • How to estimate the contribution of each spend channel to an outcome from aggregated time series when randomized holdouts and user-level tracking are not available
  • How to reallocate a fixed budget across channels whose returns diminish and whose effect is delayed
  • How to measure how much each advertising channel contributes to sales when user-level tracking is incomplete?
  • How to reallocate an advertising budget across channels to maximize sales?

Tools and methods

  • Marketing mix modeling (MMM) — time-series regression of sales on media spend and controls
  • Ad-stock (carryover) — weighted average of current and past spend
  • Saturation (shape effect) — diminishing returns within one channel
  • LightweightMMM — Google's Python library (Numpyro, JAX), with geo-level hierarchical models
  • Robyn — Meta's R library (Nevergrad, Prophet)
Continue reading — it's free

Google or a one-time email code. No password.