-
Notifications
You must be signed in to change notification settings - Fork 27
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/add conversions #43
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fivetran-jamie these changes look great! I just have a few minor suggestions, but none related to the actual code. I see this being a huge value add for our users!
Once you address the comments in this review let's hold off merging until the other updates in the Google and LinkedIn packages are ready as well. Thanks and great job!
packages.yml
Outdated
# - package: fivetran/facebook_ads_source | ||
# version: [">=0.8.0", "<0.9.0"] | ||
# - local: ../Facebook_ads/dbt_facebook_ads_source | ||
- git: https://github.com/fivetran/dbt_facebook_ads_source.git | ||
revision: feature/add-conversions | ||
warn-unpinned: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to swap before merge
{{ fivetran_utils.persist_pass_through_columns(pass_through_variable='facebook_ads__basic_ad_passthrough_metrics', transform = 'sum') }} | ||
, sum(coalesce(conversion_report.conversion_value, 0)) as conversion_value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, should 0 and null
be represented the same here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for confirming. Good to see we haven't seen null
in the conversion value, but great to see we are being proactive with this logic. This looks good to me!
@fivetran-jamie @fivetran-joemarkiewicz Now might be a good time to delete the defunct 2nd reviewer bot. |
Agreed! @fivetran-jamie would you be able to remove that from this branch. |
Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com>
Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com>
Great effort! Looking forward to this release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fivetran-jamie great work on this PR and you're nearly there to releasing full support for conversions in our ad reporting packages!!
I have a few comments and suggestions in line. Additionally, I noticed I ran into a similar error from before where I run into an issue when trying to passthrough a default conversion value from this PR into the facebook_ads__basic_ad_passthrough_metrics
variable. Would you be able to look into this and confirm if this is intentional or if there are some adjustments we need to make to this logic within the models.
Thanks!
packages.yml
Outdated
# - package: fivetran/facebook_ads_source | ||
# version: [">=0.8.0", "<0.9.0"] | ||
# - local: ../Facebook_ads/dbt_facebook_ads_source | ||
# - local: ../../dbt_facebook_ads_source | ||
- git: https://github.com/fivetran/dbt_facebook_ads_source.git | ||
revision: feature/add-conversions | ||
warn-unpinned: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to clean and swap before merge
@fivetran-joemarkiewicz Yeah this is the expected behavior, as conversions are explicitly not included in To avoid duplicate column errors, we can employ the same |
Thanks for calling this out @fivetran-jamie! I was going through and stress testing so I see how I tested something that realistically should never occur. I would recommend if the conversion fields should not exist in the BASIC_AD table, then I feel comfortable giving our default value the preference and not including the Thanks for clarifying this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just had some questions!
README.md
Outdated
@@ -89,19 +93,62 @@ vars: | |||
To connect your multiple schema/database sources to the package models, follow the steps outlined in the [Union Data Defined Sources Configuration](https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source) section of the Fivetran Utils documentation for the union_data macro. This will ensure a proper configuration and correct visualization of connections in the DAG. | |||
|
|||
#### Passing Through Additional Metrics | |||
By default, this package will select `clicks`, `impressions`, and `cost` from the source reporting tables to store into the staging models. If you would like to pass through additional metrics to the staging models, add the below configurations to your `dbt_project.yml` file. These variables allow for the pass-through fields to be aliased (`alias`) if desired, but not required. Use the below format for declaring the respective pass-through variables: | |||
By default, this package will select `clicks`, `impressions`, `cost`, and conversion `value` (using the default attribution window) from the source reporting tables (`BASIC_AD`, `BASIC_AD_ACTIONS`, and `BASIC_AD_ACTION_VALUES`) to store into the output models. If you would like to pass through additional metrics to the output models, add the below configurations to your `dbt_project.yml` file. These variables allow for the pass-through fields to be aliased (`alias`) and transformed (`transform_sql`) if desired, but not required. Only the `name` of each metric field is required. Use the below format for declaring the respective pass-through variables: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also stating what the default is here?
from report | ||
left join conversion_report | ||
on report.date_day = conversion_report.date_day |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to join by source_relation here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jeez I can't believe I forgot these, good catch
from report | ||
left join conversion_report | ||
on report.date_day = conversion_report.date_day |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source_relation join?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doh!
Co-authored-by: Renee Li <91097070+fivetran-reneeli@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Overview
This PR will address the following Issue/Feature:
no issue made for conversions + #42
This PR will result in the following new package version:
v0.8.0
Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:
Feature Updates
Introducing...conversion metrics (PR #43)!
conversion_value
field to each_report
end model, representing the value of conversions (calculated using the default attribution window set in Meta) that occurred on each day for each ad/campaign/ad set/url/account.facebook_ads__basic_ad_actions_passthrough_metrics
variable to pass through additional conversion value metrics that are calculated using different attribution windows.Documentation
facebook_ads__basic_ad_passthrough_metrics
variable. See README for details (PR #43).Under the Hood
quickstart.yml
file to allow for automated Quickstart data model deployments (PR #40).PR Checklist
Basic Validation
Please acknowledge that you have successfully performed the following commands locally:
Before marking this PR as "ready for review" the following have been applied:
Detailed Validation
Please share any and all of your validation steps:
Tests are passing
conversion_value
from each_report
end modelclicks
,impressions
, andspend
across dev and prod in each of the_report
modelsNo exceptions needed, just a teeny tiny buffer to account for differences in rounding