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.

feat: Add support for hash-based routing tracking

wuzhiqing3fb68e168442
diff --git a/src/tracker/index.js b/src/tracker/index.js
index 707594cf4..1cf7c1860 100644
--- a/src/tracker/index.js
+++ b/src/tracker/index.js
@@ -53,8 +53,9 @@
const parseURL = url => {
try {
- const { pathname, search } = new URL(url);
- url = pathname + search;
+ // use location.origin as the base to handle cases where the url is a relative path
+ const { pathname, search, hash } = new URL(url, location.origin);
+ url = pathname + search + hash;
} catch (e) {
/* empty */
}