Skip to content

Commit

Permalink
Merge pull request #26 from fivetran/feature/fb-account-fields
Browse files Browse the repository at this point in the history
Feature - add fb account fields
  • Loading branch information
fivetran-jamie authored Oct 4, 2021
2 parents 270efac + 33ab7b2 commit 6aa47a0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
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: '0.4.0'
version: '0.4.1'
config-version: 2

require-dbt-version: [">=0.20.0"]
Expand Down
5 changes: 4 additions & 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: '0.4.0'
version: '0.4.1'
profile: 'integration_tests'
config-version: 2

Expand Down Expand Up @@ -95,10 +95,12 @@ seeds:
+column_types:
created_time: timestamp
last_modified_time: timestamp
account_id: "{{ 'int64' if target.name == 'bigquery' else 'bigint' }}"
linkedin_campaign_history_data:
+column_types:
created_time: timestamp
last_modified_time: timestamp
account_id: "{{ 'int64' if target.name == 'bigquery' else 'bigint' }}"

### Twitter Seeds

Expand Down Expand Up @@ -165,6 +167,7 @@ seeds:
facebook_ads_account_history_data:
+column_types:
id: "{{ 'int64' if target.name == 'bigquery' else 'bigint' }}"
name: "{{ 'string' if target.name in ['bigquery','spark'] else 'varchar' }}"
facebook_ads_ad_history_data:
+column_types:
id: "{{ 'int64' if target.name == 'bigquery' else 'bigint' }}"
Expand Down
4 changes: 3 additions & 1 deletion models/stg_facebook_ads.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ with base as (

select
cast(date_day as date) as date_day,
account_name,
cast(account_id as {{ dbt_utils.type_string() }}) as account_id,
base_url,
url_host,
url_path,
Expand All @@ -26,7 +28,7 @@ with base as (
sum(coalesce(impressions, 0)) as impressions,
sum(coalesce(spend, 0)) as spend
from base
{{ dbt_utils.group_by(14) }}
{{ dbt_utils.group_by(16) }}


)
Expand Down
2 changes: 1 addition & 1 deletion models/stg_google_ads.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with base as (
'Google Ads' as platform,
cast(date_day as date) as date_day,
account_name,
external_customer_id as account_id,
cast(external_customer_id as {{ dbt_utils.type_string() }}) as account_id,
campaign_name,
cast(campaign_id as {{ dbt_utils.type_string() }}) as campaign_id,
ad_group_name,
Expand Down
2 changes: 1 addition & 1 deletion models/stg_linkedin_ads.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with base as (
'LinkedIn Ads' as platform,
cast(date_day as date) as date_day,
account_name,
account_id,
cast(account_id as {{ dbt_utils.type_string() }}) as account_id,
campaign_group_name as campaign_name,
cast(campaign_group_id as {{ dbt_utils.type_string() }}) as campaign_id,
campaign_name as ad_group_name,
Expand Down
2 changes: 1 addition & 1 deletion models/stg_microsoft_ads.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with base as (
'Microsoft Ads' as platform,
cast(date_day as date) as date_day,
account_name,
account_id,
cast(account_id as {{ dbt_utils.type_string() }}) as account_id,
campaign_name,
cast(campaign_id as {{ dbt_utils.type_string() }}) as campaign_id,
ad_group_name,
Expand Down

0 comments on commit 6aa47a0

Please sign in to comment.