Pinterest Ads model

Campaign performance daily

Daily campaign performance with the rates Ads Manager shows: CTR, CPC, CPM, cost per conversion and checkout 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 Pinterest Ads
adad_accountad_groupad_reportcampaign
Ships as
Weld and dbt SQL, open source on GitHub
core.pinterest_ads.campaign_performance_daily
1-- core.pinterest_ads.campaign_performance_daily
2-- Daily campaign performance with the rates Ads Manager shows: CTR, CPC, CPM,
3-- cost per conversion and checkout ROAS.
4--
5-- Grain: date_day x account_id x campaign_id. Currency: the ad account's.
6-- Depends on: core.pinterest_ads.ad_performance_daily
7--
8-- Summed from ads, so it uses the same definitions: conversions are all conversion
9-- events, conversion_value is checkout value, Pinterest's default attribution
10-- (30 day click, 30 day engagement, 1 day view). Rates are ratios of sums at this
11-- grain; never average the daily rates.
12
13SELECT
14    date_day,
15    account_id,
16    account_name,
17    currency,
18    campaign_id,
19    campaign_name,
20    campaign_objective,
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
28    SAFE_DIVIDE(SUM(clicks), SUM(impressions))             AS ctr,
29    SAFE_DIVIDE(SUM(spend), SUM(clicks))                   AS cpc,
30    SAFE_DIVIDE(SUM(spend), SUM(impressions)) * 1000       AS cpm,
31    SAFE_DIVIDE(SUM(spend), SUM(conversions))              AS cost_per_conversion,
32    SAFE_DIVIDE(SUM(conversion_value), SUM(spend))         AS roas,
33
34    'pinterest_ads'                 AS source,
35    SUM(earned_impressions)         AS earned_impressions,
36    SUM(paid_outbound_clicks)       AS paid_outbound_clicks,
37    SUM(signups)                    AS signups,
38    SUM(checkout_value_click)       AS checkout_value_click,
39    SUM(checkout_value_view)        AS checkout_value_view,
40    COUNT(DISTINCT IF(impressions > 0, ad_id, NULL)) AS ads_with_impressions

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.

Summed from ads, so it uses the same definitions: conversions are all conversion events, conversion_value is checkout value, Pinterest's default attribution (30 day click, 30 day engagement, 1 day view). Rates are ratios of sums at this grain; never average the daily rates.

Raw tables it reads

  • raw.pinterest_ads.ad
  • raw.pinterest_ads.ad_account
  • raw.pinterest_ads.ad_group
  • raw.pinterest_ads.ad_report
  • raw.pinterest_ads.campaign

Put Pinterest Ads in front
of your agents.

Connect Pinterest Ads, deploy the models, and ask questions in Claude, Cursor or ChatGPT. Free for 14 days, no credit card.