ETLMCPData Conveyance Works
Log in Start free
Guides

How much history an MMM needs, and why to start storing it now

Meridian and Robyn want two to three years of weekly data. Ad platforms and plan windows keep less, so start saving daily rows in your own database today.

A marketing mix model needs at least two years of weekly data, and three is safer. Google's Meridian asks for two years for a geo-level model and three for a national one; Meta's Robyn asks for at least two years of weekly data, or four to five years if you only have monthly figures. Ad platforms do not keep daily data forever, and etlmcp keeps only as many days as your plan allows. Start saving daily rows in your own database today.

What Meridian asks for

Meridian's data collection guide sets a floor of two years of weekly data for a geo-level model and three years for a national model. If you only have monthly data, it asks for at least three years. Weekly is its recommended grain: daily data can make the model run much longer, and monthly data can fail to converge or give wide credible intervals.

Its page on the amount of data needed explains why the national floor is higher. A national model has one row per week, so two years give 104 rows. In Meridian's own example, a national model with 26 parameters and two years of weekly data has four data points per parameter, which the page calls too few to estimate the model reliably. Cutting the model to 10 parameters and using three years (156 weeks) raises that to about 15 points per parameter, enough for directional answers. A geo model gets more rows from the same calendar: its example of three years across 105 geos has 16,380 data points.

The same page names the trade-off of reaching further back. More history lowers the variance of the estimates, but older weeks may describe a market, a product range or a channel mix that no longer applies. Meridian's guide puts it as more data reducing variance while possibly making inference "less relevant".

What Robyn asks for

Robyn's analyst guide also sets a minimum of two years of weekly data for dependable results. With monthly data it recommends going well beyond two years, for example four to five. It also gives a rule of thumb for model size: about ten observations for each independent variable. With 104 weekly rows, that leaves room for roughly ten media and control variables, which is why a short history forces you to merge channels you would rather measure apart.

Why the platforms will not keep it for you

Daily history in the ad platforms' APIs is limited, so you cannot pull three years from each platform later:

Platform Daily history its API serves
Meta Insights API 37 months back from today; older start dates are refused
Google Ads API 37 months for segments.date, segments.week and segments.hour; older data only by month, quarter or year

Thirty-seven months is enough for one three-year model, once. It is only a month over three years, and a year later the oldest daily weeks of that model are gone from the API. The Meta history limits guide and the Google Ads segments guide go into detail, and the history limits comparison covers other platforms. The only way to keep a growing daily series is to store each day in a database you control, as it is reported.

How etlmcp fits

etlmcp keeps a fixed number of days of history for each plan: Free 30, Starter 365, Team 365, Agency 730 and Scale 3650. A nightly job deletes rows older than that window from etlmcp's own storage, and no sync or backfill may reach before it. Only the Scale window covers Meridian's three-year national floor on its own; the Agency window covers about two years. The history window page explains the rules in full.

A PostgreSQL destination is not trimmed by that job. Each run deletes and rewrites only its own pipeline's rows inside the dates it pulled, so rows from earlier days stay in your table. Point a pipeline at PostgreSQL now, and the table grows past your plan's window, one day at a time. For the older days the platforms still serve, a backfill fills the table as far back as your plan allows; a run started by hand covers at most 366 days, so a long backfill takes several runs.

When the model is due, roll the daily rows up to weeks in SQL. You choose the schema and table name when you add the destination; the example below calls it marketing.ad_facts. The table has date, network, cost, impressions and clicks columns, among others (see the PostgreSQL destination):

SELECT date_trunc('week', date)::date AS week,
       network,
       sum(cost)        AS spend,
       sum(impressions) AS impressions,
       sum(clicks)      AS clicks
FROM marketing.ad_facts
GROUP BY 1, 2
ORDER BY 1, 2;

Keep the table daily and aggregate at query time: Meridian lets you test daily or monthly grains as well, and you cannot split a stored week back into days.

Related

Sources

  1. Amount of data needed — developers.google.com, checked
  2. Collect and organize your data — developers.google.com, checked
  3. An Analyst's Guide to MMM — facebookexperimental.github.io, checked
  4. Ad Account, Insights — developers.facebook.com, checked
  5. Segmentation — developers.google.com, checked