If you have any problems collecting data when installing using Google Tag Manager, there are a few troubleshooting steps you can take to check things are set up correctly.
- Verifying Installation within Hotjar
- Checking Both GTM and Hotjar are Installed
- Problems with Hotjar Tags, Triggers, Virtual Page Views, or stateChange
If you haven't yet installed Hotjar through Google Tag Manager, take a look here to find a step by step guide.
Verifying Installation within Hotjar
The first you should do is to try verifying the installation inside Hotjar. If this step works, then you should be ready to start collecting data.
If not, you should check that you have published the version of your GTM script with the Hotjar Tracking Code installed. This is covered in Step 8 of the Hotjar installation on GTM documentation.
Alternatively, you may find it helpful to read the GTM documentation about Publishing, Versions, and Approvals.
Checking Both GTM and Hotjar are Installed
Open up your browser Developer Tools while on a page you want to track with Hotjar.
How to Open Your Browser Developer Tools
Click on the Network tab, and refresh your page.
Find your GTM script.
It should start with "gtm.js?id=GTM", and ends with your unique Google Tag Manager ID.
Find the Hotjar script
Your Hotjar script will start with "hotjar-", followed by your Hotjar Site ID.
- If you see neither the GTM script or Hotjar script: you have not installed GTM on your site yet. Find out how to install GTM in this support article.
- If you only see your GTM container: you may have forgotten to publish your Hotjar tag. Check Step 8 in our installation on GTM article, or visit GTM documentation on publishing a tag.
- If you see more than one Hotjar script: there are two possibilities. The first is that you may have installed Hotjar on your page before installing using GTM. You should remove one of the Tracking Codes. The second possibility is that you may have set your tag trigger for something other than "Page View", which causes GTM to load the script multiple times. You can read more about changing GTM trigger types here.
Problems with Hotjar Tags, Triggers, Virtual Page Views, or stateChange
If you plan on using any of these functions heavily, we recommend installing Hotjar through GTM manually as a custom tag.