Skip to content
Draft
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ env/
env.bak/
venv/
venv.bak/
dbt_internal_packages/
10 changes: 8 additions & 2 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: 'ad_reporting'
version: '1.17.0'
version: '1.18.0'

profile: 'default'

config-version: 2

require-dbt-version: [">=1.6.0", "<2.0.0"]
require-dbt-version: [">=1.10.6"]

flags:
require_generic_test_arguments_property: true


vars:
ad_reporting:
Expand Down
185 changes: 97 additions & 88 deletions models/ad_reporting_models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ models:
description: Each record represents daily metrics by account.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- source_relation
- platform
- date_day
- account_id
arguments:
combination_of_columns:
- source_relation
- platform
- date_day
- account_id
columns:
- name: source_relation
description: '{{ doc("source_relation") }}'
Expand Down Expand Up @@ -41,13 +42,14 @@ models:
description: Each record represents daily metrics by ad group, campaign and account.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- source_relation
- platform
- date_day
- ad_group_id
- campaign_id
- account_id
arguments:
combination_of_columns:
- source_relation
- platform
- date_day
- ad_group_id
- campaign_id
- account_id
columns:
- name: source_relation
description: '{{ doc("source_relation") }}'
Expand Down Expand Up @@ -81,17 +83,18 @@ models:
description: '{{ doc("conversions_value") }}'

- name: ad_reporting__ad_report
description: Each record represents daily metrics by ad, ad group, campaign and account.
description: Each record represents daily metrics by ad, ad group, campaign and account.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- source_relation
- platform
- date_day
- ad_id
- ad_group_id
- campaign_id
- account_id
arguments:
combination_of_columns:
- source_relation
- platform
- date_day
- ad_id
- ad_group_id
- campaign_id
- account_id
columns:
- name: source_relation
description: '{{ doc("source_relation") }}'
Expand Down Expand Up @@ -121,7 +124,7 @@ models:
description: '{{ doc("clicks") }}'
- name: impressions
description: '{{ doc("impressions") }}'
- name: spend
- name: spend
description: '{{ doc("spend") }}'
- name: conversions
description: '{{ doc("conversions") }}'
Expand All @@ -132,12 +135,13 @@ models:
description: Each record represents daily metrics by campaign and account.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- source_relation
- platform
- date_day
- campaign_id
- account_id
arguments:
combination_of_columns:
- source_relation
- platform
- date_day
- campaign_id
- account_id
columns:
- name: source_relation
description: '{{ doc("source_relation") }}'
Expand All @@ -159,7 +163,7 @@ models:
description: '{{ doc("clicks") }}'
- name: impressions
description: '{{ doc("impressions") }}'
- name: spend
- name: spend
description: '{{ doc("spend") }}'
- name: conversions
description: '{{ doc("conversions") }}'
Expand All @@ -170,15 +174,16 @@ models:
description: Each record represents daily metrics by keyword, ad group, campaign and account.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- source_relation
- platform
- date_day
- keyword_id
- keyword_match_type
- ad_group_id
- campaign_id
- account_id
arguments:
combination_of_columns:
- source_relation
- platform
- date_day
- keyword_id
- keyword_match_type
- ad_group_id
- campaign_id
- account_id
columns:
- name: source_relation
description: '{{ doc("source_relation") }}'
Expand Down Expand Up @@ -210,27 +215,28 @@ models:
description: '{{ doc("clicks") }}'
- name: impressions
description: '{{ doc("impressions") }}'
- name: spend
- name: spend
description: '{{ doc("spend") }}'
- name: conversions
description: '{{ doc("conversions") }}'
- name: conversions_value
description: '{{ doc("conversions_value") }}'

- name: ad_reporting__search_report
description: Each record represents daily metrics by search query, ad group, campaign and account.
description: Each record represents daily metrics by search query, ad group, campaign and account.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- source_relation
- platform
- date_day
- search_query
- search_match_type
- keyword_id
- ad_group_id
- campaign_id
- account_id
arguments:
combination_of_columns:
- source_relation
- platform
- date_day
- search_query
- search_match_type
- keyword_id
- ad_group_id
- campaign_id
- account_id
columns:
- name: source_relation
description: '{{ doc("source_relation") }}'
Expand Down Expand Up @@ -264,35 +270,36 @@ models:
description: '{{ doc("clicks") }}'
- name: impressions
description: '{{ doc("impressions") }}'
- name: spend
description: '{{ doc("spend") }}'
- name: spend
description: '{{ doc("spend") }}'
- name: conversions
description: '{{ doc("conversions") }}'
- name: conversions_value
description: '{{ doc("conversions_value") }}'

- name: ad_reporting__url_report
description: Each record represents daily metrics by URL (and if applicable, URL UTM parameters), ad group, campaign and account.
description: Each record represents daily metrics by URL (and if applicable, URL UTM parameters), ad group, campaign and account.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- source_relation
- platform
- date_day
- ad_group_id
- campaign_id
- account_id
- base_url
- url_host
- url_path
- utm_campaign
- utm_content
- utm_medium
- utm_source
- utm_term
config:
# Below is so we don't run this test if the user has allowed urls to have null entries
enabled: "{{ var('ad_reporting__url_report__using_null_filter', True) }}"
arguments:
combination_of_columns:
- source_relation
- platform
- date_day
- ad_group_id
- campaign_id
- account_id
- base_url
- url_host
- url_path
- utm_campaign
- utm_content
- utm_medium
- utm_source
- utm_term
columns:
- name: source_relation
description: '{{ doc("source_relation") }}'
Expand Down Expand Up @@ -337,8 +344,8 @@ models:
description: '{{ doc("clicks") }}'
- name: impressions
description: '{{ doc("impressions") }}'
- name: spend
description: '{{ doc("spend") }}'
- name: spend
description: '{{ doc("spend") }}'
- name: conversions
description: '{{ doc("conversions") }}'
- name: conversions_value
Expand All @@ -348,13 +355,14 @@ models:
description: Each record represents monthly metrics by campaign and country. Country names are standardized to ISO-3166 names.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- source_relation
- platform
- date_month
- campaign_id
- account_id
- country
arguments:
combination_of_columns:
- source_relation
- platform
- date_month
- campaign_id
- account_id
- country
columns:
- name: source_relation
description: '{{ doc("source_relation") }}'
Expand All @@ -374,13 +382,13 @@ models:
description: '{{ doc("clicks") }}'
- name: impressions
description: '{{ doc("impressions") }}'
- name: spend
- name: spend
description: '{{ doc("spend") }}'
- name: conversions
description: '{{ doc("conversions") }}'
- name: conversions_value
description: '{{ doc("conversions_value") }}'
- name: country
- name: country
description: Standardized ISO-3166 name of the country where the campaign was served.
- name: country_code
description: ISO-3166 two-letter code of the country where the campaign was served.
Expand All @@ -391,13 +399,14 @@ models:
description: Each record represents monthly metrics by campaign and region (state, province, metropolitan area, etc.) provided by each platform.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- source_relation
- platform
- date_month
- campaign_id
- account_id
- region
arguments:
combination_of_columns:
- source_relation
- platform
- date_month
- campaign_id
- account_id
- region
columns:
- name: source_relation
description: '{{ doc("source_relation") }}'
Expand All @@ -417,11 +426,11 @@ models:
description: '{{ doc("clicks") }}'
- name: impressions
description: '{{ doc("impressions") }}'
- name: spend
- name: spend
description: '{{ doc("spend") }}'
- name: conversions
description: '{{ doc("conversions") }}'
- name: conversions_value
description: '{{ doc("conversions_value") }}'
- name: region
- name: region
description: Region the ad was served in. The formatting may vary across platforms. This may be a state, province, metropolitan area, etc. Snapchat Ads provides this as a two-letter abbreviation.
2 changes: 1 addition & 1 deletion packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ packages:
version: [">=0.13.0", "<0.14.0"]

- package: fivetran/reddit_ads
version: [">=0.7.0", "<0.8.0"]
version: [">=0.8.0", "<0.9.0"]

- package: fivetran/snapchat_ads
version: [">=0.10.0", "<0.11.0"]
Expand Down