Ensure website id is passed to tracker.

This commit is contained in:
Mike Cao 2024-06-03 20:00:54 -07:00
parent bafa3ad8c9
commit 3a6971e173

View file

@ -193,17 +193,21 @@
/* Tracking functions */
const trackingDisabled = () =>
!website ||
(localStorage && localStorage.getItem('umami.disabled')) ||
(domain && !domains.includes(hostname));
const send = async (payload, type = 'event') => {
if (trackingDisabled()) return;
const headers = {
'Content-Type': 'application/json',
};
if (typeof cache !== 'undefined') {
headers['x-umami-cache'] = cache;
}
try {
const res = await fetch(endpoint, {
method: 'POST',