mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 17:15:37 +01:00
update CH event to website_event
This commit is contained in:
parent
05933ff1d2
commit
95ed8a09aa
12 changed files with 15 additions and 142 deletions
|
|
@ -97,7 +97,7 @@ async function clickhouseQuery(
|
|||
event_name x,
|
||||
${getDateQuery('created_at', unit, timezone)} t,
|
||||
count(*) y
|
||||
from event
|
||||
from website_event
|
||||
where website_id = {websiteId:UUID}
|
||||
and event_type = ${EVENT_TYPE.customEvent}
|
||||
and created_at >= ${getDateFormat(resetDate)}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ function clickhouseQuery(websiteId: string, startAt: Date) {
|
|||
toUnixTimestamp(created_at) as timestamp,
|
||||
url_path,
|
||||
event_name as eventName
|
||||
from event
|
||||
from website_event
|
||||
where event_type = ${EVENT_TYPE.customEvent}
|
||||
and website_id = {websiteId:UUID}
|
||||
and created_at >= {startAt:DateTime('UTC')}`,
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ async function clickhouseQuery(data: {
|
|||
subdivision1,
|
||||
subdivision2,
|
||||
city,
|
||||
...args
|
||||
} = data;
|
||||
const { getDateFormat, sendMessage } = kafka;
|
||||
const eventId = uuid();
|
||||
|
|
@ -148,6 +149,7 @@ async function clickhouseQuery(data: {
|
|||
event_type: eventName ? EVENT_TYPE.customEvent : EVENT_TYPE.pageView,
|
||||
event_name: eventName ? eventName?.substring(0, EVENT_NAME_LENGTH) : null,
|
||||
created_at: createdAt,
|
||||
...args,
|
||||
};
|
||||
|
||||
await sendMessage(message, 'event');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue