How to configure the Hotjar Tag in Matomo Tag Manager
Matomo Tag Manager lets you manage all your tags in one platform, so you do not need to set add more scripts to your website or set up additional tracking in Hotjar.
By using the Hotjar Tag in Matomo Tag Manager, you can capture visitor interactions such as viewing a page or clicking on an image, and send the data to your Hotjar site account for reporting.
Requirements
Before configuring the Hotjar Tag in MTM, ensure the following is in place:
- You have a Hotjar account and site ID (found on your account homepage).
- The Matomo Tag Manager container code has been installed on your website.
Define the Hotjar Tag
- In Matomo Tag Manager, navigate to Tags.
- Click Create New Tag and choose the Hotjar Tag.
- Provide a descriptive name and enter your Hotjar Site ID.
- The Hotjar snippet version refers to the version of your Hotjar tracking code. Changing the default is only required when Hotjar updates the tracking code. Read more about the Hotjar snippet version.
- In the section, Configure when the tag should do this, choose the trigger that will execute the tag, e.g., a custom event trigger could fire the tag when an image is clicked.
- Save the new tag.
Test and Publish
- Use the Preview and Debug mode in Matomo Tag Manager to test your configuration.
- Perform the actions on your website that are supposed to trigger the Hotjar Tag (e.g., image click).
- In the Preview panel, check the Tags tab to confirm the Hotjar Tag is firing when expected.
- Go to your Hotjar account and view the dashboard reports to check the interactions are being recorded.
- Once successfully set up, publish the changes to your live environment.