
Attributing Revenue: A Marketing Mix Model
How we reallocated $2M in ad spend to increase total ROAS by 12%.
Python
MMM
Scrollytelling
ROI
Executive Summary
Following iOS privacy updates, our standard last-click attribution model began failing. The marketing team was spending $5M across Meta, Google Ads, and linear TV, but couldn’t accurately prove incrementality. We deployed a Bayesian Marketing Mix Model (MMM) to take a top-down view of our spend and revenue.
Methodology Notes for Technical Review
For the data science team, the complete code for the Bayesian model (built using PyMC) is available below. We utilized Half-Normal priors for the media coefficients and Beta distributions for the ad-stock decay rates.
# This code block is visible but not executed in the portfolio
import pymc as pm
import pytensor.tensor as pt
with pm.Model() as mmm:
# Priors
intercept = pm.Normal('intercept', mu=0, sigma=1)
beta_media = pm.HalfNormal('beta_media', sigma=1, shape=3)
alpha_adstock = pm.Beta('alpha_adstock', alpha=1, beta=3, shape=3)
# ... (Truncated for portfolio readability)
