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.

Fixes tracker code bug on handling pushState

João Pedro Netto5db40efba67d
diff --git a/tracker/index.js b/tracker/index.js
index f0ad78cda..52e095148 100644
--- a/tracker/index.js
+++ b/tracker/index.js
@@ -58,15 +58,15 @@ import { removeTrailingSlash } from '../lib/url';
/* Handle history */
- const handlePush = (state, title, navaigatedUrl) => {
+ const handlePush = (state, title, navigatedURL) => {
removeEvents();
currentRef = currentUrl;
- if (navaigatedUrl.startsWith('http')) {
- const url = new URL(navaigatedUrl);
+ if (navigatedURL.toString().startsWith('http')) {
+ const url = new URL(navigatedURL.toString());
currentUrl = `${url.pathname}${url.search}`;
} else {
- currentUrl = navaigatedUrl;
+ currentUrl = navigatedURL.toString();
}
pageView();