Skip to content

Commit

Permalink
Added stream_id
Browse files Browse the repository at this point in the history
  • Loading branch information
JumboDVDH0 committed Apr 26, 2024
1 parent aaf9563 commit 9811f8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions models/staging/stg_ga4__sessions_traffic_sources.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
with session_events as (
select
session_key
stream_id
,session_key
,event_timestamp
,events.event_source
,event_medium
Expand All @@ -22,7 +23,8 @@ set_default_channel_grouping as (
),
session_source as (
select
session_key
stream_id
,session_key
,COALESCE(FIRST_VALUE((CASE WHEN event_source <> '(direct)' THEN event_source END) IGNORE NULLS) OVER (session_window), '(direct)') AS session_source
,COALESCE(FIRST_VALUE((CASE WHEN event_source <> '(direct)' THEN COALESCE(event_medium, '(none)') END) IGNORE NULLS) OVER (session_window), '(none)') AS session_medium
,COALESCE(FIRST_VALUE((CASE WHEN event_source <> '(direct)' THEN COALESCE(source_category, '(none)') END) IGNORE NULLS) OVER (session_window), '(none)') AS session_source_category
Expand Down

0 comments on commit 9811f8f

Please sign in to comment.