How to run your first media mix model, step by step
Gather two or more years of weekly sales and spend by channel, add promotions and controls, and fill gaps the right way. Then fit Meridian or Robyn, check the baseline and calibrate with a lift test before you move budget.
By Joris van Huët, Founder & CEOUpdated 7 min read
Run the numbers for your store: the free multi-channel budget calculator.
If you have two or more years of weekly sales and ad spend, you can run a first media mix model. Export the weeks, add promotions and controls, fill gaps, fit Google's Meridian or Meta's Robyn, and sanity-check the baseline. Then calibrate with a lift test before you move budget.
Budget months, not an afternoon. Meta's Robyn guide puts a first study at about 4-6 weeks of data collection and 4-8 weeks of modeling, before any analysis. Most of that time goes into the data, so that is where the steps start.
Step by step
- Write down the one budget question you need answered. For example: should next quarter's extra budget go to Google Ads or Meta? Robyn's guide notes that some questions suit a lift test or attribution better than an MMM. Where: a one-page brief, before any export.
- Export weekly revenue from Shopify. Open the Total sales over time report, set Group by to week and export it as a CSV. Path: Shopify admin > Analytics > Reports, category filter Sales, then Total sales over time.
- Check the revenue file against the admin. Shopify warns that custom columns add a row per product, so an exported CSV can count more orders than the admin shows. Model revenue, not order counts, and check one week's total against the admin. Where: the CSV you just exported.
- Export weekly spend from Google Ads. Segment the Campaigns table by Time, then Week, and download it. Path: Google Ads > Campaigns > segment icon > Time > Week. Then click the download icon above the table, choose Download and pick Excel CSV.
- Pull every other paid channel by week. Use each platform's own reporting export, with the same week boundaries as the Shopify file. Robyn's guide asks for spend and impressions that actually ran, not the numbers in the media plan. Where: each ad platform's reporting screen.
- Add organic and non-media activity. Newsletters, social posts and other unpaid activity count as organic media in Meridian's terms. Promotions, price changes and packaging changes are non-media treatments. Where: your email tool and promo calendar, one row per week.
- List the controls that drove your budget. Meridian's docs suggest asking your marketing planner what shaped their spending decisions, consciously or not. Seasonality can come from the model itself: Meridian adjusts for it automatically, and Robyn splits out trend and seasonality for you. Where: a short interview, then one column per control.
- Fill gaps the right way. A week with no spend on a channel is a zero. A missing week of sales or of a control is not, so estimate it with interpolation instead. Where: the merged sheet, before any model sees it.
- Count your variables against your weeks. Robyn's guide recommends 1 independent variable: 10 observations, and a minimum of two years of weekly data. If the sums do not work, combine small channels or drop the smallest. Where: the column count of your sheet.
- Fit Meridian in Python or Robyn in R. Both are free and open source, and both build in carryover and diminishing returns. Robyn returns a set of candidate models and leaves the final pick to you. Where: each project's getting-started guide.
- Read the baseline before the ROI table. Meridian's docs list a negative baseline, or one channel dominating all the others, as results that do not make sense. Where: the model's fit and contribution charts.
- Calibrate with a lift test. Run a holdout or geo test on your biggest channel, then feed the result back in as a prior. Robyn's guide asks that the test match the model's metric, granularity and period. Where: Meridian's priors from past experiments, or Robyn's calibration input.
A worked example
For illustration, take a store with three paid channels, one newsletter, a promotion flag and a price index. If you apply Robyn's 1: 10 ratio to those six variables, you need at least 60 weekly rows. Two years of weekly data is 104 rows, as Meridian's docs count it, and that is Robyn's minimum. So the history rule decides, not the ratio. The merged sheet then has one row per week and one column per channel, control and organic input. That sheet is the whole input to the model.
Now the lag. In one store's export, journeys with four to nine touches took 16.9 days to buy on the Journeys sheet, while 1-touch journeys took 0.5 days. If your paths look like that, most revenue lands in the week of the touch, with a tail two or three weeks later. That tail is what the carryover settings in Meridian and Robyn are there to absorb.
The same export could not feed the model, though. It holds shares of revenue, not weekly spend.
Then the sanity check. For illustration, say the first fit hands one channel 70% of all media-driven revenue and shows a negative baseline in December. Meridian's docs list both as results that do not make sense. Fix the data or the priors before you read a single ROI.
What to check when the model looks wrong
- The baseline goes negative. Meridian's docs read an extremely negative baseline as extreme error, and point you back to the model settings, the data or the priors.
- One channel takes almost everything. That is one of the results Meridian's docs say do not make sense. Check that channel's spend column for a mix-up first.
- ROI swings between runs. Several models can fit equally well and still disagree, which is why Robyn hands you a set of candidates. Pick with business sense and, ideally, a lift test.
- A channel with flat spend gets a wild ROI. Robyn's guide warns that without variation the model cannot tell what that channel did. Treat the number as noise.
- The fit looks too good. Meridian's docs warn that a model with 99% out-of-sample R-squared can still be a poor model for causal inference. Judge it on whether the story makes sense, not on fit alone.
- The optimizer wants to triple a channel. Response curves are fitted on the spend range you actually used. Past that range the model is guessing, so test before you scale.
What to do this week
- Export the weeks from Shopify. In Shopify admin, open Analytics > Reports, filter to Sales and open Total sales over time. Set Group by to week and export. Pass: two or more years of weekly rows with no holes. Fail: fewer weeks or gaps, so start with a lift test instead of a model.
- Export the matching weeks from Google Ads. Segment the Campaigns table by Time, then Week, and download it as Excel CSV. Pass: the weeks line up with the Shopify file, row for row. Fail: they start on different weekdays, so realign them before you merge.
- List your unpaid campaigns. In Shopify admin, open Analytics > Reports, filter to Marketing and open Performance by UTM campaign. Pass: newsletters and other unpaid campaigns appear by name, so you can log their send weeks. Fail: they are missing, so tag them now, because the model will need their history.
Check the homework. Your GA4 Attribution paths export already holds the evidence. Causality Engine reads that one file and shows what each channel caused next to what last-click gave it, in 1 to 2 minutes, for €99 once (excluding VAT), refundable within 30 days. Check the homework
Sources, 1 October 2026: An Analyst's Guide to MMM (Meta). Key Features (Meta). An introduction to Meridian (Google). Collect and organize your data (Google). Amount of data needed (Google). Media saturation and lagging (Google). Set custom ROI priors using past experiments (Google). Assess the model fit and the results (Google). Assess the baseline (Google). About MMM as a causal inference methodology (Google). Sales reports (Shopify). Marketing reports (Shopify). Use segments in your tables (Google). Create, save, and schedule reports from your statistics tables (Google).
Related answers
Frequently asked questions
Do I need geo-level data for a media mix model?
No, but it helps. Meridian can run on national data, and its docs say geo-level data carries more statistical information and improves media effect estimates. Robyn's guide calls regional data best practice when you have it.Should I use spend or impressions as the media input?
Use impressions or clicks when you have them, and keep spend for the ROI maths. Meridian's docs allow spend as a stand-in, but warn that a spike in ad prices can then look like more advertising.How often should I refresh a media mix model?
Whenever enough new weeks arrive to matter, and after any big change in channels or tracking. Robyn has a refresh function that rebuilds on new data while keeping the settings of the model you picked. Its guide mentions monthly, weekly or even daily refreshes.
Go deeper: Causal attribution, explained.
Sixty-second versions of these ideas: Causality Engine on YouTube Shorts.
Keep reading
Terms in this article
- AttributionAttribution identifies user actions that contribute to a desired outcome and assigns value to each. It reveals which marketing touchpoints drive conversions.
- Causal InferenceCausal Inference determines the independent, actual effect of a phenomenon within a system, identifying true cause-and-effect relationships.
- ExperimentsExperiments are scientific procedures that test hypotheses or demonstrate facts. In marketing, experiments like A/B tests determine the causal effect of campaign changes, enabling data-driven decisions.
- Google AdsGoogle Ads is an online advertising platform where advertisers bid to display ads, service offerings, and product listings.
- ImpressionAn Impression counts each time an ad or content displays on a user's screen. It measures exposure, not engagement.
- Marketing MixThe marketing mix is the set of actions a company uses to promote its brand or product. It traditionally includes product, price, place, and promotion.
- Marketing Mix ModelingMarketing Mix Modeling (MMM) is a statistical analysis that estimates the impact of marketing and advertising campaigns on sales. It quantifies each channel's contribution to sales.
- Media Mix ModelingMedia Mix Modeling is a statistical technique that measures the collective impact of marketing and advertising on sales. It uses historical data to inform budget allocation.