mirror of
https://github.com/kremalicious/umami.git
synced 2025-01-11 21:45:53 +01:00
fix save event/pageview for CH
This commit is contained in:
parent
e9c8d16d5b
commit
4fbcf68b22
@ -39,7 +39,7 @@ async function relationalQuery(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function clickhouseQuery(data) {
|
async function clickhouseQuery(data) {
|
||||||
const { websiteId, sessionId, url, eventName, eventData } = data;
|
const { websiteId, id: sessionId, url, eventName, eventData, country, ...args } = data;
|
||||||
const { getDateFormat, sendMessage } = kafka;
|
const { getDateFormat, sendMessage } = kafka;
|
||||||
const website = await cache.fetchWebsite(websiteId);
|
const website = await cache.fetchWebsite(websiteId);
|
||||||
|
|
||||||
@ -52,6 +52,8 @@ async function clickhouseQuery(data) {
|
|||||||
event_data: eventData ? JSON.stringify(eventData) : null,
|
event_data: eventData ? JSON.stringify(eventData) : null,
|
||||||
rev_id: website?.revId || 0,
|
rev_id: website?.revId || 0,
|
||||||
created_at: getDateFormat(new Date()),
|
created_at: getDateFormat(new Date()),
|
||||||
|
country: country ? country : null,
|
||||||
|
...args,
|
||||||
};
|
};
|
||||||
|
|
||||||
await sendMessage(params, 'event');
|
await sendMessage(params, 'event');
|
||||||
|
@ -26,7 +26,7 @@ async function relationalQuery(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function clickhouseQuery(data) {
|
async function clickhouseQuery(data) {
|
||||||
const { websiteId, sessionId, url, referrer } = data;
|
const { websiteId, id: sessionId, url, referrer, country, ...args } = data;
|
||||||
const website = await cache.fetchWebsite(websiteId);
|
const website = await cache.fetchWebsite(websiteId);
|
||||||
const { getDateFormat, sendMessage } = kafka;
|
const { getDateFormat, sendMessage } = kafka;
|
||||||
|
|
||||||
@ -37,6 +37,8 @@ async function clickhouseQuery(data) {
|
|||||||
referrer: referrer?.substring(0, URL_LENGTH),
|
referrer: referrer?.substring(0, URL_LENGTH),
|
||||||
rev_id: website?.revId || 0,
|
rev_id: website?.revId || 0,
|
||||||
created_at: getDateFormat(new Date()),
|
created_at: getDateFormat(new Date()),
|
||||||
|
country: country ? country : null,
|
||||||
|
...args,
|
||||||
};
|
};
|
||||||
|
|
||||||
await sendMessage(msg, 'event');
|
await sendMessage(msg, 'event');
|
||||||
|
Loading…
Reference in New Issue
Block a user