Skip to content

Commit

Permalink
Merge pull request #89 from fivetran/feature/pinterest-keywords-varia…
Browse files Browse the repository at this point in the history
…ble-addition

feature/pinterest-keywords-variable-addition
  • Loading branch information
fivetran-joemarkiewicz authored Jun 8, 2023
2 parents 3cdbfbe + f44f96f commit 725dc7c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# dbt_ad_reporting v1.4.0

## 🎉 Feature Enhancement 🎉
- 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))
- 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.
Expand All @@ -23,6 +24,8 @@ vars:
- name: conversions
- name: local_spend_amount
```
- 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))

## Under the Hood:

- 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))
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,17 @@ vars:
### Enable/Disable Specific Reports within Platforms
For **Apple Search Ads**, if you are not utilizing the search functionality, you may choose to update the respective variable below.

For **Twitter Ads**, if you are tracking keyword performance, you may choose to update the corresponding variable below.
For **Twitter Ads**, if you are not tracking keyword performance, you may choose to update the corresponding variable below.

For **Pinterest Ads**, if you are not tracking keyword performance, you may choose to update the corresponding variable below.

Add the following variables to your dbt_project.yml file

```yml
vars:
apple_search_ads__using_search_terms: False # by default this is assumed to be True
twitter_ads__using_keywords: False # by default this is assumed to be True
pinterest__using_keywords: False # by default this is assumed to be True
```

## (Recommended) Step 5: Change the Build Schema
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions models/ad_reporting__keyword_report.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% if var('twitter_ads__using_keywords', True) %}
{% set include_list = ['amazon_ads', 'apple_search_ads', 'google_ads', 'microsoft_ads', 'pinterest_ads', 'twitter_ads'] %}
{% else %}
{% set include_list = ['amazon_ads', 'apple_search_ads', 'google_ads', 'microsoft_ads', 'pinterest_ads'] %}
{% endif %}
{% set include_list = ['amazon_ads', 'apple_search_ads', 'google_ads', 'microsoft_ads'] %}
{% do include_list.append('pinterest_ads') if var('pinterest__using_keywords', true) %}
{% do include_list.append('twitter_ads') if var('twitter_ads__using_keywords', true) %}

{% set enabled_packages = get_enabled_packages(include=include_list)%}
{{ config(enabled=is_enabled(enabled_packages)) }}
Expand Down
10 changes: 4 additions & 6 deletions models/intermediate/int_ad_reporting__keyword_report.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% if var('twitter_ads__using_keywords', True) %}
{% set include_list = ['amazon_ads', 'apple_search_ads', 'google_ads', 'microsoft_ads', 'pinterest_ads', 'twitter_ads'] %}
{% else %}
{% set include_list = ['amazon_ads', 'apple_search_ads', 'google_ads', 'microsoft_ads', 'pinterest_ads'] %}
{% endif %}
{% set include_list = ['amazon_ads', 'apple_search_ads', 'google_ads', 'microsoft_ads'] %}
{% do include_list.append('pinterest_ads') if var('pinterest__using_keywords', true) %}
{% do include_list.append('twitter_ads') if var('twitter_ads__using_keywords', true) %}

{% set enabled_packages = get_enabled_packages(include=include_list)%}
{{ config(enabled=is_enabled(enabled_packages)) }}
Expand Down Expand Up @@ -54,7 +52,7 @@ microsoft_ads as (
),
{% endif %}

{% if 'pinterest_ads' in enabled_packages %}
{% if 'pinterest_ads' in enabled_packages and var('pinterest__using_keywords', True) %}
pinterest_ads as (

{{ get_query(
Expand Down
8 changes: 6 additions & 2 deletions packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ packages:
- package: fivetran/google_ads
version: [">=0.9.0", "<0.10.0"]

- package: fivetran/pinterest
version: [">=0.7.0", "<0.8.0"]
# - package: fivetran/pinterest
# version: [">=0.7.0", "<0.8.0"]

- git: https://github.com/fivetran/dbt_pinterest.git
revision: feature/keywords-variable-addition
warn-unpinned: false

- package: fivetran/linkedin
version: [">=0.7.0", "<0.8.0"]
Expand Down

0 comments on commit 725dc7c

Please sign in to comment.