mirror of
https://github.com/umami-software/umami.git
synced 2026-02-14 01:25:37 +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 */
|
/* Tracking functions */
|
||||||
|
|
||||||
const trackingDisabled = () =>
|
const trackingDisabled = () =>
|
||||||
|
!website ||
|
||||||
(localStorage && localStorage.getItem('umami.disabled')) ||
|
(localStorage && localStorage.getItem('umami.disabled')) ||
|
||||||
(domain && !domains.includes(hostname));
|
(domain && !domains.includes(hostname));
|
||||||
|
|
||||||
const send = async (payload, type = 'event') => {
|
const send = async (payload, type = 'event') => {
|
||||||
if (trackingDisabled()) return;
|
if (trackingDisabled()) return;
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof cache !== 'undefined') {
|
if (typeof cache !== 'undefined') {
|
||||||
headers['x-umami-cache'] = cache;
|
headers['x-umami-cache'] = cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(endpoint, {
|
const res = await fetch(endpoint, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue