Created
May 21, 2023 15:12
-
-
Save markrittman/8c643a4673dc1483a6563d27623c630e to your computer and use it in GitHub Desktop.
Script to compare the page views logged by Segment and Rudderstack for the same page, used when the page view counts for the two sources differ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with segment_pageviews as ( | |
select | |
'segment' as source, id, timestamp_trunc(timestamp,HOUR) as timestamp_minute, path, context_page_title, anonymous_id, user_id, context_ip | |
from | |
`ra-development.company_website.pages_view` p | |
where | |
date(timestamp_trunc(p.received_at,DAY)) > '2023-05-10' | |
and context_page_title = 'Adding Looker Regression Tests to the dbtCloud CI/CD Pipeline using Spectacles — Rittman Analytics' | |
), | |
rudderstack_pageviews as ( | |
select | |
'rudderstack' as source, id, timestamp_trunc(timestamp,HOUR) as timestamp_minute, path, context_page_title, anonymous_id, user_id, context_ip | |
from | |
`ra-development.rudderstack_ra_website.pages_view` p | |
where | |
date(timestamp_trunc(p.received_at,DAY)) > '2023-05-10' | |
and context_page_title = 'Adding Looker Regression Tests to the dbtCloud CI/CD Pipeline using Spectacles — Rittman Analytics' | |
) | |
select * | |
from segment_pageviews | |
union all | |
select * | |
from rudderstack_pageviews |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment