Inputs and Variables
Spend, seasonality, base.
Inputs and Variables is a free Digital Marketing Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Digital Marketing Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Anatomy of MMM Inputs
An MMM is only as good as its inputs. They fall into three buckets: media variables (the levers you control), control variables (drivers you don't), and the dependent variable (what you predict).
Getting these right, at the correct granularity and cadence, is most of the work in a credible model.
dependent : sales or revenue (weekly)
media : spend or impressions per channel
controls : price, promo, seasonality, macro
transforms: adstock, saturationThe Dependent Variable
Choose a clean outcome: units sold, revenue, or new customers. Be consistent about whether it's gross or net, and whether returns are excluded.
Model at the granularity you can act on, usually national or regional weekly. Daily data adds noise; monthly hides dynamics.
Media Variables: Spend vs Impressions
You can feed media as spend or as exposure (impressions, GRPs, clicks). Impressions decouple delivery from cost, which matters when CPMs swing.
A common pattern: model on impressions for the response curve, then convert back to spend for ROI. Always keep units consistent within a channel.
TV -> GRPs
Search -> clicks or spend
Social -> impressions
OOH -> spend (no impression feed)Adstock (Carryover)
Advertising effects persist after the flight ends. Adstock models this decay so this week's sales reflect prior weeks' media.
The decay rate lambda controls memory: 0.0 means no carryover, 0.8 means a long tail. TV usually has higher adstock than search.
adstock_t = media_t + lambda * adstock_(t-1)
lambda=0.3 (search): fast decay
lambda=0.7 (TV): slow decay, long memorySaturation (Diminishing Returns)
Doubling spend rarely doubles sales. Saturation transforms capture diminishing returns so the model doesn't extrapolate linearly forever.
Hill or log transforms bend the response curve, giving each channel a realistic ceiling and an efficient operating range.
Hill: response = x^a / (x^a + k^a)
low spend -> steep gains
high spend -> flattening curve (saturated)Control Variables
Controls absorb non-media drivers so they aren't wrongly credited to ads. Key ones: price, promotions, distribution/availability, competitor activity, and macroeconomic indices.
Omitting a strong control biases media coefficients, often inflating whichever channel happened to run during a promo.
price : average selling price
promo : 0/1 flag or % discount depth
distribution : stores or % ACV
competitor : share of voice / spend
macro : consumer confidence, CPISeasonality and Trend
Many products have strong seasonal patterns. Capture them with month/week dummies, Fourier terms, or a seasonal index, plus a trend term for underlying growth or decline.
Without these, seasonal sales lifts leak into media variables that happened to run in peak season.
fourier: sin(2*pi*t/52), cos(2*pi*t/52)
trend: t (linear) or spline
holiday: black_friday_flag, holiday_flagThe Base vs Incremental Split
MMM separates a base (what you'd sell with zero new media: brand equity, distribution, price) from incremental contributions driven by media.
A healthy model often shows a large stable base. If media "explains" almost everything, the controls are probably too weak.
total_sales = base + sum(media_contributions)
base : 70%
incremental : 30% (split across channels)Multicollinearity Pitfalls
When channels flight together, the model can't tell their effects apart and coefficients become unstable, sometimes flipping sign.
Diagnose with correlation matrices and VIF. Mitigate by varying spend over time, adding geo variation, or using Bayesian priors to stabilize estimates.
corr(TV, Social) = 0.91 -> high collinearity
VIF > 10 -> unstable estimate
fix: stagger flights, add geo splits, priorsVariable Hygiene Checklist
Align all series to the same calendar and time zone. Fill gaps deliberately, not with silent zeros that mean "no spend" versus "no data".
Deflate monetary series for inflation if the window is long, and document every transformation so results are reproducible.
Putting Inputs Together
The final design matrix layers raw controls plus transformed media. Each media column has been adstocked then saturated before entering the regression.
This pipeline order matters: carryover first (when the effect lands), saturation second (how much it lands).
raw_TV -> adstock(lambda=0.7) -> saturation(Hill)
-> column TV_eff in model
sales = base + b1*TV_eff + b2*Search_eff
+ b3*price + b4*promo + seasonQuick Check
Identify the right transform for the right phenomenon.
Recap
MMM inputs are the dependent variable, media variables (transformed by adstock then saturation), and control variables (price, promo, distribution, seasonality, macro).
Strong controls protect against over-crediting media, and clean, consistently-scaled, well-documented series are the foundation of a trustworthy model.
Frequently asked questions
Is the “Inputs and Variables” lesson free?
Yes — the full text of “Inputs and Variables” is free to read here on the web, and the Digital Marketing Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Digital Marketing Academy course, upgrade to CoddyKit PRO.
What will I learn in “Inputs and Variables”?
Spend, seasonality, base. You practise Digital Marketing Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Digital Marketing Academy?
No prior experience is required. Digital Marketing Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Inputs and Variables” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Digital Marketing Academy lesson?
Yes. Every Digital Marketing Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- MMM vs Attribution
- Inputs and Variables
- Reading an MMM
- Budget Reallocation