ETLMCPData Conveyance Works
Log in Start free
Guides

Google Meridian input data: what you need and in what shape

The columns Meridian requires and accepts, why weekly rows of summable metrics work best, and how many years of history geo and national models need.

Google's Meridian needs four things in one table: a KPI that adds up across time and regions, an exposure metric for every paid channel (impressions, clicks or spend, or reach and frequency instead), the spend for every channel, and control variables. Revenue per KPI unit, reach and frequency, organic media, non-media treatments and population per geo are optional. Weekly rows work best, and you need at least two years of weekly data for a geo model and three years for a national one. etlmcp gives you the daily cost, impressions and clicks of each ad platform; you roll them up to weeks and add the KPI and controls in your own database.

Required inputs

Input What Meridian expects
KPI The outcome the model explains, such as revenue or conversions. It must be a total that you can add across weeks and geos.
Media exposure One metric per paid channel, per geo and per period: impressions, clicks or spend. Values are never negative and must add up. A channel can use reach and frequency instead.
Media spend Spend per channel and period, with exactly the same dimensions as the media table. ROI is calculated from it.
Controls Variables that drive both your media and your KPI, such as market competition or Google query volume. Seasonality is handled by the model, so you do not add it.

Optional inputs

  • Revenue per KPI: the average value of one KPI unit, by geo and period. Leave it out when the KPI is already revenue; estimate it when you do not know it.
  • Reach and frequency: an alternative way to describe any channel. Frequency is impressions divided by reach for the period.
  • Organic media: activity you did not pay for, such as email, newsletters or social posts. It has no spend column.
  • Non-media treatments: things you control that cost no media, such as a promotion or a price change.
  • Geo population: used to scale media across regions of different size.

Grain: weekly, summable, one table

Meridian's guide treats weekly data as the best balance of signal and noise. Daily data is acceptable but can make the model take much longer to run, and monthly data risks a model that does not converge or estimates with very wide credible intervals.

Every input except reach and frequency has to be summable: adding two rows must give a meaningful total. Clicks, impressions, spend and units are fine. Rates and averages such as CTR, CPC or ROAS are not, because averaging them row by row gives the wrong figure. Google's guide says that for a rate like CTR you "should model the summable clicks instead."

The table has a date column, a geo column when you model by region, then the KPI, spend, exposure and control columns. Dates step forward by exactly seven days for weekly data, every geo covers the same weeks, and the history has no gaps. Google's examples use YYYY-MM-DD dates for weeks that begin on Monday.

Meridian models channels, not campaigns. Sum spend and exposure across all campaigns of a channel for each week, and make sure no impression or click is counted twice. The data-amount page also warns against campaign-level inputs: campaigns that stop and start abruptly do not suit the model's carryover effect.

Missing values

Fill every gap before you fit. A channel that did not run in a week gets 0. Do not put 0 into a missing KPI or control value, since that skews the estimate: use forward fill, backward fill, linear interpolation or the historical mean instead.

How much history

The collection guide sets the rule of thumb: two years of weekly data for geo-level models, three years for national models, and three years if all you have is monthly data. The data-amount page explains why with parameter counts. A national model with 12 channels, 6 controls and 8 knots has 26 parameters, so 104 weekly rows give only about 4 rows per parameter, which Google calls too few. Fewer channels, fewer knots or a third year of data raise that ratio. After fitting, check how wide the credible intervals are.

What etlmcp supplies, and what you add

etlmcp maps every ad platform onto the same five fields: cost, impressions, clicks, conversions and conversion_value. Each row is one day, and its network column names the platform, which is usually the channel you model. Those columns give you the exposure and spend inputs.

You add the rest:

  • Weeks. Rows are daily. Roll them up to weeks in the destination.
  • Geo. The rows carry account, campaign, ad group and ad, but no region column. Your etlmcp data therefore feeds a national model, which needs the longer three-year history.
  • Rates. A table can also have ctr, cpc, cpm and cpa columns. Never sum them or hand them to Meridian; use clicks, impressions and cost.
  • Currency. cost is in each ad account's own currency and is never converted. Every row says which, in currency, so convert or filter before you add accounts together.
  • KPI and controls. These come from your own sales and market data. When the Shopify connector is available, it reports daily store figures such as orders and net sales; its reference page lists them. Search volume and competitor data come from elsewhere.

In a PostgreSQL destination the date column has the date type, so the database can do the weekly roll-up. PostgreSQL follows ISO 8601 weeks, which begin on Monday, so date_trunc('week', …) gives the same week start as Google's examples. The query below builds one row per week from a calendar, so a week in which a channel did not run shows 0 rather than disappearing. Replace marketing.ad_facts with the schema and table your destination writes to, and set the dates to your history.

WITH weeks AS (
  SELECT generate_series(date '2023-01-02', date '2025-12-29', interval '7 days')::date AS week
), daily AS (
  SELECT date_trunc('week', date)::date AS week, network, cost, impressions, clicks
  FROM marketing.ad_facts
  WHERE currency = 'EUR'
)
SELECT w.week,
       coalesce(sum(d.cost)        FILTER (WHERE d.network = 'google'), 0) AS google_spend,
       coalesce(sum(d.clicks)      FILTER (WHERE d.network = 'google'), 0) AS google_clicks,
       coalesce(sum(d.cost)        FILTER (WHERE d.network = 'linkedin'), 0) AS linkedin_spend,
       coalesce(sum(d.impressions) FILTER (WHERE d.network = 'linkedin'), 0) AS linkedin_impressions
FROM weeks w
LEFT JOIN daily d ON d.week = w.week
GROUP BY w.week
ORDER BY w.week;

Join your weekly KPI and control columns to this result on week, and check that the last week is complete before you fit.

Keeping three years

How far back etlmcp keeps data depends on the plan: Free keeps 30 days, Starter 365, Team 365, Agency 730 and Scale 3650. If your plan keeps less than your model needs, start the weekly table early. See the history window for how the limit applies and backfills for pulling older days.

Related

Sources

  1. Collect and organize your data — developers.google.com, checked
  2. Amount of data needed — developers.google.com, checked
  3. Date/Time Functions and Operators — www.postgresql.org, checked