mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 16:45:35 +01:00
fix total visitors query to exclude event_type
This commit is contained in:
parent
2489601ae6
commit
5ea58e2b30
1 changed files with 14 additions and 2 deletions
|
|
@ -40,6 +40,12 @@ async function relationalQuery(
|
||||||
eventType,
|
eventType,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const excludeEventTypeFilterQuery = filterQuery
|
||||||
|
.split('\n')
|
||||||
|
.filter(filter => !filter.includes('event_type'))
|
||||||
|
.join('\n')
|
||||||
|
.trim();
|
||||||
|
|
||||||
return rawQuery(
|
return rawQuery(
|
||||||
`
|
`
|
||||||
select count(distinct website_event.session_id) as num,
|
select count(distinct website_event.session_id) as num,
|
||||||
|
|
@ -50,7 +56,7 @@ async function relationalQuery(
|
||||||
${joinSessionQuery}
|
${joinSessionQuery}
|
||||||
where website_event.website_id = {{websiteId::uuid}}
|
where website_event.website_id = {{websiteId::uuid}}
|
||||||
${dateQuery}
|
${dateQuery}
|
||||||
${filterQuery}
|
${excludeEventTypeFilterQuery}
|
||||||
) as total
|
) as total
|
||||||
from website_event
|
from website_event
|
||||||
${cohortQuery}
|
${cohortQuery}
|
||||||
|
|
@ -82,6 +88,12 @@ async function clickhouseQuery(
|
||||||
eventType,
|
eventType,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const excludeEventTypeFilterQuery = filterQuery
|
||||||
|
.split('\n')
|
||||||
|
.filter(filter => !filter.includes('event_type'))
|
||||||
|
.join('\n')
|
||||||
|
.trim();
|
||||||
|
|
||||||
return rawQuery(
|
return rawQuery(
|
||||||
`
|
`
|
||||||
select count(distinct session_id) as num,
|
select count(distinct session_id) as num,
|
||||||
|
|
@ -91,7 +103,7 @@ async function clickhouseQuery(
|
||||||
${cohortQuery}
|
${cohortQuery}
|
||||||
where website_id = {websiteId:UUID}
|
where website_id = {websiteId:UUID}
|
||||||
${dateQuery}
|
${dateQuery}
|
||||||
${filterQuery}
|
${excludeEventTypeFilterQuery}
|
||||||
) as total
|
) as total
|
||||||
from website_event
|
from website_event
|
||||||
${cohortQuery}
|
${cohortQuery}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue