Add event_data base.

This commit is contained in:
Brian Cao 2023-03-20 13:21:16 -07:00
parent 72af76a417
commit 15c5cc065e
19 changed files with 395 additions and 45 deletions

View file

@ -61,7 +61,7 @@
const root = hostUrl
? hostUrl.replace(/\/$/, '')
: currentScript.src.split('/').slice(0, -1).join('/');
const endpoint = `${root}/api/collect`;
const endpoint = `${root}/api/send`;
const screen = `${width}x${height}`;
const eventClass = /^umami--([a-z]+)--([\w]+[\w-]*)$/;
const eventSelect = "[class*='umami--']";
@ -73,7 +73,7 @@
let cache;
if (currentRef.substring(0, 4) === 'http') {
if ((currentRef = currentRef.split('/')[2].split(':')[0] === hostname)) {
if (currentRef.split('/')[2].split(':')[0] === hostname) {
currentRef = '/' + currentRef.split('/').splice(3).join('/');
}
}
@ -118,6 +118,7 @@
const trackEvent = (
eventName,
eventData,
url = currentUrl,
websiteId = website,
pageTitle = currentPageTitle,
@ -128,7 +129,8 @@
website: websiteId,
url,
pageTitle,
eventName: eventName,
eventName,
eventData,
}),
);