This feature is only available on our Plus and Business plan.
To learn more about everything our Plus and Business plan has to offer, head to Hotjar Plans for more information.
Hotjar allows you to trigger Heatmaps, Recordings, and Feedback tools by event, instead of page targeting rules. This is useful if you want to trigger one of these tools on an event such as a button click.
Heatmaps
JavaScript triggers are not available in early releases of Continuous Heatmaps
If you are on a Hotjar Business or Plus plan, your Heatmaps may be based on continuous capture by default and the functionality to trigger Heatmaps by JavaScript is not yet available. As we transition to Continuous Heatmaps, you will still have access to manual snapshot-based Heatmaps as well. Learn more about Continuous Heatmaps.
Some useful examples of triggering Heatmaps using JavaScript are:
- A/B testing, when the URL is the same for both variations
- Capturing Heatmaps of modals
- Capturing specific states of your single-page web application
Check out our step by step JS trigger Heatmap guide and learn more about triggering Heatmaps with JavaScript.
Recordings
An example of when triggering Recordings using JavaScript is useful is:
- When you only want to Record users after they have logged in
Check out our step by step JS trigger Recording guide and learn more about triggering Recordings with Javascript.
Feedback tools
Some examples of when triggering Feedback tools is useful are:
- For requesting additional feedback after upvoting or downvoting an article
- Collecting feedback from users who interact with a fake door test
Check out our step by step JS trigger Feedback tool guide and learn more about triggering Feedback tools with JavaScript.
You can also set up JavaScript Triggers through Google Tag Manager.
If you use Google Tag Manager to load the Hotjar script on your site, you can set up JavaScript Triggers on the GTM tag that fires the Hotjar tracking code. Check out this guide on how to set up JavaScript Triggers in GTM.