Fixed browser/device missing data in tinybird

ref https://linear.app/tryghost/issue/ANAL-96/data-discrepancy-between-charts-when-filtering

- The top browser and device endpoints were pulling from the sources MV, that is filtered to not have same-source traffic
This commit is contained in:
Hannah Wolfe 2024-09-26 12:26:54 +01:00
parent 606fcbabe7
commit 7ebb208549
4 changed files with 8 additions and 8 deletions

View File

@ -12,8 +12,8 @@ DESCRIPTION >
SQL >
%
select browser, uniqMerge(visits) as visits, countMerge(pageviews) as pageviews
from analytics_sources_mv
select browser, uniq(session_id) as visits, countMerge(pageviews) as pageviews
from analytics_sessions_mv
where
site_uuid = {{String(site_uuid, 'mock_site_uuid', description="Tenant ID", required=True)}}

View File

@ -13,8 +13,8 @@ DESCRIPTION >
SQL >
%
select device, uniqMerge(visits) as visits, countMerge(pageviews) as pageviews
from analytics_sources_mv
select device, uniq(session_id) as visits, countMerge(pageviews) as pageviews
from analytics_sessions_mv
where
site_uuid = {{String(site_uuid, 'mock_site_uuid', description="Tenant ID", required=True)}}

View File

@ -1,6 +1,6 @@
"browser","visits","pageviews"
"chrome",7,7
"firefox",4,4
"ie",2,2
"chrome",7,16
"firefox",5,9
"ie",2,4
"safari",1,1
"Unknown",1,1

View File

@ -1,3 +1,3 @@
"device","visits","pageviews"
"desktop",14,14
"desktop",15,30
"bot",1,1