generated from fivetran/dbt_starter_project
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add new conversion report tables * fix naming and docs * seed * version * bring in passthrough variable and mod documentation and readme * docs * more updates * alias * add to integration test yml * docs * add reddit ads enable config * updates * readme and docs * add decisionlog about discrepancies across different grains * changelog * casting date as date in macro * add coalesce * cull down columns * polish up * tweak * changelog * reword * change base to tmp and add changelog note --------- Co-authored-by: Jamie Rodriguez <[email protected]>
- Loading branch information
1 parent
db8bd8f
commit 6c7f5e8
Showing
33 changed files
with
809 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ target/ | |
dbt_modules/ | ||
logs/ | ||
env/ | ||
dbt_packages/ | ||
dbt_packages/ | ||
integration_tests/package-lock.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## Why don't metrics add up across different grains (Ex. ad level vs campaign level)? | ||
When aggregating metrics like clicks and spend across different grains, discrepancies can arise due to differences in how data is captured, grouped, or attributed at each grain. For example, certain actions or costs might be attributed differently at the ad, campaign, or ad group level, leading to inconsistencies when rolled up. Additionally, for example, at the keyword grain, where a keyword can belong to multiple ad groups, aggregations can lead to over counting. Conversely, some ads may only be represented at the ad group level, rather than individual ad levels, leading to under counting at the ad grain. | ||
|
||
This is a reason why we have broken out the ad reporting packages into separate hierarchical end models (Ad, Ad Group, Campaign, and more). Because if we only used ad-level reports, we could be missing data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
_fivetran_synced,account_id,avg_value,click_through_conversion_attribution_window_day,click_through_conversion_attribution_window_month,click_through_conversion_attribution_window_week,date,event_name,total_items,total_value,view_through_conversion_attribution_window_day,view_through_conversion_attribution_window_month,view_through_conversion_attribution_window_week | ||
2023-01-10 12:00:00,1234,25.50,10,15,7,2022-10-09,purchase,5,127.50,1,3,2 | ||
2023-01-10 12:00:00,1234,30.75,10,15,7,2022-10-10,purchase,8,246.00,1,3,2 | ||
2023-01-10 12:00:00,1234,22.80,10,15,7,2022-10-11,purchase,6,136.80,1,3,2 | ||
2023-01-10 12:00:00,1234,28.60,10,15,7,2022-10-12,purchase,7,200.20,1,3,2 | ||
2023-01-10 12:00:00,1234,35.20,10,15,7,2022-10-13,purchase,9,316.80,1,3,2 | ||
2023-01-10 12:00:00,1234,27.90,10,15,7,2022-10-14,purchase,6,167.40,1,3,2 | ||
2023-01-10 12:00:00,1234,31.50,10,15,7,2022-10-15,purchase,4,126.00,1,3,2 | ||
2023-01-10 12:00:00,1234,29.75,10,15,7,2022-10-16,purchase,8,238.00,1,3,2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
_fivetran_synced,account_id,ad_id,avg_value,click_through_conversion_attribution_window_day,click_through_conversion_attribution_window_month,click_through_conversion_attribution_window_week,date,event_name,total_items,total_value,view_through_conversion_attribution_window_day,view_through_conversion_attribution_window_month,view_through_conversion_attribution_window_week | ||
2023-01-10 12:00:00,1234,1510393835426777445,27.50,10,15,7,2022-10-09,purchase,2,55.00,1,3,2 | ||
2023-01-10 12:00:00,1234,1510393835426777445,32.75,10,15,7,2022-10-10,purchase,3,98.25,1,3,2 | ||
2023-01-10 12:00:00,1234,1522247232378637129,24.80,10,15,7,2022-10-11,purchase,2,49.60,1,3,2 | ||
2023-01-10 12:00:00,1234,1522247232378637129,30.60,10,15,7,2022-10-12,purchase,3,91.80,1,3,2 | ||
2023-01-10 12:00:00,1234,1535743348805779455,37.20,10,15,7,2022-10-13,purchase,4,148.80,1,3,2 | ||
2023-01-10 12:00:00,1234,1535743348805779455,29.90,10,15,7,2022-10-14,purchase,2,59.80,1,3,2 | ||
2023-01-10 12:00:00,1234,1542438385001795138,33.50,10,15,7,2022-10-15,purchase,1,33.50,1,3,2 | ||
2023-01-10 12:00:00,1234,1542438385001795138,31.75,10,15,7,2022-10-16,purchase,3,95.25,1,3,2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
_fivetran_synced,account_id,ad_group_id,avg_value,click_through_conversion_attribution_window_day,click_through_conversion_attribution_window_month,click_through_conversion_attribution_window_week,date,event_name,total_items,total_value,view_through_conversion_attribution_window_day,view_through_conversion_attribution_window_month,view_through_conversion_attribution_window_week | ||
2023-01-10 12:00:00,1234,1510393829097718070,28.50,10,15,7,2022-10-09,purchase,1,28.50,1,3,2 | ||
2023-01-10 12:00:00,1234,1510393829097718070,33.75,10,15,7,2022-10-10,purchase,2,67.50,1,3,2 | ||
2023-01-10 12:00:00,1234,1522247226241194321,25.80,10,15,7,2022-10-11,purchase,1,25.80,1,3,2 | ||
2023-01-10 12:00:00,1234,1522247226241194321,31.60,10,15,7,2022-10-12,purchase,2,63.20,1,3,2 | ||
2023-01-10 12:00:00,1234,1535743345604192832,38.20,10,15,7,2022-10-13,purchase,3,114.60,1,3,2 | ||
2023-01-10 12:00:00,1234,1535743345604192832,30.90,10,15,7,2022-10-14,purchase,1,30.90,1,3,2 | ||
2023-01-10 12:00:00,1234,1542438363648999385,34.50,10,15,7,2022-10-15,purchase,1,34.50,1,3,2 | ||
2023-01-10 12:00:00,1234,1542438363648999385,32.75,10,15,7,2022-10-16,purchase,2,65.50,1,3,2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
_fivetran_synced,account_id,avg_value,campaign_id,click_through_conversion_attribution_window_day,click_through_conversion_attribution_window_month,click_through_conversion_attribution_window_week,date,event_name,total_items,total_value,view_through_conversion_attribution_window_day,view_through_conversion_attribution_window_month,view_through_conversion_attribution_window_week | ||
2023-01-10 12:00:00,1234,26.50,1510393823694638543,10,15,7,2022-10-09,purchase,3,79.50,1,3,2 | ||
2023-01-10 12:00:00,1234,31.75,1510393823694638543,10,15,7,2022-10-10,purchase,4,127.00,1,3,2 | ||
2023-01-10 12:00:00,1234,23.80,1542438351052756282,10,15,7,2022-10-11,purchase,3,71.40,1,3,2 | ||
2023-01-10 12:00:00,1234,29.60,1542438351052756282,10,15,7,2022-10-12,purchase,4,118.40,1,3,2 | ||
2023-01-10 12:00:00,1234,36.20,1576385495765735715,10,15,7,2022-10-13,purchase,5,181.00,1,3,2 | ||
2023-01-10 12:00:00,1234,28.90,1576385495765735715,10,15,7,2022-10-14,purchase,3,86.70,1,3,2 | ||
2023-01-10 12:00:00,1234,32.50,1593209133449106285,10,15,7,2022-10-15,purchase,2,65.00,1,3,2 | ||
2023-01-10 12:00:00,1234,30.75,1593209133449106285,10,15,7,2022-10-16,purchase,4,123.00,1,3,2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{% macro get_account_conversions_report_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, | ||
{"name": "account_id", "datatype": dbt.type_string()}, | ||
{"name": "click_through_conversion_attribution_window_month", "datatype": dbt.type_int()}, | ||
{"name": "date", "datatype": "date"}, | ||
{"name": "event_name", "datatype": dbt.type_string()}, | ||
{"name": "total_items", "datatype": dbt.type_int()}, | ||
{"name": "total_value", "datatype": dbt.type_int()}, | ||
{"name": "view_through_conversion_attribution_window_month", "datatype": dbt.type_int()} | ||
] %} | ||
|
||
{{ fivetran_utils.add_pass_through_columns(columns, var('reddit_ads__account_conversions_passthrough_metrics')) }} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
Oops, something went wrong.