diff --git a/src/tracker/index.js b/src/tracker/index.js index 6b5b7066..e0c03689 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;