Attribution
Marketing Mix Modeling for DTC Brands: How MMM Works, What It Needs and Which Tools to Use
Marketing mix modeling (MMM) is a statistical model that estimates how much each marketing channel contributes to sales, using weekly spend and sales data instead of tracking individual customers. It separates the sales you'd have made anyway from the sales marketing drove, and shows how each channel's return changes as you spend more.
This guide explains how a marketing mix model works, what you get out of one, the open-source tools, how to tell whether a model can be trusted and the problems specific to DTC and Shopify brands. For how MMM compares with attribution and lift tests, and the data a model needs, see our marketing measurement guide.
What is marketing mix modeling?
Marketing mix modeling, also called media mix modeling, uses regression on aggregate data to explain a business outcome, usually revenue or orders, with the things that drive it: spend by channel, seasonality, promotions, pricing and other factors. Because it never looks at individual users, cookie limits, ad blockers and device switches don't affect it. Meta's Robyn guide notes that MMMs have been around for many years and are being rediscovered for exactly that reason.
Google's Meridian project sums up the three questions an MMM answers:
- What was each channel's historical ROI and contribution?
- How does each channel's impact change with spend (its response curve)?
- How should you allocate future budget to get the most out of it?
Marketing mix modeling vs attribution
Attribution works bottom-up: it follows each customer's clicks to their order and splits credit between them. MMM works top-down: it never sees a customer, only weekly totals. That's why MMM can measure TV, podcasts and organic social, which leave no clicks, but can't tell you which ad or campaign to pause. Most brands that run an MMM keep attribution for day-to-day decisions; the measurement guide covers how they fit together.
How does a marketing mix model work?
It splits sales into baseline and marketing-driven
The core output is a decomposition: each week's sales broken into the parts the model attributes to each factor. An illustrative week for a Shopify brand:
| Component | Weekly revenue | What it represents |
|---|---|---|
| Baseline | $120,000 | Sales you'd make with no marketing that week: brand, word of mouth, repeat customers |
| Seasonality and trend | $15,000 | The time of year and the brand's underlying growth |
| Promotion | $25,000 | A sitewide sale running that week |
| Meta | $30,000 | Paid social |
| $18,000 | Paid search and Shopping | |
| Email and SMS | $12,000 | Owned channels, modeled without media spend |
| Total | $220,000 | Matches the store's actual revenue |
Each channel's contribution divided by its spend gives its ROI. The decomposition always adds up to actual sales, which is what makes MMM a reconciled, top-down view.
It models carryover (adstock)
An ad doesn't stop working the week it runs. Someone who sees it this week may buy next week. Models capture this with an adstock transformation that spreads each week's spend over the following weeks. Robyn offers a geometric adstock, where the effect decays at a fixed rate, and a more flexible Weibull adstock that can capture effects that peak after a delay.
It models diminishing returns (saturation)
The tenth thousand dollars on a channel usually returns less than the first. A saturation curve captures this. Robyn uses a Hill function, which can take an S or L shape; PyMC-Marketing offers logistic saturation among others. Saturation is what produces response curves and marginal ROAS, the return on the next dollar, which our measurement guide explains with a worked example.
It controls for everything else that moves sales
Promotions, price changes, holidays, product launches and stock-outs all move sales without media. If the model doesn't know about them, it credits their effect to whichever channel happened to spend more that week. Robyn handles trend and seasonality with Prophet; Meridian lets you add control variables such as Google Query Volume to account for organic brand interest.
It estimates the effects
The modeling approaches differ. Robyn uses ridge regression and searches the adstock and saturation settings with the Nevergrad optimization library. Meridian and PyMC-Marketing are Bayesian: you can give the model priors, starting assumptions from your own knowledge or experiments, and it reports results with credible intervals rather than a single number.
What you get out of a marketing mix model
| Output | What it tells you | How to use it |
|---|---|---|
| Contribution by channel | How much revenue each channel drove over the period | Compare with what attribution credited each channel |
| ROI by channel | Revenue per dollar spent, usually with a range | Spot channels whose return is lower than reported |
| Response curves | How revenue changes as spend rises | Find where each channel saturates |
| Marginal ROI | The return on the next dollar | Decide where the next budget increase goes |
| Budget scenarios | The best split for a given total budget | Plan next quarter's allocation |
Both Robyn (its budget allocator) and Meridian (its budget optimization report) turn response curves into recommended budget splits. Treat these as scenarios to test, not instructions: a recommendation that moves far outside the spend levels in your history is extrapolating.
Marketing mix modeling tools
| Tool | Maintained by | Approach | Notable features |
|---|---|---|---|
| Bayesian, open source | Priors, geo-level modeling, reach and frequency inputs, budget optimization, GeoX geo experiments for calibration | ||
| Meta | Ridge regression with automated hyperparameter search, open source; R with a Python beta | Geometric and Weibull adstock, Hill saturation, Prophet seasonality, budget allocator, calibration with experiments | |
| PyMC Labs | Bayesian, open source, Python | Adstock and saturation components, lift-test calibration, customer lifetime value models | |
Measurement platforms | Vendors | Managed models | Northbeam and Triple Whale offer MMM on enterprise tiers; see our Northbeam and Triple Whale comparisons |
The open-source tools are free but need someone comfortable with Python or R, statistics and your data. Vendors trade cost for setup, support and refreshes.
How to tell if a marketing mix model can be trusted
A model can fit past sales well and still give the wrong answer about channels. Check it from several angles:
- Out-of-sample prediction. Hold back recent weeks, fit the model on the rest and see how well it predicts the weeks it didn't see. Robyn does this with a train, validation and test split and reports the prediction error as NRMSE.
- Business plausibility. A channel credited with far more or less than its share of spend deserves a second look. Robyn's DECOMP.RSSD measures exactly this gap between share of spend and share of effect.
- Residuals. The leftover error should look like random noise. Robyn's docs note that visible patterns such as waves or clusters usually mean a missing variable.
- Stability. Refit with a few more weeks of data. If a channel's ROI swings widely between refits, the model hasn't pinned it down.
- Agreement with experiments. The strongest check is a lift test. Robyn's guide strongly recommends calibrating with experiments such as Meta Conversion Lift or GeoLift, PyMC-Marketing supports lift-test calibration and Google offers GeoX for Meridian. Our incrementality testing guide covers how to run one.
MMM pitfalls specific to DTC brands
Promotions dominate the data. Black Friday, sitewide sales and launch weeks drive most of the variation in many DTC brands' sales. If they aren't in the model as their own variables, it credits their lift to whichever channel spent more that week, which is usually all of them at once.
Algorithmic campaigns follow demand. Campaigns with automated budgets, such as Meta Advantage+ and Google Performance Max, tend to spend more when demand is already rising. A model can then credit the channel for demand it followed. Keeping some campaign budgets fixed for stretches, and changing spend on purpose, gives the model cleaner signal.
Spend barely varies. A channel whose budget stays flat week after week can't be separated from the baseline. Our measurement guide covers how to create spend variation on purpose.
Sales happen outside Shopify. Ads also drive Amazon, wholesale and retail sales. A model fed only Shopify revenue misses that and undervalues upper-funnel channels. Model those sales as their own outcome, or at least add them alongside store revenue.
Owned channels have no spend. Email and SMS drive a lot of DTC revenue but cost little per send. Model them with send volume as an organic variable (Robyn supports these) so their effect isn't credited to paid media.
Platform revenue isn't sales. Each ad platform reports the revenue it can link to its own ads, and those totals overlap. Use your store's actual orders as the outcome; our post on why GA4 and ad platform numbers don't match explains the gap.
Should you build, buy or wait?
| Your situation | Recommendation |
|---|---|
| Fewer than two years of weekly data, or only one or two paid channels | Wait. Collect weekly inputs now, track MER as a top-down check and run lift tests on your biggest channel. |
| Enough history and channels, and an analyst comfortable with Python or R | Build with Meridian, Robyn or PyMC-Marketing, and calibrate with a lift test before acting on it. |
| Enough history and channels, no analyst, significant spend in channels clicks can't measure | Buy from a vendor, and ask how they validate and calibrate their models. |
Robyn's guide recommends at least two years of weekly data, and Google's Meridian docs show that even two years can be too little for a model with many channels; the measurement guide has the details and the full list of inputs.
Where Upstack fits
Upstack doesn't build marketing mix models. It helps with the inputs, which are where most models go wrong:
- Store-reconciled outcomes. Upstack reports orders and revenue from your Shopify store rather than summing what each ad platform claims.
- Spend and orders by source in one export. The Attribution board exports orders, revenue, spend, CPA and ROAS by source as CSV, a starting point for the weekly dataset a model needs.
- A click-level view to compare against. Once a model is built, comparing its channel contributions with First click and Last click attribution shows where the two disagree, which is usually where a lift test is worth running.
Frequently asked questions
What's the difference between marketing mix modeling and media mix modeling?
They're two names for the same method. "Media mix modeling" emphasizes paid media; "marketing mix modeling" is broader and includes price, promotions and distribution. Tools like PyMC-Marketing use the terms interchangeably.
Can MMM measure individual campaigns or ads?
Usually not. MMM works best at channel level. Google doesn't recommend running Meridian at campaign level and points to data-driven multi-touch attribution for more granular digital insight.
How often should a marketing mix model be refreshed?
Refit it as new weeks of data arrive and after major changes in channels, pricing or strategy. Robyn includes a model refresh feature for adding new data to an existing model. Between refreshes, check that the model still predicts recent weeks well.
Is marketing mix modeling accurate?
It can be, when the inputs are clean, spend varies enough and results are checked against experiments. Without calibration, a model can fit past sales closely and still misattribute between channels that moved together. Treat its outputs as ranges and confirm big budget moves with a lift test.
Is MMM privacy-safe?
Yes. MMM uses aggregate weekly data such as total spend and total sales, not personal data about individual customers, so it isn't affected by consent banners, cookie limits or device tracking.
Key takeaways
- Marketing mix modeling estimates each channel's contribution from weekly spend and sales, without tracking individual customers.
- Models split sales into baseline and marketing-driven, with adstock for carryover and saturation for diminishing returns.
- Meridian, Robyn and PyMC-Marketing are free and open source; vendors trade cost for setup and support.
- Trust a model only after checking out-of-sample prediction, plausibility, stability and agreement with a lift test.
- For DTC brands, promotions, algorithmic budgets, flat spend, off-Shopify sales and owned channels are the usual sources of error.
Request a demo and we'll show you how clean your weekly spend and revenue data is before you model it.
Want similar results?
Start free for 21 days and see what clean signal does for your performance. No card, no contract.