You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ANDe.value.int_value IS NOT NULL--only keep rows where GA session ID is not null
50
50
ANDa.event_name='session_start'
51
51
QUALIFY
52
-
rnk =1
52
+
rnk =1--if a ga_session_id / user_pseudo_id / session_date has more than 1 session_start, only keep 1 since a unique session should only have 1 session start
53
53
),
54
54
--get all the details for that session from the session date and the next day
55
55
event_aggregates AS (
@@ -71,7 +71,7 @@ event_aggregates AS (
71
71
BETWEEN FORMAT_DATE('%Y%m%d', @submission_date)
72
72
AND FORMAT_DATE('%Y%m%d', DATE_ADD(@submission_date, INTERVAL 1 DAY))
73
73
ANDe.key='ga_session_id'
74
-
ANDe.value.int_value IS NOT NULL
74
+
ANDe.value.int_value IS NOT NULL--only keep rows where GA session ID is not null
75
75
GROUP BY
76
76
a.user_pseudo_id,
77
77
CAST(e.value.int_value AS string)
@@ -163,7 +163,7 @@ landing_page_by_session_staging AS (
163
163
BETWEEN FORMAT_DATE('%Y%m%d', @submission_date)
164
164
AND FORMAT_DATE('%Y%m%d', DATE_ADD(@submission_date, INTERVAL 1 DAY))
165
165
ANDe.key='entrances'
166
-
ANDe.value.int_value =1
166
+
ANDe.value.int_value =1--filter to the entrance page view of the session (key = entrances, int_value = 1 to get the landing page of the session)
167
167
),
168
168
landing_page_by_session AS (
169
169
SELECT
@@ -181,7 +181,7 @@ landing_page_by_session AS (
181
181
FROM
182
182
landing_page_by_session_staging
183
183
QUALIFY
184
-
lp_rnk =1
184
+
lp_rnk =1--if there are ever multiple entrances in the same session, pick only 1 (rare but occasionally happens)
0 commit comments