Skip to content

Commit

Permalink
support for redshift in attribution model (#394)
Browse files Browse the repository at this point in the history
* support for redshift in attribution model

* corrections as per reviews
  • Loading branch information
joker2411 authored Jul 26, 2024
1 parent 7f05dbb commit 91b9173
Show file tree
Hide file tree
Showing 6 changed files with 247 additions and 992 deletions.
75 changes: 75 additions & 0 deletions samples/attribution_project/models/attribution.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
inputs:
- name: ga_campaign_stats
app_defaults:
table: dev.attribution_data.google_ads_campaign_stats
occurred_at_col: _FIVETRAN_SYNCED
ids:
- select: id
type: campaign_id
entity: campaign
to_default_stitcher: false
- name: lkdn_ad_analytic_campaign
app_defaults:
table: dev.attribution_data.linkedin_ads_ad_analytics_by_campaign
occurred_at_col: _FIVETRAN_SYNCED
ids:
- select: campaign_id
type: campaign_id
entity: campaign
to_default_stitcher: false
- name: fb_basic_campaign
app_defaults:
table: dev.attribution_data.facebook_ads_basic_campaign
occurred_at_col: _FIVETRAN_SYNCED
ids:
- select: campaign_id
type: campaign_id
entity: campaign
to_default_stitcher: false
- select: lower(campaign_name)
type: campaign_name
entity: campaign
to_default_stitcher: false
models:
- name: campaign_id_graph
model_type: id_stitcher
model_spec:
validity_time: 24h # 1 day
entity_key: campaign
edge_sources:
- from: inputs/ga_campaign_stats
- from: inputs/lkdn_ad_analytic_campaign
- from: inputs/fb_basic_campaign
- from: inputs/rsMarketingPages
var_groups:
- name: campaign_vars
entity_key: campaign
vars:
- entity_var:
name: campaign_start_date
select: DATE '2023-02-01'
is_feature: false
- entity_var:
name: campaign_end_date
select: DATE '2024-06-01'
is_feature: false
- entity_var:
name: fb_ads_conversions_value
select: CAST((RANDOM()*49) + 1 AS INT)
is_feature: false
- entity_var:
name: google_ads_utm_campaign
select: case when RANDOM()>0.5 then 1 else 0 end
is_feature: false
- entity_var:
name: fb_ads_impressions
select: CAST((RANDOM()*10) + 1 AS INT)
is_feature: false
- entity_var:
name: fb_ads_conversions
select: case when RANDOM()>0.5 then 5 else 2 end
is_feature: false
- entity_var:
name: google_ads_clicks
select: CAST((RANDOM()*15) + 1 AS INT)
is_feature: false
Loading

0 comments on commit 91b9173

Please sign in to comment.