default to empty path if parsing from <a> fails. #73

This commit is contained in:
Danny van Kooten 2018-06-23 17:45:53 +02:00
parent ad29167db1
commit 67308e3348

View File

@ -79,6 +79,11 @@ function trackPageview() {
path = a.pathname;
}
// if parsing path failed, default to main page
if(!path) {
path = '/';
}
// only set referrer if not internal
let referrer = '';
if(document.referrer.indexOf(location.hostname) < 0) {