2024-08-30 00:03:31 +03:00
|
|
|
NODE analytics_sessions_1
|
|
|
|
DESCRIPTION >
|
|
|
|
Aggregate by session_id and calculate session metrics
|
|
|
|
|
|
|
|
SQL >
|
|
|
|
SELECT
|
|
|
|
site_uuid,
|
|
|
|
toDate(timestamp) AS date,
|
|
|
|
session_id,
|
2024-09-02 14:24:50 +03:00
|
|
|
maxIf(
|
|
|
|
member_status,
|
|
|
|
member_status IN ('paid', 'free', 'undefined')
|
|
|
|
) AS member_status,
|
|
|
|
anySimpleState(post_uuid) AS post_uuid,
|
2024-08-30 00:03:31 +03:00
|
|
|
anySimpleState(device) AS device,
|
|
|
|
anySimpleState(browser) AS browser,
|
|
|
|
anySimpleState(location) AS location,
|
2024-09-24 17:26:08 +03:00
|
|
|
anySimpleState(source) AS source,
|
|
|
|
anySimpleState(pathname) AS pathname,
|
2024-09-26 17:00:24 +03:00
|
|
|
minSimpleState(timestamp) AS first_view,
|
|
|
|
maxSimpleState(timestamp) AS latest_view,
|
|
|
|
countState() AS pageviews
|
2024-08-30 00:03:31 +03:00
|
|
|
FROM analytics_hits
|
|
|
|
GROUP BY date, session_id, site_uuid
|
|
|
|
|
|
|
|
TYPE MATERIALIZED
|
|
|
|
DATASOURCE analytics_sessions_mv
|