mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 12:05:41 +01:00
try to save referrer to local storage
This commit is contained in:
parent
6f532d6902
commit
7ec87553cc
1 changed files with 12 additions and 0 deletions
|
|
@ -264,6 +264,18 @@
|
|||
let cache;
|
||||
let initialized;
|
||||
|
||||
// Save referrer
|
||||
if (currentRef && localStorage) {
|
||||
try {
|
||||
const { hostname: refHostname } = new URL(currentRef);
|
||||
if (refHostname !== hostname) {
|
||||
localStorage.setItem('umami.referrer', currentRef);
|
||||
}
|
||||
} catch (e) {
|
||||
/* empty */
|
||||
}
|
||||
}
|
||||
|
||||
if (autoTrack && !trackingDisabled()) {
|
||||
if (document.readyState === 'complete') {
|
||||
init();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue