-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdbt_project.yml
198 lines (152 loc) · 8.76 KB
/
dbt_project.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: 'ra_attribution'
version: '0.0.3'
require-dbt-version: [">=1.0.0", "<2.0.0"]
config-version: 2
profile: 'ra_data_warehouse'
target-path: "target"
clean-targets: ["target", "dbt_modules", "dbt_packages"]
macro-paths: ["macros"]
log-path: "logs"
model-paths: ["models"]
analysis-paths: ["analysis"]
test-paths: ["tests"]
seed-paths: ["data"]
quoting:
database: false
schema: false
identifier: false
on-run-start:
- "{% do create_schema(api.Relation.create(database=target.database, schema=target.schema + '_logs')) %}"
models:
ra_attribution:
# source adapter general settings
sources:
materialized: view
schema: staging
# integration layer settings
integration:
materialized: view
schema: staging
# warehouse layer settings
warehouse:
materialized: table
# util module settings
utils:
materialized: table
# seeds (reference files, loaded into tables) module settings
seeds:
ra_attribution:
+quote_columns: false
schema: seed
+column_types:
event_time: timestamp
created_at: timestamp
page_title: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
page_url_path: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
page_url: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
marketing_term: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
marketing_content: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
marketing_medium: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
marketing_campaign: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
marketing_source: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
marketing_click_id: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
page_url_query: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
referer_url_host: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
useragent: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
order_line_id: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
order_id: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
user_id: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
user_created_date: timestamp
order_date: timestamp
local_currency: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
global_currency: "{{ 'string' if target.type == 'bigquery' else 'varchar' }}"
revenue_local_currency: "{{ 'float64' if target.type == 'bigquery' else 'number(38,2)' }}"
revenue_global_currency: "{{ 'float64' if target.type == 'bigquery' else 'number(38,2)' }}"
vars:
# Attribution-specific settings
# configure which sources from facebook_ads, google_ads and snapchat_ads are enabled (included in list) or disabled (excluded)
attribution_warehouse_ad_campaign_sources: ['facebook_ads','google_ads']
attribution_warehouse_ad_group_sources: ['facebook_ads','google_ads']
attribution_warehouse_ad_sources: ['facebook_ads','google_ads']
attribution_warehouse_click_id_sources: ['google_ads']
attribution_warehouse_currency_rate_sources: ['custom_currency_rates']
attribution_warehouse_event_sources: ['custom_events_order','custom_events_registration','snowplow_events_all']
attribution_warehouse_ltv_sources: ['custom_ltv_customer']
# various configuration variables used throughout the package
attribution_create_account_event_type: user_registration # event name for registration events
attribution_conversion_event_type: confirmed_order # event name for order events
attribution_global_currency: 'GBP' # currency code for global amounts
attribution_lookback_days_window : 30 # how far back sessions can go to be eligable for attribution
attribution_time_decay_days_window : 21 # over how many days do we decay the value of conversions for time-decay model
attribution_include_conversion_session: true # whether the session containing the conversion event is within scope for attribution
attribution_match_offline_conversions_to_sessions: true # whether orders and registrations are matched to Snowplow sessions or not
attribution_max_session_hours: 24 # maximum length of a session in hours to be considered for matching purposes
attribution_demo_mode: true # set to 'true' to source events, orders and other custom app data from seed files, 'false' to source from database
web_sessionization_trailing_window: 3
web_inactivity_cutoff: 30 * 60
attribution_models: ['first_click_attrib','first_non_direct_click_attrib','first_paid_click_attrib','last_click_attrib',
'last_non_direct_click_attrib','last_paid_click_attrib','even_click_attrib','time_decay_attrib'] # list of model names to be appended to measures
attribution_input_measures: ['total_revenue_local_currency','total_revenue_global_currency','ltv_365d_local_currency','ltv_365d_global_currency'] # list of attribution input measures
attribution_output_conversion_measures: {
"count_registration_conversions" : "user_registration",
"count_first_order_conversions" : "first_order",
"count_repeat_order_conversions" : "repeat_order"
} # list of attribution output conversion measures
attribution_output_revenue_measures: {
"first_order_total_revenue_local_currency" : "first_order_total_revenue_local_currency",
"first_order_total_revenue_global_currency" : "first_order_total_revenue_global_currency",
"first_order_ltv_365d_local_currency" : "first_order_ltv_365d_local_currency",
"first_order_ltv_365d_global_currency" : "first_order_ltv_365d_global_currency",
"repeat_order_total_revenue_local_currency" : "repeat_order_total_revenue_local_currency",
"repeat_order_total_revenue_global_currency" : "repeat_order_total_revenue_global_currency"
} # list of attribution output revenue measures
# Data source settings -
# custom app database sources for orders, events, customer ltv, user registrations and fx rates
stg_custom_events_schema: analytics_seed
stg_custom_events_database: RA_DATA_WAREHOUSE_DEV
stg_custom_ltv_schema: analytics_seed
stg_custom_ltv_database: RA_DATA_WAREHOUSE_DEV
stg_custom_currency_schema: analytics_seed
stg_custom_currency_database: RA_DATA_WAREHOUSE_DEV
# Data source settings -
# Snowplow, Segment, Rudderstack and GA4 event source
stg_snowplow_events_snowplow_schema: SNOWPLOW
stg_snowplow_events_snowplow_database: RA_DATA_WAREHOUSE_DEV
snowplow_max_users_per_session: 10
stg_appsflyer_events_stitch_schema: stitch_appsflyer
stg_segment_events_segment_database: RA_DATA_WAREHOUSE_DEV
stg_segment_events_segment_schema: SEGMENT_EVENTS
stg_rudderstack_events_rudderstack_database: RA_DATA_WAREHOUSE_DEV
stg_rudderstack_events_rudderstack_schema: RUDDERSTACK_RA_WEBSITE
stg_heap_events_heap_schema: HEAP_EVENTS
stg_heap_events_heap_database: RA_DATA_WAREHOUSE_DEV
stg_ga4_events_export_schema: GA4_EVENTS
stg_ga4_events_export_database: RA_DATA_WAREHOUSE_DEV
stg_segment_events_site: rittmananalytics.com
stg_rudderstack_events_site: rittmananalytics.com
stg_snowplow_events_site: rittmananalytics.com
stg_custom_events_site: rittmananalytics.com
enable_event_type_mapping: true
# Data source settings -
# Fivetran Ad Reporting package sources
stg_google_ads_schema: FIVETRAN_GOOGLE_ADS
stg_google_ads_database: RA_DATA_WAREHOUSE_DEV
stg_google_ads_api_source: google_ads
stg_google_ads__url_passthrough_metrics: []
stg_google_ads_criteria_passthrough_metrics: []
stg_google_ads_ad_stats_passthrough_metrics: []
stg_google_ads_click_performance: adwords_click_performance_report
ad_reporting__stg_facebook_ads_schema: staging
ad_reporting__stg_facebook_ads_database: RA_DATA_WAREHOUSE_DEV
ad_reporting__stg_google_ads_schema: staging
ad_reporting__stg_google_ads_database: RA_DATA_WAREHOUSE_DEV
ad_reporting__stg_stg_snapchat_ads_schema: staging
ad_reporting__stg_snapchat_ads_database: RA_DATA_WAREHOUSE_DEV
stg_facebook_ads_schema: fivetran_facebook_ads
stg_facebook_ads_database: RA_DATA_WAREHOUSE_DEV
stg_facebook_ads_api_source: fivetran_facebook_ads
stg_stg_snapchat_ads_schema: fivetran_snapchat_ads
stg_snapchat_ads_database: RA_DATA_WAREHOUSE_DEV
stg_snapchat_ads_api_source: fivetran_snapchat_ads
dbt_utils_dispatch_list: [spark_utils, fivetran_utils]
fivetran_utils_dispatch_list: [spark_utils]