Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/pinterest-keywords-variable-addition #89

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Comment on lines +14 to 20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standard reminder.

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