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 for IE 11.

Mike Cao598a95af9490
diff --git a/tracker/index.js b/tracker/index.js
index c20a1d25e..fc8458b00 100644
--- a/tracker/index.js
+++ b/tracker/index.js
@@ -35,7 +35,7 @@ import { removeTrailingSlash } from '../lib/url';
const root = hostUrl
? removeTrailingSlash(hostUrl)
- : new URL(script.src).href.split('/').slice(0, -1).join('/');
+ : script.src.split('/').slice(0, -1).join('/');
const screen = `${width}x${height}`;
const listeners = [];
let currentUrl = `${pathname}${search}`;
@@ -139,8 +139,7 @@ import { removeTrailingSlash } from '../lib/url';
const newUrl = url.toString();
if (newUrl.substring(0, 4) === 'http') {
- const { pathname, search } = new URL(newUrl);
- currentUrl = `${pathname}${search}`;
+ currentUrl = '/' + newUrl.split('/').splice(3).join('/');
} else {
currentUrl = newUrl;
}