diff --git a/CHANGELOG.md b/CHANGELOG.md index 851b671..9371bb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# dbt_marketo_source v0.7.2 +## Bug Fixes +- Updated surrogate key `email_send_id` to include `primary_attribute_value_id`. The previous key was at a campaign level grain, not an email level grain. This is pertinent in the case where there are multiple emails that are part of the same campaign. +[#26](https://github.com/fivetran/dbt_marketo_source/pull/26) +## Contributors +- [sfc-gh-sugupta](https://github.com/sfc-gh-sugupta) [#25](https://github.com/fivetran/dbt_marketo_source/issues/25) # dbt_marketo_source v0.7.1 ## Bug Fixes diff --git a/dbt_project.yml b/dbt_project.yml index 0e91b29..8c11777 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'marketo_source' -version: '0.7.1' +version: '0.7.2' config-version: 2 require-dbt-version: [">=1.0.0", "<2.0.0"] diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index cff5ca9..49730a7 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,5 +1,5 @@ name: 'marketo_source_integration_tests' -version: '0.7.1' +version: '0.7.2' profile: 'integration_tests' config-version: 2 diff --git a/models/stg_marketo.yml b/models/stg_marketo.yml index 75f601a..22f9ede 100644 --- a/models/stg_marketo.yml +++ b/models/stg_marketo.yml @@ -77,7 +77,7 @@ models: description: The URL of the link clicked. - name: email_send_id - description: The inferred ID for the email sent. + description: The inferred ID for the email sent. This is created by concatenating primary_attribute_value_id, campaign_id, campaign_run_id, and lead_id. - name: email_template_id description: The ID of the email's template. @@ -136,7 +136,7 @@ models: description: The email address that bounced. - name: email_send_id - description: The inferred ID for the email sent. + description: The inferred ID for the email sent. This is created by concatenating primary_attribute_value_id, campaign_id, campaign_run_id, and lead_id. - name: email_template_id description: The ID of the email's template. @@ -177,7 +177,7 @@ models: description: The choice number of the current step that triggered the activity. - name: email_send_id - description: The inferred ID for the email sent. + description: The inferred ID for the email sent. This is created by concatenating primary_attribute_value_id, campaign_id, campaign_run_id, and lead_id. - name: email_template_id description: The ID of the email's template. @@ -221,7 +221,7 @@ models: description: The device that was used to open the email. - name: email_send_id - description: The inferred ID for the email sent. + description: The inferred ID for the email sent. This is created by concatenating primary_attribute_value_id, campaign_id, campaign_run_id, and lead_id. - name: email_template_id description: The ID of the email's template. @@ -271,7 +271,7 @@ models: description: The choice number of the current step that triggered the activity. - name: email_send_id - description: The inferred ID for the email sent. + description: The inferred ID for the email sent. This is created by concatenating primary_attribute_value_id, campaign_id, campaign_run_id, and lead_id. - name: email_template_id description: The ID of the email's template. @@ -312,7 +312,7 @@ models: description: The IP address of the client that unsubscribed. - name: email_send_id - description: The inferred ID for the email sent. + description: The inferred ID for the email sent. This is created by concatenating primary_attribute_value_id, campaign_id, campaign_run_id, and lead_id. - name: email_template_id description: The ID of the email's template. diff --git a/models/stg_marketo__activity_click_email.sql b/models/stg_marketo__activity_click_email.sql index 73ce839..2fb7b8f 100644 --- a/models/stg_marketo__activity_click_email.sql +++ b/models/stg_marketo__activity_click_email.sql @@ -39,7 +39,7 @@ with base as ( select *, - {{ dbt_utils.surrogate_key(['campaign_id','campaign_run_id','lead_id']) }} as email_send_id + {{ dbt_utils.surrogate_key(['primary_attribute_value_id','campaign_id','campaign_run_id','lead_id']) }} as email_send_id from fields ) diff --git a/models/stg_marketo__activity_email_bounced.sql b/models/stg_marketo__activity_email_bounced.sql index 2b5369c..4ef4b6d 100644 --- a/models/stg_marketo__activity_email_bounced.sql +++ b/models/stg_marketo__activity_email_bounced.sql @@ -38,7 +38,7 @@ with base as ( select *, - {{ dbt_utils.surrogate_key(['campaign_id','campaign_run_id','lead_id']) }} as email_send_id + {{ dbt_utils.surrogate_key(['primary_attribute_value_id','campaign_id','campaign_run_id','lead_id']) }} as email_send_id from fields ) diff --git a/models/stg_marketo__activity_email_delivered.sql b/models/stg_marketo__activity_email_delivered.sql index d18956f..2afa8c0 100644 --- a/models/stg_marketo__activity_email_delivered.sql +++ b/models/stg_marketo__activity_email_delivered.sql @@ -34,7 +34,7 @@ with base as ( select *, - {{ dbt_utils.surrogate_key(['campaign_id','campaign_run_id','lead_id']) }} as email_send_id + {{ dbt_utils.surrogate_key(['primary_attribute_value_id','campaign_id','campaign_run_id','lead_id']) }} as email_send_id from fields ) diff --git a/models/stg_marketo__activity_open_email.sql b/models/stg_marketo__activity_open_email.sql index d0bbe16..e8d2352 100644 --- a/models/stg_marketo__activity_open_email.sql +++ b/models/stg_marketo__activity_open_email.sql @@ -38,7 +38,7 @@ with base as ( select *, - {{ dbt_utils.surrogate_key(['campaign_id','campaign_run_id','lead_id']) }} as email_send_id + {{ dbt_utils.surrogate_key(['primary_attribute_value_id','campaign_id','campaign_run_id','lead_id']) }} as email_send_id from fields ) diff --git a/models/stg_marketo__activity_send_email.sql b/models/stg_marketo__activity_send_email.sql index 9ce3c2e..d32365e 100644 --- a/models/stg_marketo__activity_send_email.sql +++ b/models/stg_marketo__activity_send_email.sql @@ -34,7 +34,7 @@ with base as ( select *, - {{ dbt_utils.surrogate_key(['campaign_id','campaign_run_id','lead_id']) }} as email_send_id + {{ dbt_utils.surrogate_key(['primary_attribute_value_id','campaign_id','campaign_run_id','lead_id']) }} as email_send_id from fields ) diff --git a/models/stg_marketo__activity_unsubscribe_email.sql b/models/stg_marketo__activity_unsubscribe_email.sql index 0af8368..e456c0a 100644 --- a/models/stg_marketo__activity_unsubscribe_email.sql +++ b/models/stg_marketo__activity_unsubscribe_email.sql @@ -39,7 +39,7 @@ with base as ( select *, - {{ dbt_utils.surrogate_key(['campaign_id','campaign_run_id','lead_id']) }} as email_send_id + {{ dbt_utils.surrogate_key(['primary_attribute_value_id','campaign_id','campaign_run_id','lead_id']) }} as email_send_id from fields )