mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Add event type to event.
This commit is contained in:
parent
c90194dad4
commit
d85b2be5f8
4 changed files with 20 additions and 10 deletions
|
|
@ -72,11 +72,12 @@ async function clickhouseQuery(data: {
|
|||
const { getDateFormat, sendMessage } = kafka;
|
||||
const website = await cache.fetchWebsite(websiteId);
|
||||
|
||||
const params = {
|
||||
const message = {
|
||||
website_id: websiteId,
|
||||
session_id: sessionId,
|
||||
event_id: uuid(),
|
||||
url: url?.substring(0, URL_LENGTH),
|
||||
event_type: UmamiApi.EventType.Event,
|
||||
event_name: eventName?.substring(0, EVENT_NAME_LENGTH),
|
||||
event_data: eventData ? JSON.stringify(eventData) : null,
|
||||
rev_id: website?.revId || 0,
|
||||
|
|
@ -85,7 +86,7 @@ async function clickhouseQuery(data: {
|
|||
...args,
|
||||
};
|
||||
|
||||
await sendMessage(params, 'event');
|
||||
await sendMessage(message, 'event');
|
||||
|
||||
return data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ async function clickhouseQuery(data) {
|
|||
const website = await cache.fetchWebsite(websiteId);
|
||||
const { getDateFormat, sendMessage } = kafka;
|
||||
|
||||
const msg = {
|
||||
const message = {
|
||||
session_id: sessionId,
|
||||
website_id: websiteId,
|
||||
url: url?.substring(0, URL_LENGTH),
|
||||
|
|
@ -58,10 +58,11 @@ async function clickhouseQuery(data) {
|
|||
rev_id: website?.revId || 0,
|
||||
created_at: getDateFormat(new Date()),
|
||||
country: country ? country : null,
|
||||
event_type: UmamiApi.EventType.Pageview,
|
||||
...args,
|
||||
};
|
||||
|
||||
await sendMessage(msg, 'event');
|
||||
await sendMessage(message, 'event');
|
||||
|
||||
return data;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue