Ghost/ghost/tinybird/pipes/analytics_pages.pipe
Hannah Wolfe e3268c8c59 Renamed hits to pageviews in tinybird
closes https://linear.app/tryghost/issue/ANAL-111/rename-hits-to-pageviews-inside-of-tinybird

- We currently have two concepts: visits (unique visits) and pageviews (also called hits)
- We want to standardise on this terminology, so inside tinybird, we're going to call hit "pageviews" to make it super clear what's happening
2024-09-27 14:30:42 +01:00

26 lines
636 B
Plaintext

NODE analytics_pages_1
DESCRIPTION >
Aggregate by pathname and calculate session and views
SQL >
SELECT
site_uuid,
toDate(timestamp) AS date,
post_uuid,
device,
browser,
location,
source,
pathname,
maxIf(
member_status,
member_status IN ('paid', 'free', 'undefined')
) AS member_status,
uniqState(session_id) AS visits,
countState() AS pageviews
FROM analytics_hits
GROUP BY date, device, browser, location, source, pathname, post_uuid,site_uuid
TYPE MATERIALIZED
DATASOURCE analytics_pages_mv