Skip to content

Commit 471846e

Browse files
Merge pull request #82 from fivetran/bugfix/metrics-warning
Bugfix/metrics-warning
2 parents 98d45ac + a0fb6ce commit 471846e

10 files changed

+29
-20
lines changed

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# dbt_ad_reporting v1.2.1
2+
3+
## Updates
4+
- Updating `ad_reporting_metrics.yml` to be up to date with [dbt Metrics documentation](https://docs.getdbt.com/docs/build/metrics#derived-metrics) ([PR #82](https://github.com/fivetran/dbt_ad_reporting/pull/82))
5+
6+
## Bug Fixes
7+
- Enabling additional Snapchat Ads columns in `ad_reporting__url_report` that were previously mapped to null values. ([#81](https://github.com/fivetran/dbt_ad_reporting/pull/81))
8+
- These columns are: ad_group_id (ad_squad_id), ad_group_name (ad_squad_name), campaign_id and campaign_name.
9+
10+
## Under the Hood
11+
- Swapped out `calculation_method: expression` for `calculation_method: derived` for derived metrics
12+
13+
## Contributors
14+
- [@dumkydewilde](https://github.com/dumkydewilde) ([#81](https://github.com/fivetran/dbt_ad_reporting/pull/81))
15+
116
# dbt_ad_reporting v1.2.0
217
## 🚨 Breaking Changes 🚨 and 🎉 Feature Enhancements 🎉
318
[PR #75](https://github.com/fivetran/dbt_ad_reporting/pull/75) includes the following new features:

README.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,9 @@ On top of the `ad_reporting__ad_report` final model, the Ad Reporting dbt packag
255255

256256
You can find the supported dimensions and full definitions of these metrics [here](https://github.com/fivetran/dbt_ad_reporting/blob/main/models/ad_reporting_metrics.yml).
257257

258-
To use dbt Metrics, add the [dbt metrics package](https://github.com/dbt-labs/dbt_metrics) to your project's `packages.yml` file:
259-
```yml
260-
packages:
261-
- package: dbt-labs/metrics
262-
version: [">=0.3.0", "<0.4.0"]
263-
```
264-
> **Note**: The Metrics package has stricter dbt version requirements. As of today, the latest version of Metrics (v0.3.5) requires dbt `[">=1.2.0-a1", "<2.0.0"]`.
258+
To use dbt Metrics, please refer to the [dbt metrics package](https://github.com/dbt-labs/dbt_metrics) and install the relevant version to your project's `packages.yml` file.
259+
260+
> **Note**: The Metrics package has stricter dbt version requirements, therefore, please take note of the correct dbt version for your desired version of dbt Metrics.
265261

266262
To utilize the Ad Reporting's pre-defined metrics in your code, refer to the [dbt metrics package](https://github.com/dbt-labs/dbt_metrics) usage instructions and the example below:
267263
```sql

dbt_project.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'ad_reporting'
2-
version: '1.2.0'
2+
version: '1.2.1'
33

44
config-version: 2
55

docs/catalog.json

+1-1
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.2.0'
2+
version: '1.2.1'
33
profile: 'integration_tests'
44
config-version: 2
55

models/ad_reporting_metrics.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ metrics:
7171
label: Average ad cost per click (Fivetran)
7272
description: The ratio of spend to clicks
7373

74-
calculation_method: expression
74+
calculation_method: derived
7575
expression: "{{ metric('spend') }} / {{ metric('clicks') }}"
7676

7777
timestamp: date_day
@@ -92,7 +92,7 @@ metrics:
9292
label: Average Ad Bounce Rate (Fivetran)
9393
description: Percentage of impressions that did not convert into clicks.
9494

95-
calculation_method: expression
95+
calculation_method: derived
9696
expression: "({{ metric('impressions') }} - {{ metric('clicks') }}) / {{ metric('impressions') }}"
9797

9898
timestamp: date_day
@@ -113,7 +113,7 @@ metrics:
113113
label: Ad Clickthrough Rate (Fivetran)
114114
description: Percentage of impressions that did convert into clicks.
115115

116-
calculation_method: expression
116+
calculation_method: derived
117117
expression: "{{ metric('clicks') }} / {{ metric('impressions') }}"
118118

119119
timestamp: date_day

models/intermediate/int_ad_reporting__url_report.sql

+2-4
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ snapchat_ads as (
7171
field_mapping={
7272
'account_id': 'ad_account_id',
7373
'account_name': 'ad_account_name',
74-
'campaign_id': 'null',
75-
'campaign_name': 'null',
76-
'ad_group_id': 'null',
77-
'ad_group_name': 'null',
74+
'ad_group_id': 'ad_squad_id',
75+
'ad_group_name': 'ad_squad_name',
7876
'clicks':'swipes'
7977
},
8078
relation=ref('snapchat_ads__url_report')

packages.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ packages:
44

55
- package: fivetran/snapchat_ads
66
version: [">=0.5.0", "<0.6.0"]
7-
7+
88
- package: fivetran/facebook_ads
99
version: [">=0.6.0", "<0.7.0"]
1010

0 commit comments

Comments
 (0)