From 65691f59126b5fc19ff1ec2d336b4e126f7f915e Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Fri, 3 Mar 2023 10:38:14 -0800 Subject: [PATCH] fix referrer domain on tracker load --- tracker/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tracker/index.js b/tracker/index.js index dd43eb17..f5765dc7 100644 --- a/tracker/index.js +++ b/tracker/index.js @@ -72,6 +72,12 @@ let currentPageTitle = document.title; let cache; + if (currentRef.substring(0, 4) === 'http') { + if ((currentRef = currentRef.split('/')[2].split(':')[0] === hostname)) { + currentRef = '/' + currentRef.split('/').splice(3).join('/'); + } + } + /* Collect metrics */ const getPayload = () => ({