mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Ensure website id is passed to tracker.
This commit is contained in:
parent
bafa3ad8c9
commit
3a6971e173
1 changed files with 4 additions and 0 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue