Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
remove event from website stats. doesnt work with view
Francis Cao22333a1e9a71
diff --git a/src/app/(main)/websites/[websiteId]/events/EventsMetricsBar.tsx b/src/app/(main)/websites/[websiteId]/events/EventsMetricsBar.tsxindex f77c6c04d..0a054e8d1 100644--- a/src/app/(main)/websites/[websiteId]/events/EventsMetricsBar.tsx+++ b/src/app/(main)/websites/[websiteId]/events/EventsMetricsBar.tsx@@ -28,11 +28,6 @@ export function EventsMetricsBar({ websiteId }: { websiteId: string }) {label={formatMessage(labels.views)}formatValue={formatLongNumber}/>- <MetricCard- value={data?.events?.value}- label={formatMessage(labels.events)}- formatValue={formatLongNumber}- /></MetricsBar><WebsiteDateFilter websiteId={websiteId} /></Flexbox>diff --git a/src/queries/analytics/getWebsiteStats.ts b/src/queries/analytics/getWebsiteStats.tsindex a33011ff5..c35aea069 100644--- a/src/queries/analytics/getWebsiteStats.ts+++ b/src/queries/analytics/getWebsiteStats.ts@@ -33,15 +33,12 @@ async function relationalQuery(count(distinct t.session_id) as "visitors",count(distinct t.visit_id) as "visits",count(distinct t.country) as "countries",- count(t.event_name) as "countries",- sum(case when t.event_type = 2 then 1 else 0 end) as "events",sum(case when t.c = 1 then 1 else 0 end) as "bounces",sum(${getTimestampDiffSQL('t.min_time', 't.max_time')}) as "totaltime",from (selectwebsite_event.session_id,website_event.visit_id,- website_event.event_type,session.country,count(*) as "c",min(website_event.created_at) as "min_time",@@ -51,7 +48,7 @@ async function relationalQuery(where website_event.website_id = {{websiteId::uuid}}and website_event.created_at between {{startDate}} and {{endDate}}${filterQuery}- group by 1, 2, 3, 4+ group by 1, 2, 3) as t`,params,@@ -78,14 +75,12 @@ async function clickhouseQuery(uniq(t.session_id) as "visitors",uniq(t.visit_id) as "visits",uniq(t.country) as "countries",- sumIf(1, t.event_type = 2) as "events",sumIf(1, t.c = 1) as "bounces",sum(max_time-min_time) as "totaltime"from (selectsession_id,visit_id,- event_type,country,count(*) c,min(created_at) min_time,@@ -94,7 +89,7 @@ async function clickhouseQuery(where website_id = {websiteId:UUID}and created_at between {startDate:DateTime64} and {endDate:DateTime64}${filterQuery}- group by session_id, visit_id, event_type, country+ group by session_id, visit_id, country) as t;`;} else {@@ -104,14 +99,12 @@ async function clickhouseQuery(uniq(session_id) as "visitors",uniq(visit_id) as "visits",uniq(country) as "countries",- sumIf(1, t.event_type = 2) as "events",sumIf(1, t.c = 1) as "bounces",sum(max_time-min_time) as "totaltime"from (selectsession_id,visit_id,- event_type,country,sum(views) c,min(min_time) min_time,@@ -120,7 +113,7 @@ async function clickhouseQuery(where website_id = {websiteId:UUID}and created_at between {startDate:DateTime64} and {endDate:DateTime64}${filterQuery}- group by session_id, visit_id, event_type, country+ group by session_id, visit_id, country) as t;`;}diff --git a/src/queries/analytics/sessions/getWebsiteSessions.ts b/src/queries/analytics/sessions/getWebsiteSessions.tsindex b7c4f9284..2b22a0c81 100644--- a/src/queries/analytics/sessions/getWebsiteSessions.ts+++ b/src/queries/analytics/sessions/getWebsiteSessions.ts@@ -44,11 +44,11 @@ async function clickhouseQuery(websiteId: string, filters: QueryFilters, pageParcountry,subdivision1,city,- min(created_at) as firstAt,- max(created_at) as lastAt,+ min(min_time) as firstAt,+ max(max_time) as lastAt,uniq(visit_id) as visits,- sumIf(1, event_type = 1) as views- from website_event+ sumIf(views, event_type = 1) as views+ from website_event_stats_hourlywhere website_id = {websiteId:UUID}${dateQuery}${filterQuery}