Fixed goals query.

This commit is contained in:
Mike Cao 2025-05-31 09:46:36 -07:00
parent 49bcbfd7f9
commit f6c3ad5aa6
8 changed files with 38 additions and 30 deletions

View file

@ -30,7 +30,7 @@ async function relationalQuery(websiteId: string, criteria: GoalCriteria) {
`
select count(*) as num,
(
select count(${isPage ? '*' : 'distinct session_id'})
select count(distinct session_id)
from website_event
where website_id = {websiteId:UUID}
and event_type = ${eventType}
@ -59,10 +59,9 @@ async function clickhouseQuery(websiteId: string, criteria: GoalCriteria) {
`
select count(*) as num,
(
select count(${isPage ? '*' : 'distinct session_id'})
select count(distinct session_id)
from website_event
where website_id = {websiteId:UUID}
and event_type = ${eventType}
${dateQuery}
) as total
from website_event