Skip to content

Commit cb0738c

Browse files
Merge pull request #90 from fivetran/release/v1.4.0
release/v1.4.0
2 parents 25a1a50 + 10dfc33 commit cb0738c

17 files changed

+392
-43
lines changed

CHANGELOG.md

+34-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,39 @@
1-
# dbt_ad_reporting v1.UPDATE.UPDATE
1+
# dbt_ad_reporting v1.4.0
22

3-
## Under the Hood:
3+
## 🎉 Feature Enhancement 🎉
4+
- Added `ad_reporting__<report>_passthrough_metrics` variables to easily add common metrics across all platforms into the `ad_reporting` models! This allows metrics other than the standard `clicks`, `impressions`, and `cost` to be included in the final ad reporting models. See below for a full list of new variables and example metrics to passthrough. ([PR #85](https://github.com/fivetran/dbt_ad_reporting/pull/84))
5+
- It is important to call out that this is only possible if the relevant upstream Ad platform variables have the same metric to be unioned in the roll up model. Please see the [README](https://github.com/fivetran/dbt_ad_reporting#optional-step-6-additional-configurations) section for details around how to configure the passthrough metrics.
6+
- Please ensure you exercised due diligence when adding metrics to these models. The metrics added by default (`clicks`, `impressions`, and `cost`) have been vetted by the Fivetran team maintaining this package for accuracy. There are metrics included within the source reports, for example metric averages, which may be inaccurately represented at the grain for reports created in this package. You will want to ensure whichever metrics you pass through are indeed appropriate to aggregate at the respective reporting levels provided in this package.
7+
```yml
8+
vars:
9+
ad_reporting__account_passthrough_metrics:
10+
- name: conversions
11+
- name: view_through_conversions
12+
ad_reporting__campaign_passthrough_metrics:
13+
- name: total_shares
14+
- name: conversions
15+
ad_reporting__ad_group_passthrough_metrics:
16+
- name: conversions
17+
- name: interactions
18+
ad_reporting__ad_passthrough_metrics: ## For both Ad and URL reports
19+
- name: conversions
20+
- name: video_views_captured
21+
ad_reporting__keyword_passthrough_metrics:
22+
- name: interactions
23+
ad_reporting__search_passthrough_metrics:
24+
- name: conversions
25+
- name: local_spend_amount
26+
```
27+
- Addition of the `pinterest__using_keywords` (default=`true`) variable that allows users to disable the relevant keyword reports in the downstream Pinterest models if they are not used. ([PR #89](https://github.com/fivetran/dbt_ad_reporting/pull/89))
28+
29+
## Under the Hood:
30+
31+
- Incorporated the new `fivetran_utils.drop_schemas_automation` macro into the end of each Buildkite integration test job. ([PR #86](https://github.com/fivetran/dbt_ad_reporting/pull/86))
32+
- Updated the pull request [templates](/.github). ([PR #86](https://github.com/fivetran/dbt_ad_reporting/pull/86))
33+
34+
## Contributors
35+
- [@aleix-cd](https://github.com/aleix-cd) ([PR #85](https://github.com/fivetran/dbt_ad_reporting/pull/84))
436

5-
- Incorporated the new `fivetran_utils.drop_schemas_automation` macro into the end of each Buildkite integration test job.
6-
- Updated the pull request [templates](/.github).
737
# dbt_ad_reporting v1.3.1
838

939
## Updates

README.md

+209-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Include the following github package version in your `packages.yml`
7777
```yaml
7878
packages:
7979
- package: fivetran/ad_reporting
80-
version: [">=1.3.0", "<1.4.0"] # we recommend using ranges to capture non-breaking changes automatically
80+
version: [">=1.4.0", "<1.5.0"] # we recommend using ranges to capture non-breaking changes automatically
8181
```
8282

8383
Do NOT include the individual ad platform packages in this file. The ad reporting package itself has dependencies on these packages and will install them as well.
@@ -145,14 +145,17 @@ vars:
145145
### Enable/Disable Specific Reports within Platforms
146146
For **Apple Search Ads**, if you are not utilizing the search functionality, you may choose to update the respective variable below.
147147

148-
For **Twitter Ads**, if you are tracking keyword performance, you may choose to update the corresponding variable below.
148+
For **Twitter Ads**, if you are not tracking keyword performance, you may choose to update the corresponding variable below.
149+
150+
For **Pinterest Ads**, if you are not tracking keyword performance, you may choose to update the corresponding variable below.
149151

150152
Add the following variables to your dbt_project.yml file
151153

152154
```yml
153155
vars:
154156
apple_search_ads__using_search_terms: False # by default this is assumed to be True
155157
twitter_ads__using_keywords: False # by default this is assumed to be True
158+
pinterest__using_keywords: False # by default this is assumed to be True
156159
```
157160

158161
## (Recommended) Step 5: Change the Build Schema
@@ -225,6 +228,210 @@ models:
225228
<details><summary>Expand for details</summary>
226229
<br>
227230

231+
## Adding custom metrics to final reports
232+
233+
By default, this package selects `clicks`, `impressions`, and `cost` metrics from the upstream Ad platform reports. Additionally, each specific upstream Ad platform package allows for custom passthrough metrics to be included in the individual platform's final reports. You can find a complete list of available passthrough metric variables for each platform by referring to the relevant links below and inspecting the additional configurations for each platform:
234+
- [Amazon Ads](https://github.com/fivetran/dbt_amazon_ads#optional-step-5-additional-configurations)
235+
- [Apple Search Ads](https://github.com/fivetran/dbt_apple_search_ads#optional-step-4-additional-configurations)
236+
- [Facebook Ads](https://github.com/fivetran/dbt_facebook_ads#optional-step-4-additional-configurations)
237+
- [Google Ads](https://github.com/fivetran/dbt_google_ads#optional-step-4-additional-configurations)
238+
- [LinkedIn Ad Analytics](https://github.com/fivetran/dbt_linkedin#optional-step-4-additional-configurations)
239+
- [Microsoft Advertising](https://github.com/fivetran/dbt_microsoft_ads#optional-step-4-additional-configurations)
240+
- [Pinterest Ads](https://github.com/fivetran/dbt_pinterest#optional-step-4-additional-configurations)
241+
- [Snapchat Ads](https://github.com/fivetran/dbt_snapchat_ads#optional-step-4-additional-configurations)
242+
- [TikTok Ads](https://github.com/fivetran/dbt_tiktok_ads#optional-step-4-additional-configurations)
243+
- [Twitter Ads](https://github.com/fivetran/dbt_twitter#optional-step-5-additional-configurations)
244+
- [Reddit Ads](https://github.com/fivetran/dbt_reddit_ads#optional-step-4-additional-configurations)
245+
246+
Furthermore, this package allows you to include these configured upstream passthrough metrics in the final roll-up models of the combined Ad Reporting package. To include passthrough metrics in the respective final models, you need to define the following `ad_reporting__*` variables in your `dbt_project.yml` file:
247+
248+
```yml
249+
vars:
250+
ad_reporting__account_passthrough_metrics:
251+
- name: conversions
252+
- name: view_through_conversions
253+
ad_reporting__campaign_passthrough_metrics:
254+
- name: total_shares
255+
- name: conversions
256+
ad_reporting__ad_group_passthrough_metrics:
257+
- name: conversions
258+
- name: interactions
259+
ad_reporting__ad_passthrough_metrics: ## For both Ad and URL reports
260+
- name: conversions
261+
- name: video_views_captured
262+
ad_reporting__keyword_passthrough_metrics:
263+
- name: interactions
264+
ad_reporting__search_passthrough_metrics:
265+
- name: conversions
266+
- name: local_spend_amount
267+
```
268+
It is important to ensure that if you want to configure a passthrough metric for an ad reporting end model, that metric **must** be included in all of your upstream variables. Additionally, the name of the metric **must** be consistent across platforms. If a certain upstream platform does not include the metric you **must** include a `transform_sql` argument to pass a null value through (see below for examples). The following configuration is an example when using the Microsoft Ads, Apple Search Ads, Google Ads, Snapchat Ads, TikTok Ads, and Reddit Ads platforms within a `dbt_project.yml` file:
269+
270+
>**Note**: Please ensure you exercised due diligence when adding metrics to these models. The metrics added by default (`clicks`, `impressions`, and `cost`) have been vetted by the Fivetran team maintaining this package for accuracy. There are metrics included within the source reports, for example metric averages, which may be inaccurately represented at the grain for reports created in this package. You will want to ensure whichever metrics you pass through are indeed appropriate to aggregate at the respective reporting levels provided in this package.
271+
272+
>**Note**: While the below configuration is only for a subset of Ad platforms, the same strategy will be used for all other possible combinations of upstream Ad platform dependencies.
273+
274+
```yml
275+
vars:
276+
## Account Report Passthrough Metrics
277+
microsoft_ads__account_passthrough_metrics:
278+
- name: conversions
279+
- name: view_through_conversions
280+
transform_sql: "null"
281+
apple_search_ads__campaign_passthrough_metrics:
282+
- name: conversions
283+
- name: view_through_conversions
284+
transform_sql: "null"
285+
- name: total_shares
286+
transform_sql: "null"
287+
google_ads__account_stats_passthrough_metrics:
288+
- name: conversions
289+
- name: view_through_conversions
290+
# snapchat_ads__ad_hourly_passthrough_metrics: # Defined below in the ad/url metrics therefore, not needed here but kept for documentation.
291+
# - name: conversion_view_content
292+
# alias: view_through_conversions
293+
# - name: conversion_sign_ups
294+
# alias: conversions
295+
tiktok_ads__ad_hourly_passthrough_metrics:
296+
- name: conversion
297+
alias: conversions
298+
- name: view_through_conversions
299+
transform_sql: "null"
300+
reddit_ads__account_passthrough_metrics:
301+
- name: conversion_roas
302+
alias: conversions
303+
- name: legacy_view_conversions_attribution_window_day
304+
alias: view_through_conversions
305+
ad_reporting__account_passthrough_metrics:
306+
- name: conversions
307+
- name: view_through_conversions
308+
309+
## Campaign Report Passthrough Metrics
310+
microsoft_ads__campaign_passthrough_metrics:
311+
- name: conversions
312+
- name: total_shares
313+
transform_sql: "null"
314+
google_ads__campaign_stats_passthrough_metrics:
315+
- name: conversions
316+
- name: total_shares
317+
transform_sql: cast(total_shares as int)
318+
snapchat_ads__campaign_hourly_report_passthrough_metrics:
319+
- name: conversion_sign_ups
320+
alias: conversions
321+
- name: shares
322+
alias: total_shares
323+
tiktok_ads__campaign_hourly_passthrough_metrics:
324+
- name: conversion
325+
alias: conversions
326+
- name: shares
327+
alias: total_shares
328+
reddit_ads__campaign_passthrough_metrics:
329+
- name: conversions
330+
transform_sql: "null"
331+
- name: total_shares
332+
transform_sql: "null"
333+
ad_reporting__campaign_passthrough_metrics:
334+
- name: total_shares
335+
- name: conversions
336+
337+
## Ad Group Report Passthrough Metrics
338+
microsoft_ads__ad_group_passthrough_metrics:
339+
- name: conversions
340+
- name: phone_calls
341+
alias: interactions
342+
apple_search_ads__ad_group_passthrough_metrics:
343+
- name: conversions
344+
- name: new_downloads
345+
alias: interactions
346+
google_ads__ad_group_stats_passthrough_metrics:
347+
- name: conversions
348+
- name: interactions
349+
snapchat_ads__ad_squad_hourly_passthrough_metrics:
350+
- name: conversion_add_cart
351+
alias: conversions
352+
- name: saves
353+
alias: interactions
354+
tiktok_ads__ad_group_hourly_passthrough_metrics:
355+
- name: conversion
356+
alias: conversions
357+
- name: likes
358+
alias: interactions
359+
reddit_ads__ad_group_passthrough_metrics:
360+
- name: conversion_roas
361+
alias: conversions
362+
- name: video_started
363+
alias: interactions
364+
ad_reporting__ad_group_passthrough_metrics:
365+
- name: conversions
366+
- name: interactions
367+
368+
## Ad and URL Report Passthrough Metrics
369+
microsoft_ads__ad_passthrough_metrics:
370+
- name: conversions
371+
- name: video_views_captured
372+
transform_sql: "null"
373+
apple_search_ads__ad_passthrough_metrics:
374+
- name: conversions
375+
- name: video_views_captured
376+
transform_sql: "null"
377+
google_ads__ad_stats_passthrough_metrics:
378+
- name: video_views
379+
alias: video_views_captured
380+
transform_sql: cast(video_views_captured as int64)
381+
- name: conversions
382+
snapchat_ads__ad_hourly_passthrough_metrics:
383+
- name: conversion_view_content
384+
alias: view_through_conversions
385+
- name: conversion_sign_ups
386+
alias: conversions
387+
- name: video_views
388+
alias: video_views_captured
389+
transform_sql: cast(video_views_captured as int64)
390+
tiktok_ads__ad_hourly_passthrough_metrics:
391+
- name: conversion
392+
alias: conversions
393+
- name: view_through_conversions
394+
transform_sql: "null"
395+
- name: video_watched_2_s
396+
alias: video_views_captured
397+
transform_sql: cast(video_views_captured as int64)
398+
reddit_ads__ad_passthrough_metrics:
399+
- name: conversion_roas
400+
alias: conversions
401+
- name: video_watched_3_seconds
402+
alias: video_views_captured
403+
transform_sql: cast(video_views_captured as int64)
404+
ad_reporting__ad_passthrough_metrics:
405+
- name: conversions
406+
- name: video_views_captured
407+
408+
# Keyword Report Passthrough Metrics
409+
microsoft_ads__keyword_passthrough_metrics:
410+
- name: interactions
411+
transform_sql: "null"
412+
apple_search_ads__keyword_passthrough_metrics:
413+
- name: new_downloads
414+
alias: interactions
415+
google_ads__keyword_stats_passthrough_metrics:
416+
- name: interactions
417+
ad_reporting__keyword_passthrough_metrics:
418+
- name: interactions
419+
420+
# Search Report Passthrough Metrics
421+
microsoft_ads__search_passthrough_metrics:
422+
- name: conversions
423+
- name: local_spend_amount
424+
transform_sql: "null"
425+
apple_search_ads__search_term_passthrough_metrics:
426+
- name: local_spend_amount
427+
transform_sql: "cast(local_spend_amount as int64)"
428+
- name: conversions
429+
transform_sql: "null"
430+
ad_reporting__search_passthrough_metrics:
431+
- name: conversions
432+
- name: local_spend_amount
433+
```
434+
228435
## Disabling null URL filtering from URL reports
229436
The default behavior for the `ad_reporting__url_report` end model is to filter out records having null URL fields, however, you are able to turn off this filter if needed. To turn off the filter, include the below in your `dbt_project.yml` file. This variable will affect ALL Fivetran platform packages enabled in Ad Reporting, therefore either all URL reports will have null URLs filtered, or all URL reports will have null URLs included.
230437

dbt_project.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
name: 'ad_reporting'
2-
version: '1.3.1'
2+
version: '1.4.0'
33

44
config-version: 2
55

66
require-dbt-version: [">=1.3.0", "<2.0.0"]
77

8+
vars:
9+
ad_reporting:
10+
ad_reporting__account_passthrough_metrics: []
11+
ad_reporting__campaign_passthrough_metrics: []
12+
ad_reporting__ad_group_passthrough_metrics: []
13+
ad_reporting__ad_passthrough_metrics: []
14+
ad_reporting__keyword_passthrough_metrics: []
15+
ad_reporting__search_passthrough_metrics: []
16+
817
models:
918
ad_reporting:
1019
+materialized: table
1120
+schema: ad_reporting
1221
intermediate:
1322
+materialized: ephemeral
14-
+schema: int_ad_reporting
23+
+schema: int_ad_reporting

docs/catalog.json

+1-1
Large diffs are not rendered by default.

docs/index.html

+2-2
Large diffs are not rendered by default.

docs/manifest.json

+1-1
Large diffs are not rendered by default.

docs/run_results.json

+1-1
Large diffs are not rendered by default.

integration_tests/dbt_project.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'ad_reporting_integration_tests'
2-
version: '1.3.1'
2+
version: '1.4.0'
33
profile: 'integration_tests'
44
config-version: 2
55

0 commit comments

Comments
 (0)