Criteo (Marketing API) model

Campaign performance daily

Daily campaign performance with the rates the Criteo UI shows: CTR, CPC, CPM, cost per order (CPO), conversion rate and ROAS.

Grain
date_day x account_id x campaign_id
Built from
  1. 5
    Raw tables
  2. 5
    Staging
  3. 2
    Core
  4. 1
    Analytics
Reads from Criteo (Marketing API)
adad_statistics_daily_reportadsetadvertisercampaign
Ships as
Weld and dbt SQL, open source on GitHub
core.criteo.campaign_performance_daily
1-- core.criteo.campaign_performance_daily
2-- Daily campaign performance with the rates the Criteo UI shows: CTR, CPC, CPM,
3-- cost per order (CPO), conversion rate and ROAS.
4--
5-- Grain: date_day x account_id x campaign_id. Currency: the connector setting.
6-- Depends on: core.criteo.ad_performance_daily
7--
8-- Built from the ad report, including the "-1" placeholder ad, so spend ties to
9-- the campaign totals in Criteo. Rates are ratios of sums at this grain. To
10-- report a week or a month, re-sum the base columns and divide again; averaging
11-- the daily rates weights a quiet day the same as a busy one.
12
13SELECT
14    date_day,
15    account_id,
16    account_name,
17    currency,
18    campaign_id,
19    campaign_name,
20    campaign_goal,
21
22    SUM(spend)            AS spend,
23    SUM(impressions)      AS impressions,
24    SUM(clicks)           AS clicks,
25    SUM(conversions)      AS conversions,
26    SUM(conversion_value) AS conversion_value,
27    COUNT(DISTINCT IF(ad_id != '-1', ad_id, NULL)) AS active_ads,
28
29    SAFE_DIVIDE(SUM(clicks), SUM(impressions))       AS ctr,
30    SAFE_DIVIDE(SUM(spend), SUM(clicks))             AS cpc,
31    SAFE_DIVIDE(SUM(spend), SUM(impressions)) * 1000 AS cpm,
32    SAFE_DIVIDE(SUM(spend), SUM(conversions))        AS cost_per_order,
33    SAFE_DIVIDE(SUM(conversions), SUM(clicks))       AS conversion_rate,
34    SAFE_DIVIDE(SUM(conversion_value), SUM(spend))   AS roas
35FROM {{core.criteo.ad_performance_daily}}
36GROUP BY 1, 2, 3, 4, 5, 6, 7

This model and the 7 it depends on. Deploy them together; refs like {{staging.…}} resolve to the matching folders in Weld, and the dbt view uses source() and ref().

Notes

How it counts. And where it stops.

Built from the ad report, including the "-1" placeholder ad, so spend ties to the campaign totals in Criteo. Rates are ratios of sums at this grain. To report a week or a month, re-sum the base columns and divide again; averaging the daily rates weights a quiet day the same as a busy one.

Raw tables it reads

  • raw.criteo.ad
  • raw.criteo.ad_statistics_daily_report
  • raw.criteo.adset
  • raw.criteo.advertiser
  • raw.criteo.campaign

More Criteo (Marketing API) models

Put Criteo (Marketing API) in front
of your agents.

Connect Criteo (Marketing API), deploy the models, and ask questions in Claude, Cursor or ChatGPT. Free for 14 days, no credit card.