mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 05:37:20 +01:00
Updated tracker to send full url.
This commit is contained in:
parent
5c2cb97070
commit
a2a39b7ecd
2 changed files with 33 additions and 29 deletions
|
|
@ -35,19 +35,8 @@
|
|||
|
||||
/* Helper functions */
|
||||
|
||||
const parseURL = url => {
|
||||
try {
|
||||
const { pathname, search, hash } = new URL(url, location.href);
|
||||
|
||||
return pathname + (excludeSearch ? '' : search) + (excludeHash ? '' : hash);
|
||||
} catch (e) {
|
||||
return url;
|
||||
}
|
||||
};
|
||||
|
||||
const getPayload = () => ({
|
||||
website,
|
||||
hostname,
|
||||
screen,
|
||||
language,
|
||||
title,
|
||||
|
|
@ -62,7 +51,17 @@
|
|||
if (!url) return;
|
||||
|
||||
currentRef = currentUrl;
|
||||
currentUrl = parseURL(url.toString());
|
||||
currentUrl = new URL(url, location.href);
|
||||
|
||||
if (excludeSearch) {
|
||||
currentUrl.search = '';
|
||||
}
|
||||
|
||||
if (excludeHash) {
|
||||
currentUrl.hash = '';
|
||||
}
|
||||
|
||||
currentUrl = currentUrl.toString();
|
||||
|
||||
if (currentUrl !== currentRef) {
|
||||
setTimeout(track, delayDuration);
|
||||
|
|
@ -250,7 +249,7 @@
|
|||
};
|
||||
}
|
||||
|
||||
let currentUrl = parseURL(href);
|
||||
let currentUrl = href;
|
||||
let currentRef = referrer.startsWith(origin) ? '' : referrer;
|
||||
let title = document.title;
|
||||
let cache;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue