Marketing Insights Dashboard
This SQL template consolidates advertising data from multiple platforms, including Facebook, Google, LinkedIn, TikTok, Snapchat, and Pinterest, into a unified dataset. It aggregates metrics such as clicks, impressions, spend, and conversions, and calculates performance indicators like CTR, CPC, CPM, and conversion rate. The result is grouped by date, platform, account, campaign, and ad identifiers for comprehensive marketing insights.
- Grain
- day x platform x account x campaign x ad
- Built from
- 1Raw tables
- 1Staging
- 1Core
- 1Analytics
- Reads from Google Ads
- ad_stats
- Ships as
- Weld and dbt SQL, open source on GitHub
1-- core.google_ads.marketing_report
2-- Marketing Insights Dashboard. This SQL template consolidates advertising data
3-- from multiple platforms, including Facebook, Google, LinkedIn, TikTok, Snapchat,
4-- and Pinterest, into a unified dataset. It aggregates metrics such as clicks,
5-- impressions, spend, and conversions, and calculates performance indicators like
6-- CTR, CPC, CPM, and conversion rate. The result is grouped by date, platform,
7-- account, campaign, and ad identifiers for comprehensive marketing insights.
8--
9-- Grain: day x platform x account x campaign x ad. Spend and conversion value
10-- are in each account's own currency; nothing is converted, so totals across
11-- platforms only add up when the accounts share a currency. ctr and
12-- conversion_rate are percentages; all rates are worked out from totals.
13-- LinkedIn campaign groups fill the campaign columns and LinkedIn creatives the
14-- ad columns. Snapchat rows have no campaign.
15--
16-- Only the Google Ads block is active. Each other platform reads that platform's
17-- staging ad report (google-ads/, facebook-ads/, linkedin-ads/, tiktok-ads/,
18-- snapchat-ads/, pinterest-ads/ in this repo). Deploy the ones you use, then
19-- remove the comment markers around their blocks; delete the rest.
20--
21-- From the weld.app template library, corrected. Not reconciled against the ad
22-- platforms; check the output against each source before relying on it.
23
24with
25 all_data as (
26 select
27 date_day,
28 'google' as platform,
29 cast(account_id as string) as account_id,
30 account_name,
31 cast(campaign_id as string) as campaign_id,
32 campaign_name,
33 cast(ad_id as string) as ad_id,
34 ad_name,
35 clicks,
36 impressions,
37 spend,
38 conversions,
39 conversions_value as conversion_value
40 fromThis model and the 2 it depends on. Deploy them together; refs like {{staging.…}} resolve to the matching folders in Weld, and the dbt view uses source() and ref().
How it counts. And where it stops.
The "Marketing Insights" SQL model aggregates advertising data from multiple platforms including Facebook, Google, LinkedIn, TikTok, Snapchat, and Pinterest. It consolidates metrics such as clicks, impressions, spend, conversions, and conversion value across these platforms into a unified dataset. This model calculates key performance indicators (KPIs) like click-through rate (CTR), cost per click (CPC), cost per thousand impressions (CPM), and conversion rate, providing a comprehensive view of marketing performance. By using this SQL model, marketers can gain valuable insights into the effectiveness of their campaigns, compare performance across different platforms, and optimize their advertising strategies for better ROI.
Raw tables it reads
- raw.google_ads.ad_stats
More Google Ads models
Put Google Ads in front
of your agents.
Connect Google Ads, deploy the models, and ask questions in Claude, Cursor or ChatGPT. Free for 14 days, no credit card.