diff --git a/ghost/tinybird/datasources/analytics_pages_mv.datasource b/ghost/tinybird/datasources/analytics_pages_mv.datasource index 75c5c9b870..10fb4e143a 100644 --- a/ghost/tinybird/datasources/analytics_pages_mv.datasource +++ b/ghost/tinybird/datasources/analytics_pages_mv.datasource @@ -1,8 +1,9 @@ -VERSION 0 +VERSION 1 SCHEMA > `site_uuid` String, `post_uuid` String, + `post_type` String, `date` Date, `device` String, `browser` String, diff --git a/ghost/tinybird/datasources/analytics_sessions_mv.datasource b/ghost/tinybird/datasources/analytics_sessions_mv.datasource index 6bd7786783..b2f8bd43d8 100644 --- a/ghost/tinybird/datasources/analytics_sessions_mv.datasource +++ b/ghost/tinybird/datasources/analytics_sessions_mv.datasource @@ -1,10 +1,11 @@ -VERSION 0 +VERSION 1 SCHEMA > `site_uuid` String, `date` Date, `session_id` String, `member_status` SimpleAggregateFunction(any, String), `post_uuid` SimpleAggregateFunction(any, String), + `post_type` SimpleAggregateFunction(any, String), `device` SimpleAggregateFunction(any, String), `browser` SimpleAggregateFunction(any, String), `location` SimpleAggregateFunction(any, String), diff --git a/ghost/tinybird/pipes/analytics_pages.pipe b/ghost/tinybird/pipes/analytics_pages.pipe index 8ecdc089bc..0804c86b75 100644 --- a/ghost/tinybird/pipes/analytics_pages.pipe +++ b/ghost/tinybird/pipes/analytics_pages.pipe @@ -1,4 +1,4 @@ -VERSION 0 +VERSION 1 NODE parsed_hits DESCRIPTION > @@ -19,6 +19,7 @@ SQL > JSONExtractString(payload, 'member_uuid') as member_uuid, JSONExtractString(payload, 'member_status') as member_status, JSONExtractString(payload, 'post_uuid') as post_uuid, + JSONExtractString(payload, 'post_type') as post_type, lower(JSONExtractString(payload, 'user-agent')) as user_agent FROM analytics_events where action = 'page_hit' @@ -34,6 +35,7 @@ SQL > member_uuid, member_status, post_uuid, + post_type, location, domainWithoutWWW(referrer) as source, pathname, @@ -71,6 +73,7 @@ SQL > site_uuid, toDate(timestamp) AS date, post_uuid, + post_type, device, browser, location, @@ -82,8 +85,8 @@ SQL > ) AS member_status, uniqState(session_id) AS visits, countState() AS pageviews - FROM analytics_hits_data - GROUP BY date, device, browser, location, source, pathname, post_uuid,site_uuid + FROM analytics_hits + GROUP BY date, device, browser, location, source, pathname, post_uuid, post_type, site_uuid TYPE MATERIALIZED -DATASOURCE analytics_pages_mv__v0 +DATASOURCE analytics_pages_mv__v1 diff --git a/ghost/tinybird/pipes/analytics_sessions.pipe b/ghost/tinybird/pipes/analytics_sessions.pipe index 0ef44093fc..6d9020ff17 100644 --- a/ghost/tinybird/pipes/analytics_sessions.pipe +++ b/ghost/tinybird/pipes/analytics_sessions.pipe @@ -1,4 +1,4 @@ -VERSION 0 +VERSION 1 NODE parsed_hits DESCRIPTION > @@ -19,6 +19,7 @@ SQL > JSONExtractString(payload, 'member_uuid') as member_uuid, JSONExtractString(payload, 'member_status') as member_status, JSONExtractString(payload, 'post_uuid') as post_uuid, + JSONExtractString(payload, 'post_type') as post_type, lower(JSONExtractString(payload, 'user-agent')) as user_agent FROM analytics_events where action = 'page_hit' diff --git a/ghost/tinybird/pipes/analytics_sources.pipe b/ghost/tinybird/pipes/analytics_sources.pipe index 482b73ad4f..3a49c1ed67 100644 --- a/ghost/tinybird/pipes/analytics_sources.pipe +++ b/ghost/tinybird/pipes/analytics_sources.pipe @@ -1,4 +1,4 @@ -VERSION 0 +VERSION 1 NODE parsed_hits DESCRIPTION > @@ -19,6 +19,7 @@ SQL > JSONExtractString(payload, 'member_uuid') as member_uuid, JSONExtractString(payload, 'member_status') as member_status, JSONExtractString(payload, 'post_uuid') as post_uuid, + JSONExtractString(payload, 'post_type') as post_type, lower(JSONExtractString(payload, 'user-agent')) as user_agent FROM analytics_events where action = 'page_hit' diff --git a/ghost/tinybird/pipes/kpis.pipe b/ghost/tinybird/pipes/kpis.pipe index fa969be31c..166562c476 100644 --- a/ghost/tinybird/pipes/kpis.pipe +++ b/ghost/tinybird/pipes/kpis.pipe @@ -1,4 +1,4 @@ -VERSION 0 +VERSION 1 DESCRIPTION > Summary with general KPIs per date, including visits, page views, bounce rate and average session duration. diff --git a/ghost/tinybird/pipes/top_browsers.pipe b/ghost/tinybird/pipes/top_browsers.pipe index 00625ec488..4676c18fc5 100644 --- a/ghost/tinybird/pipes/top_browsers.pipe +++ b/ghost/tinybird/pipes/top_browsers.pipe @@ -1,4 +1,4 @@ -VERSION 0 +VERSION 1 DESCRIPTION > Top Browsers ordered by most visits. diff --git a/ghost/tinybird/pipes/top_devices.pipe b/ghost/tinybird/pipes/top_devices.pipe index 3e77b510e0..9b13ba1634 100644 --- a/ghost/tinybird/pipes/top_devices.pipe +++ b/ghost/tinybird/pipes/top_devices.pipe @@ -1,4 +1,4 @@ -VERSION 0 +VERSION 1 DESCRIPTION > Top Device Types ordered by most visits. diff --git a/ghost/tinybird/pipes/top_locations.pipe b/ghost/tinybird/pipes/top_locations.pipe index beee3d92db..edf0eb21fd 100644 --- a/ghost/tinybird/pipes/top_locations.pipe +++ b/ghost/tinybird/pipes/top_locations.pipe @@ -1,4 +1,4 @@ -VERSION 0 +VERSION 1 DESCRIPTION > Top visiting Countries ordered by most visits. diff --git a/ghost/tinybird/pipes/top_pages.pipe b/ghost/tinybird/pipes/top_pages.pipe index 3ba741d8b2..7fa25c5f16 100644 --- a/ghost/tinybird/pipes/top_pages.pipe +++ b/ghost/tinybird/pipes/top_pages.pipe @@ -1,4 +1,4 @@ -VERSION 0 +VERSION 1 DESCRIPTION > Most visited pages for a given period. diff --git a/ghost/tinybird/pipes/top_sources.pipe b/ghost/tinybird/pipes/top_sources.pipe index 3235b0b708..92dd427af2 100644 --- a/ghost/tinybird/pipes/top_sources.pipe +++ b/ghost/tinybird/pipes/top_sources.pipe @@ -1,4 +1,4 @@ -VERSION 0 +VERSION 1 DESCRIPTION > Top traffic sources (domains), ordered by most visits. Accepts `date_from` and `date_to` date filter. Defaults to last 7 days. diff --git a/ghost/tinybird/pipes/trend.pipe b/ghost/tinybird/pipes/trend.pipe index 06faa5b268..707108a890 100644 --- a/ghost/tinybird/pipes/trend.pipe +++ b/ghost/tinybird/pipes/trend.pipe @@ -1,4 +1,4 @@ -VERSION 0 +VERSION 1 DESCRIPTION > Visits trend over time for the last 30 minutes, filling the blanks. Works great for the realtime chart. @@ -25,6 +25,7 @@ SQL > JSONExtractString(payload, 'member_uuid') as member_uuid, JSONExtractString(payload, 'member_status') as member_status, JSONExtractString(payload, 'post_uuid') as post_uuid, + JSONExtractString(payload, 'post_type') as post_type, lower(JSONExtractString(payload, 'user-agent')) as user_agent FROM analytics_events where action = 'page_hit'