Microsoft Ads model

Ad group performance daily

Daily ad group performance, the Microsoft Advertising "Ad groups" report by day.

Grain
date_day x account_id x ad_group_id
Built from
  1. 4
    Raw tables
  2. 4
    Staging
  3. 1
    Core
  4. 1
    Analytics
Reads from Microsoft Ads
accountad_groupad_group_performance_daily_reportcampaign
Ships as
Weld and dbt SQL, open source on GitHub
core.microsoft_ads.ad_group_performance_daily
1-- core.microsoft_ads.ad_group_performance_daily
2-- Daily ad group performance, the Microsoft Advertising "Ad groups" report by day.
3--
4-- Grain: date_day x account_id x ad_group_id. Currency: the account's.
5-- Depends on: staging.microsoft_ads.ad_group_performance_daily_report,
6-- .ad_group, .campaign, .account
7--
8-- Read from the ad group report rather than summed from ads, so ad groups whose
9-- ads were deleted still carry their full delivery. Performance Max has no ad
10-- groups and is not in it.
11--
12-- conversions counts the conversion goals set to "Include in conversions",
13-- under each goal's own conversion window, dated on the day of the ad click.
14-- conversion_value is the matching revenue. all_conversions and all_revenue count
15-- every goal, including those left out of conversions. View-through
16-- conversions are also carried on their own.
17
18WITH daily AS (
19    SELECT
20        date_day,
21        account_id,
22        ad_group_id,
23        MAX(campaign_id)              AS campaign_id,
24        MAX(currency)                 AS report_currency,
25        SUM(spend)                    AS spend,
26        SUM(impressions)              AS impressions,
27        SUM(clicks)                   AS clicks,
28        SUM(conversions)              AS conversions,
29        SUM(revenue)                  AS conversion_value,
30        SUM(all_conversions)          AS all_conversions,
31        SUM(all_revenue)              AS all_revenue,
32        SUM(view_through_conversions) AS view_through_conversions
33    FROM {{staging.microsoft_ads.ad_group_performance_daily_report}}
34    GROUP BY 1, 2, 3
35)
36
37SELECT
38    d.date_day,
39    d.account_id,
40    acc.account_name,

This model and the 5 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.

Read from the ad group report rather than summed from ads, so ad groups whose ads were deleted still carry their full delivery. Performance Max has no ad groups and is not in it. conversions counts the conversion goals set to "Include in conversions", under each goal's own conversion window, dated on the day of the ad click. conversion_value is the matching revenue. all_conversions and all_revenue count every goal, including those left out of conversions. View-through conversions are also carried on their own.

Raw tables it reads

  • raw.microsoft_ads.account
  • raw.microsoft_ads.ad_group
  • raw.microsoft_ads.ad_group_performance_daily_report
  • raw.microsoft_ads.campaign

Put Microsoft Ads in front
of your agents.

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