Skip to content

Commit dadaff3

Browse files
committed
chore: cleanup processing on vierview tabv
1 parent 12085d2 commit dadaff3

File tree

5 files changed

+403
-456
lines changed

5 files changed

+403
-456
lines changed

apps/api/src/query/builders/pages.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ export const PagesBuilders: Record<string, SimpleQueryConfig> = {
2222
table: 'analytics.events',
2323
fields: [
2424
'entry_page as name',
25-
'COUNT(*) as entries',
25+
'COUNT(*) as pageviews',
2626
'COUNT(DISTINCT anonymous_id) as visitors',
2727
'ROUND((COUNT(*) / SUM(COUNT(*)) OVER()) * 100, 2) as percentage'
2828
],
2929
where: ['event_name = \'screen_view\'', 'path != \'\''],
3030
groupBy: ['entry_page'],
31-
orderBy: 'entries DESC',
31+
orderBy: 'pageviews DESC',
3232
limit: 100,
3333
timeField: 'time',
3434
allowedFilters: ['referrer', 'device_type'],
@@ -59,13 +59,13 @@ export const PagesBuilders: Record<string, SimpleQueryConfig> = {
5959
)
6060
SELECT
6161
entry_page as name,
62-
COUNT(*) as entries,
62+
COUNT(*) as pageviews,
6363
COUNT(DISTINCT anonymous_id) as visitors,
6464
ROUND((COUNT(*) / SUM(COUNT(*)) OVER()) * 100, 2) as percentage
6565
FROM session_entry
6666
WHERE page_rank = 1
6767
GROUP BY entry_page
68-
ORDER BY entries DESC
68+
ORDER BY pageviews DESC
6969
LIMIT {limit:Int32} OFFSET {offset:Int32}
7070
`,
7171
params: {
@@ -82,13 +82,13 @@ export const PagesBuilders: Record<string, SimpleQueryConfig> = {
8282
table: 'analytics.events',
8383
fields: [
8484
'path as name',
85-
'COUNT(DISTINCT session_id) as exits',
85+
'COUNT(DISTINCT session_id) as pageviews',
8686
'COUNT(DISTINCT anonymous_id) as visitors',
8787
'ROUND((COUNT(DISTINCT session_id) / SUM(COUNT(DISTINCT session_id)) OVER()) * 100, 2) as percentage'
8888
],
8989
where: ['event_name = \'screen_view\'', 'path != \'\''],
9090
groupBy: ['path'],
91-
orderBy: 'exits DESC',
91+
orderBy: 'pageviews DESC',
9292
limit: 100,
9393
timeField: 'time',
9494
allowedFilters: ['referrer', 'device_type'],
@@ -130,12 +130,12 @@ export const PagesBuilders: Record<string, SimpleQueryConfig> = {
130130
)
131131
SELECT
132132
path as name,
133-
COUNT(DISTINCT session_id) as exits,
133+
COUNT(DISTINCT session_id) as pageviews,
134134
COUNT(DISTINCT anonymous_id) as visitors,
135135
ROUND((COUNT(DISTINCT session_id) / SUM(COUNT(DISTINCT session_id)) OVER()) * 100, 2) as percentage
136136
FROM exit_pages
137137
GROUP BY path
138-
ORDER BY exits DESC
138+
ORDER BY pageviews DESC
139139
LIMIT {limit:Int32} OFFSET {offset:Int32}
140140
`,
141141
params: {

0 commit comments

Comments
 (0)