From d6d1c68e6dbacdda3aa8b2fac70322a1c873f49e Mon Sep 17 00:00:00 2001 From: Bartosz Hernas Date: Tue, 15 Sep 2020 00:12:09 +0200 Subject: [PATCH] Fix tracker --- tracker/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tracker/index.js b/tracker/index.js index 7bb1b7b3..9c00a47b 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(); }