mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
WIP: Adding post type column
- This is genuinely something we need to do :D
This commit is contained in:
parent
0f9449137f
commit
9f01456246
12 changed files with 23 additions and 15 deletions
|
@ -1,8 +1,9 @@
|
||||||
VERSION 0
|
VERSION 1
|
||||||
|
|
||||||
SCHEMA >
|
SCHEMA >
|
||||||
`site_uuid` String,
|
`site_uuid` String,
|
||||||
`post_uuid` String,
|
`post_uuid` String,
|
||||||
|
`post_type` String,
|
||||||
`date` Date,
|
`date` Date,
|
||||||
`device` String,
|
`device` String,
|
||||||
`browser` String,
|
`browser` String,
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
VERSION 0
|
VERSION 1
|
||||||
SCHEMA >
|
SCHEMA >
|
||||||
`site_uuid` String,
|
`site_uuid` String,
|
||||||
`date` Date,
|
`date` Date,
|
||||||
`session_id` String,
|
`session_id` String,
|
||||||
`member_status` SimpleAggregateFunction(any, String),
|
`member_status` SimpleAggregateFunction(any, String),
|
||||||
`post_uuid` SimpleAggregateFunction(any, String),
|
`post_uuid` SimpleAggregateFunction(any, String),
|
||||||
|
`post_type` SimpleAggregateFunction(any, String),
|
||||||
`device` SimpleAggregateFunction(any, String),
|
`device` SimpleAggregateFunction(any, String),
|
||||||
`browser` SimpleAggregateFunction(any, String),
|
`browser` SimpleAggregateFunction(any, String),
|
||||||
`location` SimpleAggregateFunction(any, String),
|
`location` SimpleAggregateFunction(any, String),
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION 0
|
VERSION 1
|
||||||
|
|
||||||
NODE parsed_hits
|
NODE parsed_hits
|
||||||
DESCRIPTION >
|
DESCRIPTION >
|
||||||
|
@ -19,6 +19,7 @@ SQL >
|
||||||
JSONExtractString(payload, 'member_uuid') as member_uuid,
|
JSONExtractString(payload, 'member_uuid') as member_uuid,
|
||||||
JSONExtractString(payload, 'member_status') as member_status,
|
JSONExtractString(payload, 'member_status') as member_status,
|
||||||
JSONExtractString(payload, 'post_uuid') as post_uuid,
|
JSONExtractString(payload, 'post_uuid') as post_uuid,
|
||||||
|
JSONExtractString(payload, 'post_type') as post_type,
|
||||||
lower(JSONExtractString(payload, 'user-agent')) as user_agent
|
lower(JSONExtractString(payload, 'user-agent')) as user_agent
|
||||||
FROM analytics_events
|
FROM analytics_events
|
||||||
where action = 'page_hit'
|
where action = 'page_hit'
|
||||||
|
@ -34,6 +35,7 @@ SQL >
|
||||||
member_uuid,
|
member_uuid,
|
||||||
member_status,
|
member_status,
|
||||||
post_uuid,
|
post_uuid,
|
||||||
|
post_type,
|
||||||
location,
|
location,
|
||||||
domainWithoutWWW(referrer) as source,
|
domainWithoutWWW(referrer) as source,
|
||||||
pathname,
|
pathname,
|
||||||
|
@ -71,6 +73,7 @@ SQL >
|
||||||
site_uuid,
|
site_uuid,
|
||||||
toDate(timestamp) AS date,
|
toDate(timestamp) AS date,
|
||||||
post_uuid,
|
post_uuid,
|
||||||
|
post_type,
|
||||||
device,
|
device,
|
||||||
browser,
|
browser,
|
||||||
location,
|
location,
|
||||||
|
@ -82,8 +85,8 @@ SQL >
|
||||||
) AS member_status,
|
) AS member_status,
|
||||||
uniqState(session_id) AS visits,
|
uniqState(session_id) AS visits,
|
||||||
countState() AS pageviews
|
countState() AS pageviews
|
||||||
FROM analytics_hits_data
|
FROM analytics_hits
|
||||||
GROUP BY date, device, browser, location, source, pathname, post_uuid,site_uuid
|
GROUP BY date, device, browser, location, source, pathname, post_uuid, post_type, site_uuid
|
||||||
|
|
||||||
TYPE MATERIALIZED
|
TYPE MATERIALIZED
|
||||||
DATASOURCE analytics_pages_mv__v0
|
DATASOURCE analytics_pages_mv__v1
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION 0
|
VERSION 1
|
||||||
|
|
||||||
NODE parsed_hits
|
NODE parsed_hits
|
||||||
DESCRIPTION >
|
DESCRIPTION >
|
||||||
|
@ -19,6 +19,7 @@ SQL >
|
||||||
JSONExtractString(payload, 'member_uuid') as member_uuid,
|
JSONExtractString(payload, 'member_uuid') as member_uuid,
|
||||||
JSONExtractString(payload, 'member_status') as member_status,
|
JSONExtractString(payload, 'member_status') as member_status,
|
||||||
JSONExtractString(payload, 'post_uuid') as post_uuid,
|
JSONExtractString(payload, 'post_uuid') as post_uuid,
|
||||||
|
JSONExtractString(payload, 'post_type') as post_type,
|
||||||
lower(JSONExtractString(payload, 'user-agent')) as user_agent
|
lower(JSONExtractString(payload, 'user-agent')) as user_agent
|
||||||
FROM analytics_events
|
FROM analytics_events
|
||||||
where action = 'page_hit'
|
where action = 'page_hit'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION 0
|
VERSION 1
|
||||||
|
|
||||||
NODE parsed_hits
|
NODE parsed_hits
|
||||||
DESCRIPTION >
|
DESCRIPTION >
|
||||||
|
@ -19,6 +19,7 @@ SQL >
|
||||||
JSONExtractString(payload, 'member_uuid') as member_uuid,
|
JSONExtractString(payload, 'member_uuid') as member_uuid,
|
||||||
JSONExtractString(payload, 'member_status') as member_status,
|
JSONExtractString(payload, 'member_status') as member_status,
|
||||||
JSONExtractString(payload, 'post_uuid') as post_uuid,
|
JSONExtractString(payload, 'post_uuid') as post_uuid,
|
||||||
|
JSONExtractString(payload, 'post_type') as post_type,
|
||||||
lower(JSONExtractString(payload, 'user-agent')) as user_agent
|
lower(JSONExtractString(payload, 'user-agent')) as user_agent
|
||||||
FROM analytics_events
|
FROM analytics_events
|
||||||
where action = 'page_hit'
|
where action = 'page_hit'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION 0
|
VERSION 1
|
||||||
|
|
||||||
DESCRIPTION >
|
DESCRIPTION >
|
||||||
Summary with general KPIs per date, including visits, page views, bounce rate and average session duration.
|
Summary with general KPIs per date, including visits, page views, bounce rate and average session duration.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION 0
|
VERSION 1
|
||||||
|
|
||||||
DESCRIPTION >
|
DESCRIPTION >
|
||||||
Top Browsers ordered by most visits.
|
Top Browsers ordered by most visits.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION 0
|
VERSION 1
|
||||||
|
|
||||||
DESCRIPTION >
|
DESCRIPTION >
|
||||||
Top Device Types ordered by most visits.
|
Top Device Types ordered by most visits.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION 0
|
VERSION 1
|
||||||
|
|
||||||
DESCRIPTION >
|
DESCRIPTION >
|
||||||
Top visiting Countries ordered by most visits.
|
Top visiting Countries ordered by most visits.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION 0
|
VERSION 1
|
||||||
|
|
||||||
DESCRIPTION >
|
DESCRIPTION >
|
||||||
Most visited pages for a given period.
|
Most visited pages for a given period.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION 0
|
VERSION 1
|
||||||
DESCRIPTION >
|
DESCRIPTION >
|
||||||
Top traffic sources (domains), ordered by most visits.
|
Top traffic sources (domains), ordered by most visits.
|
||||||
Accepts `date_from` and `date_to` date filter. Defaults to last 7 days.
|
Accepts `date_from` and `date_to` date filter. Defaults to last 7 days.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION 0
|
VERSION 1
|
||||||
DESCRIPTION >
|
DESCRIPTION >
|
||||||
Visits trend over time for the last 30 minutes, filling the blanks.
|
Visits trend over time for the last 30 minutes, filling the blanks.
|
||||||
Works great for the realtime chart.
|
Works great for the realtime chart.
|
||||||
|
@ -25,6 +25,7 @@ SQL >
|
||||||
JSONExtractString(payload, 'member_uuid') as member_uuid,
|
JSONExtractString(payload, 'member_uuid') as member_uuid,
|
||||||
JSONExtractString(payload, 'member_status') as member_status,
|
JSONExtractString(payload, 'member_status') as member_status,
|
||||||
JSONExtractString(payload, 'post_uuid') as post_uuid,
|
JSONExtractString(payload, 'post_uuid') as post_uuid,
|
||||||
|
JSONExtractString(payload, 'post_type') as post_type,
|
||||||
lower(JSONExtractString(payload, 'user-agent')) as user_agent
|
lower(JSONExtractString(payload, 'user-agent')) as user_agent
|
||||||
FROM analytics_events
|
FROM analytics_events
|
||||||
where action = 'page_hit'
|
where action = 'page_hit'
|
||||||
|
|
Loading…
Add table
Reference in a new issue