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.

Fixed referrer check. Closes #3016.

Mike Cao6ed660d8a78c
diff --git a/src/tracker/index.js b/src/tracker/index.js
index 6b5b70662..e0c036894 100644
--- a/src/tracker/index.js
+++ b/src/tracker/index.js
@@ -6,7 +6,7 @@
document,
history,
} = window;
- const { hostname, href } = location;
+ const { hostname, href, origin } = location;
const { currentScript, referrer } = document;
const localStorage = href.startsWith('data:') ? undefined : window.localStorage;
@@ -260,7 +260,7 @@
}
let currentUrl = parseURL(href);
- let currentRef = referrer !== hostname ? referrer : '';
+ let currentRef = referrer.startsWith(origin) ? '' : referrer;
let title = document.title;
let cache;
let initialized;