mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 20:15:41 +01:00
save visit id and fix event id
This commit is contained in:
parent
04ea0bc68d
commit
971ccb6e41
3 changed files with 8 additions and 3 deletions
|
|
@ -136,7 +136,7 @@ async function rawQuery<T = unknown>(
|
||||||
format: 'JSONEachRow',
|
format: 'JSONEachRow',
|
||||||
});
|
});
|
||||||
|
|
||||||
return resultSet.json();
|
return resultSet.json() as T;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function findUnique(data: any[]) {
|
async function findUnique(data: any[]) {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ export async function saveEventData(data: {
|
||||||
websiteId: string;
|
websiteId: string;
|
||||||
eventId: string;
|
eventId: string;
|
||||||
sessionId?: string;
|
sessionId?: string;
|
||||||
|
visitId?: string;
|
||||||
urlPath?: string;
|
urlPath?: string;
|
||||||
eventName?: string;
|
eventName?: string;
|
||||||
eventData: DynamicData;
|
eventData: DynamicData;
|
||||||
|
|
@ -52,12 +53,13 @@ async function clickhouseQuery(data: {
|
||||||
websiteId: string;
|
websiteId: string;
|
||||||
eventId: string;
|
eventId: string;
|
||||||
sessionId?: string;
|
sessionId?: string;
|
||||||
|
visitId?: string;
|
||||||
urlPath?: string;
|
urlPath?: string;
|
||||||
eventName?: string;
|
eventName?: string;
|
||||||
eventData: DynamicData;
|
eventData: DynamicData;
|
||||||
createdAt?: string;
|
createdAt?: string;
|
||||||
}) {
|
}) {
|
||||||
const { websiteId, sessionId, eventId, urlPath, eventName, eventData, createdAt } = data;
|
const { websiteId, sessionId, visitId, eventId, urlPath, eventName, eventData, createdAt } = data;
|
||||||
|
|
||||||
const { getDateFormat, sendMessages } = kafka;
|
const { getDateFormat, sendMessages } = kafka;
|
||||||
|
|
||||||
|
|
@ -68,6 +70,7 @@ async function clickhouseQuery(data: {
|
||||||
website_id: websiteId,
|
website_id: websiteId,
|
||||||
session_id: sessionId,
|
session_id: sessionId,
|
||||||
event_id: eventId,
|
event_id: eventId,
|
||||||
|
visitId: visitId,
|
||||||
url_path: urlPath,
|
url_path: urlPath,
|
||||||
event_name: eventName,
|
event_name: eventName,
|
||||||
data_key: key,
|
data_key: key,
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ async function relationalQuery(data: {
|
||||||
await saveEventData({
|
await saveEventData({
|
||||||
websiteId,
|
websiteId,
|
||||||
sessionId,
|
sessionId,
|
||||||
|
visitId,
|
||||||
eventId: websiteEventId,
|
eventId: websiteEventId,
|
||||||
urlPath: urlPath?.substring(0, URL_LENGTH),
|
urlPath: urlPath?.substring(0, URL_LENGTH),
|
||||||
eventName: eventName?.substring(0, EVENT_NAME_LENGTH),
|
eventName: eventName?.substring(0, EVENT_NAME_LENGTH),
|
||||||
|
|
@ -143,7 +144,7 @@ async function clickhouseQuery(data: {
|
||||||
website_id: websiteId,
|
website_id: websiteId,
|
||||||
session_id: sessionId,
|
session_id: sessionId,
|
||||||
visit_id: visitId,
|
visit_id: visitId,
|
||||||
event_id: uuid(),
|
event_id: eventId,
|
||||||
country: country,
|
country: country,
|
||||||
subdivision1:
|
subdivision1:
|
||||||
country && subdivision1
|
country && subdivision1
|
||||||
|
|
@ -170,6 +171,7 @@ async function clickhouseQuery(data: {
|
||||||
await saveEventData({
|
await saveEventData({
|
||||||
websiteId,
|
websiteId,
|
||||||
sessionId,
|
sessionId,
|
||||||
|
visitId,
|
||||||
eventId,
|
eventId,
|
||||||
urlPath: urlPath?.substring(0, URL_LENGTH),
|
urlPath: urlPath?.substring(0, URL_LENGTH),
|
||||||
eventName: eventName?.substring(0, EVENT_NAME_LENGTH),
|
eventName: eventName?.substring(0, EVENT_NAME_LENGTH),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue