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): Correctly extract pathname

Aldo Románaef4b23cce3b
diff --git a/src/tracker/index.js b/src/tracker/index.js
index dd125c823..d5278b21f 100644
--- a/src/tracker/index.js
+++ b/src/tracker/index.js
@@ -42,7 +42,13 @@
};
};
- const getPath = url => new URL(url).pathname;
+ const getPath = url => {
+ try {
+ return new URL(url).pathname;
+ } catch (e) {
+ return url;
+ }
+ };
const getPayload = () => ({
website,