How to install via Google Tag Manager on Hotjar
Install Hotjar via Google Tag Manager by copying your Hotjar tracking code from your dashboard and creating a new HTML tag in GTM. This method allows centralized management of your tracking scripts without modifying your website code directly.
Prerequisites
- Active Google Tag Manager account
- Hotjar account with tracking code access
- Website admin access
- Basic understanding of HTML tags
Step-by-Step Instructions
Get your Hotjar tracking code
<script> and ends with </script>.Access Google Tag Manager
Create a new HTML tag
Hotjar Tracking Code in the tag name field at the top.Add the Hotjar code
<script> and closing </script> tags.Configure the trigger
Save and test the tag
Publish the changes
Added Hotjar Tracking and description, then click Publish to make the changes live on your website.Verify installation in Hotjar
Common Issues & Troubleshooting
Hotjar not detecting installation after publishing GTM tag
Clear your browser cache and wait up to 10 minutes. Ensure the GTM container code is properly installed on your website and check that the Hotjar tag is firing in GTM's preview mode.
JavaScript console errors preventing Hotjar from loading
Check the browser console for errors. Common issues include missing semicolons in the tracking code or conflicts with other scripts. Verify you copied the complete tracking code from Hotjar.
Hotjar tag not firing in GTM preview mode
Check that your trigger is configured correctly and matches your website URLs. Ensure the All Pages trigger is selected and that your GTM container code is properly installed on the website.
Multiple Hotjar installations detected
Remove any hardcoded Hotjar tracking codes from your website HTML before implementing via GTM. Check for duplicate tags in GTM that might be loading Hotjar multiple times.