Search code examples
debuggingdata-collectionhotjar

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?


Solution

  • 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