From 5465bd35193fb20aee015ea13c68ef0288732600 Mon Sep 17 00:00:00 2001 From: awoelfel Date: Mon, 16 Aug 2021 10:50:52 -0400 Subject: [PATCH 1/3] Update LinkedIn campaign structure --- models/stg_linkedin_ads.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/models/stg_linkedin_ads.sql b/models/stg_linkedin_ads.sql index 9a52ff6..4e71839 100644 --- a/models/stg_linkedin_ads.sql +++ b/models/stg_linkedin_ads.sql @@ -12,10 +12,10 @@ with base as ( cast(date_day as date) as date_day, account_name, account_id, - campaign_name, - cast(campaign_id as {{ dbt_utils.type_string() }}) as campaign_id, - campaign_group_name as ad_group_name, - cast(campaign_group_id as {{ dbt_utils.type_string() }}) as ad_group_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, + cast(campaign_id as {{ dbt_utils.type_string() }}) as ad_group_id, base_url, url_host, url_path, @@ -33,4 +33,4 @@ with base as ( ) select * -from fields \ No newline at end of file +from fields From 3f6076a80ce12faaf2d8df8a176f06958e1e38df Mon Sep 17 00:00:00 2001 From: fivetran-joemarkiewicz Date: Tue, 17 Aug 2021 09:59:20 -0500 Subject: [PATCH 2/3] version upgrade --- dbt_project.yml | 4 +--- integration_tests/dbt_project.yml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dbt_project.yml b/dbt_project.yml index 902f873..445c34f 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'ad_reporting' -version: '0.3.0' +version: '0.4.0' config-version: 2 require-dbt-version: [">=0.20.0"] @@ -12,8 +12,6 @@ vars: ad_reporting__twitter_ads_enabled: true ad_reporting__facebook_ads_enabled: true ad_reporting__snapchat_ads_enabled: true - dbt_utils_dispatch_list: ['spark_utils', 'fivetran_utils'] - fivetran_utils_dispatch_list: ['spark_utils'] models: ad_reporting: diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index f4d6639..679c6e8 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,5 +1,5 @@ name: 'ad_reporting_integration_tests' -version: '0.3.0' +version: '0.4.0' profile: 'integration_tests' config-version: 2 From b3af8dbfe56a60443334675c9859a8920584677d Mon Sep 17 00:00:00 2001 From: fivetran-joemarkiewicz Date: Tue, 17 Aug 2021 10:30:07 -0500 Subject: [PATCH 3/3] LinkedIn Ads hierarchy documenation --- README.md | 2 +- models/ad_reporting.yml | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 68b494a..12ec6ce 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Include in your `packages.yml` ```yaml packages: - package: fivetran/ad_reporting - version: [">=0.3.0", "<0.4.0"] + version: [">=0.4.0", "<0.5.0"] ``` ## Configuration diff --git a/models/ad_reporting.yml b/models/ad_reporting.yml index 7d6d937..eb77a37 100644 --- a/models/ad_reporting.yml +++ b/models/ad_reporting.yml @@ -3,22 +3,27 @@ version: 2 models: - name: ad_reporting - description: Each record in this table represents the daily performance of ads. + description: > + Each record in this table represents the daily performance of ads. + + LinkedIn Ads has a slightly different hierarchy than the other marketing platforms. As identified within [Microsoft's Campaign Groups](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads/account-structure/create-and-manage-campaign-groups?tabs=http) + documentation, the hierarchy consists of multiple campaigns for a single campaign group. As this hierarchy is the inverse of the standard hierarchy seen within the + other platforms, the `campaign` and `campaign_group` are switched for LinkedIn Ads within the ad_reporting table for consistency across platforms. columns: - name: campaign_name - description: A label for the campaign. + description: A label for the campaign. For LinkedIn Ads this field is the `campaign_group_name` field. - name: ad_group_name - description: A label for the ad group, if present in the source data. Mapped from fields including `campaign_group_name`. + description: A label for the ad group, if present in the source data. Mapped from fields including `campaign_group_name`. For LinkedIn Ads this field is the `campaign_name` field. - name: account_name description: A label for the account. - name: campaign_id - description: The ID representing the campaign. + description: The ID representing the campaign. For LinkedIn Ads this field is the `campaign_group_id` field. - name: ad_group_id - description: The ID representing the ad group, if present in the source data. Mapped from fields including `campaign_group_id`. + description: The ID representing the ad group, if present in the source data. Mapped from fields including `campaign_group_id`. For LinkedIn Ads this field is the `campaign_id` field. - name: account_id description: The ID representing the account.