Recently, our company started using Hotjar to collect usage data. As this is my first time using the service, I made some mistakes, which made me search for a method for debugging. After reading the official documentation, forums, stackoverflow, I found nothing.
What do I have to do/modify to enable debugging in Hotjar?
The Hotjar Tracking Code is used to trigger data collection when installed within your site. This code is responsible for collecting and sending the data to your Hotjar account. Installation involves copy and pasting your unique Tracking Code within the site you would like to track.
Go to your Sites page. Click on View tracking code for the relevant Site. On the Verify installation tab, click Verify installation. This button will open a browser window and display a message telling you if Hotjar is installed correctly.
Hotjar captures the majority of user sessions in Heatmaps and Recordings, depending on your Observe plan's daily session limits.
The Hotjar Tracking Code is a JavaScript snippet that is unique to each site you add to Hotjar. You'll find the Tracking Code on your Sites & Organizations page by clicking on Install tracking code. To begin collecting data, you'll first need to install this Tracking Code on your live site.
You can enable debugging in the tracking script. Just add the following line in the h._hjSettings
line:
hjdebug:true
<!-- Hotjar Tracking Code for www.example.com -->
<script>
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:YOUR_CUSTOMER_ID,hjsv:HOTJAR_VERSION_NUMBER,hjdebug:true};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'//static.hotjar.com/c/hotjar-','.js?sv=');
</script>
When you use the tracking code this way, your console will display basically everything that happens during the process. For me, it was especially helpful as it helped me make sure that the virtual page views registered without any errors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With