implement UTM filters and fields

This commit is contained in:
Francis Cao
2026-02-05 16:30:46 -08:00
parent 7514af4236
commit 49adaa32d0
11 changed files with 336 additions and 55 deletions
+4
View File
@@ -33,6 +33,7 @@ async function relationalQuery(websiteId: string, filters: QueryFilters) {
${joinSessionQuery}
where website_event.website_id = {{websiteId::uuid}}
and website_event.created_at between {{startDate}} and {{endDate}}
and website_event.event_type != 2
${filterQuery}
group by time
order by 1
@@ -59,8 +60,10 @@ async function clickhouseQuery(websiteId: string, filters: QueryFilters) {
count(distinct session_id) as value
from website_event
${cohortQuery}
${excludeBounceQuery}
where website_id = {websiteId:UUID}
and created_at between {startDate:DateTime64} and {endDate:DateTime64}
and event_type != 2
${filterQuery}
group by time
order by time
@@ -75,6 +78,7 @@ async function clickhouseQuery(websiteId: string, filters: QueryFilters) {
${excludeBounceQuery}
where website_id = {websiteId:UUID}
and created_at between {startDate:DateTime64} and {endDate:DateTime64}
and event_type != 2
${filterQuery}
group by time
order by time
+2 -2
View File
@@ -71,7 +71,7 @@ async function relationalQuery(
website_event.session_id, website_event.visit_id
) as t
group by ${parseFieldsByName(fields)}
order by 1 desc, 2 desc
order by 2 desc, 1 desc
limit 500
`,
queryParams,
@@ -119,7 +119,7 @@ async function clickhouseQuery(
session_id, visit_id
) as t
group by ${parseFieldsByName(fields)}
order by 1 desc, 2 desc
order by 2 desc, 1 desc
limit 500
`,
queryParams,