Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging and tracking Hotjar data

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?

like image 637
Adam Benedek Avatar asked Nov 10 '16 12:11

Adam Benedek


People also ask

What is Hotjar tracking?

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.

How do you test for Hotjar?

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.

Does Hotjar record all visitors?

Hotjar captures the majority of user sessions in Heatmaps and Recordings, depending on your Observe plan's daily session limits.

Where is Hotjar tracking code?

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.


1 Answers

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.

Example console output, potentially sensitive informations hidden

like image 170
Adam Benedek Avatar answered Sep 20 '22 23:09

Adam Benedek