HotJar abruptly ends after user is directed to another section of the website via JavaScript

63 Views Asked by At

I'm building a web app (wordpress) that includes the following function:

document.getElementById("troubleshoot").innerHTML = "Forwarding...";
if(1==1){
    window.location.href = link;
}

The code above shows the last part of the function, with a troubleshooting message before the user is forwarded. The point of using 1==1 was because the function would sometimes forward the user to the link before all parts of the function had executed. The 'link' is the checkout page, on the same web application.

The problem is, most of my users come from Facebook or Instagram ads. I can track them via HotJar. In many of the videos however, HotJar abruptly ends after the user clicks this link. I know that the function has reached that stage because I can see the troubleshooting text. I also know that the HotJar code is working on the checkout page (link) because most of the time I can track users all the way until checkout.

Does anyone have any idea what could be causing this issue? Many thanks.

0

There are 0 best solutions below