Skip to content

Commit

Permalink
Merge pull request #9 from shoppad/pre-xmas-fix
Browse files Browse the repository at this point in the history
Add fallback for bad URLs
  • Loading branch information
JonCrawford authored Dec 22, 2023
2 parents b7eebd0 + 3d37c00 commit f33487d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion models/google_analytics/staging/stg_ga_session_starts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ WITH
event_timestamp_pt,

-- URL parts
CASE WHEN page_location ILIKE 'http%'
THEN PARSE_URL(page_location)
ELSE NULL
END AS parsed_url,
parsed_url:host || '/' || parsed_url:path AS page_url,
parsed_url:host::STRING AS page_host,
'/' || parsed_url:path::STRING AS page_path,
Expand All @@ -30,6 +34,6 @@ WITH
WHERE event_name = 'session_start'
)

SELECT *
SELECT * EXCLUDE (parsed_url)
FROM session_starts
INNER JOIN user_matching USING (user_pseudo_id)

0 comments on commit f33487d

Please sign in to comment.