From 6424100223a2ceda6846c35582a0aef60313880b Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Fri, 7 Apr 2023 11:48:43 -0700 Subject: [PATCH 1/3] Fixed typo in query. --- queries/analytics/event/getEvents.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queries/analytics/event/getEvents.ts b/queries/analytics/event/getEvents.ts index de66731c..32bd1dd9 100644 --- a/queries/analytics/event/getEvents.ts +++ b/queries/analytics/event/getEvents.ts @@ -35,7 +35,7 @@ function clickhouseQuery(websiteId: string, startAt: Date, eventType: number) { url_path, event_name as eventName from website_event - where event_type = {eventType:Uint32} + where event_type = {eventType:UInt32} and website_id = {websiteId:UUID} and created_at >= {startAt:DateTime('UTC')}`, { From 24ac7d6be09f713eb4809e0305b1aed7e28cc985 Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Fri, 7 Apr 2023 14:23:38 -0700 Subject: [PATCH 2/3] fix urlPath clickhouse --- queries/analytics/event/getEvents.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queries/analytics/event/getEvents.ts b/queries/analytics/event/getEvents.ts index 32bd1dd9..ddc81528 100644 --- a/queries/analytics/event/getEvents.ts +++ b/queries/analytics/event/getEvents.ts @@ -32,7 +32,7 @@ function clickhouseQuery(websiteId: string, startAt: Date, eventType: number) { session_id as sessionId, created_at as createdAt, toUnixTimestamp(created_at) as timestamp, - url_path, + url_path as urlPath, event_name as eventName from website_event where event_type = {eventType:UInt32} From 7a1ac22dde8285f12b71b4c8899d8f80156cdbe7 Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Fri, 7 Apr 2023 14:37:22 -0700 Subject: [PATCH 3/3] add referrer_domain to getEvent --- queries/analytics/event/getEvents.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/queries/analytics/event/getEvents.ts b/queries/analytics/event/getEvents.ts index ddc81528..b3853f2d 100644 --- a/queries/analytics/event/getEvents.ts +++ b/queries/analytics/event/getEvents.ts @@ -33,6 +33,7 @@ function clickhouseQuery(websiteId: string, startAt: Date, eventType: number) { created_at as createdAt, toUnixTimestamp(created_at) as timestamp, url_path as urlPath, + referrer_domain as referrerDomain, event_name as eventName from website_event where event_type = {eventType:UInt32}