Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix tracker

Bartosz Hernasd6d1c68e6dba
diff --git a/tracker/index.js b/tracker/index.js
index 7bb1b7b3a..9c00a47b5 100644
--- a/tracker/index.js
+++ b/tracker/index.js
@@ -55,9 +55,6 @@ import { removeTrailingSlash } from '../lib/url';
pageView();
};
- history.pushState = hook(history, 'pushState', handlePush);
- history.replaceState = hook(history, 'replaceState', handlePush);
-
/* Handle events */
const removeEvents = () => {
@@ -84,7 +81,7 @@ import { removeTrailingSlash } from '../lib/url';
if (!window.umamiTrack) {
window.umamiTrack = (type, params, id) => {
if (!id) {
- id = website
+ id = website;
}
const payload = {
url: currentUrl,
@@ -111,6 +108,8 @@ import { removeTrailingSlash } from '../lib/url';
/* Start */
const skipAuto = new URL(script.src).search.includes('auto=false');
if (!skipAuto) {
+ history.pushState = hook(history, 'pushState', handlePush);
+ history.replaceState = hook(history, 'replaceState', handlePush);
pageView();
}