Skip to content

Commit

Permalink
Merge pull request #82 from fivetran/bugfix/metrics-warning
Browse files Browse the repository at this point in the history
Bugfix/metrics-warning
  • Loading branch information
fivetran-sheringuyen authored Feb 21, 2023
2 parents 98d45ac + a0fb6ce commit 471846e
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 20 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# dbt_ad_reporting v1.2.1

## Updates
- 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))

## Bug Fixes
- 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))
- These columns are: ad_group_id (ad_squad_id), ad_group_name (ad_squad_name), campaign_id and campaign_name.

## Under the Hood
- Swapped out `calculation_method: expression` for `calculation_method: derived` for derived metrics

## Contributors
- [@dumkydewilde](https://github.com/dumkydewilde) ([#81](https://github.com/fivetran/dbt_ad_reporting/pull/81))

# dbt_ad_reporting v1.2.0
## 🚨 Breaking Changes 🚨 and 🎉 Feature Enhancements 🎉
[PR #75](https://github.com/fivetran/dbt_ad_reporting/pull/75) includes the following new features:
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,9 @@ On top of the `ad_reporting__ad_report` final model, the Ad Reporting dbt packag

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).

To use dbt Metrics, add the [dbt metrics package](https://github.com/dbt-labs/dbt_metrics) to your project's `packages.yml` file:
```yml
packages:
- package: dbt-labs/metrics
version: [">=0.3.0", "<0.4.0"]
```
> **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"]`.
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.

> **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.

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:
```sql
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'ad_reporting'
version: '1.2.0'
version: '1.2.1'

config-version: 2

Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/run_results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'ad_reporting_integration_tests'
version: '1.2.0'
version: '1.2.1'
profile: 'integration_tests'
config-version: 2

Expand Down
6 changes: 3 additions & 3 deletions models/ad_reporting_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ metrics:
label: Average ad cost per click (Fivetran)
description: The ratio of spend to clicks

calculation_method: expression
calculation_method: derived
expression: "{{ metric('spend') }} / {{ metric('clicks') }}"

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

calculation_method: expression
calculation_method: derived
expression: "({{ metric('impressions') }} - {{ metric('clicks') }}) / {{ metric('impressions') }}"

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

calculation_method: expression
calculation_method: derived
expression: "{{ metric('clicks') }} / {{ metric('impressions') }}"

timestamp: date_day
Expand Down
6 changes: 2 additions & 4 deletions models/intermediate/int_ad_reporting__url_report.sql
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ snapchat_ads as (
field_mapping={
'account_id': 'ad_account_id',
'account_name': 'ad_account_name',
'campaign_id': 'null',
'campaign_name': 'null',
'ad_group_id': 'null',
'ad_group_name': 'null',
'ad_group_id': 'ad_squad_id',
'ad_group_name': 'ad_squad_name',
'clicks':'swipes'
},
relation=ref('snapchat_ads__url_report')
Expand Down
2 changes: 1 addition & 1 deletion packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ packages:

- package: fivetran/snapchat_ads
version: [">=0.5.0", "<0.6.0"]

- package: fivetran/facebook_ads
version: [">=0.6.0", "<0.7.0"]

Expand Down

0 comments on commit 471846e

Please sign in to comment.