How to enable Hotjar heatmaps or polls for a variation or personalization

Important

Create a Javascript Trigger in Hotjar

To enable Hotjar heatmaps or polls on a specific variation or personalization you need to create a Javascript trigger for the heatmap or poll. With this type of trigger, you will be able to trigger the heatmap or poll with a javascript code inside your variation or personalization in your experience.

Polls

For the Polls, create a new Poll and under "Targeting" select "On pages I specify" and then the last option "Javascript Trigger" (unfortunately it is active in paid plans only) as shown below:

Give it a name e.g. Success

Finish the rest of the poll setup: Question, Appearance and Behavior, and let’s head to Convert to add the special JavaScript code that will show the poll on the specific event we want.

Heatmaps

For the Heatmaps, create a new Heatmap and under "Page Targeting" select "Trigger a Javascript Snippet" and then select "Javascript Trigger" (unfortunately it is active in paid plans only) as shown below:

Give it a name e.g. trigger and finish the rest of the heatmap setup. Let’s head to Convert to add the special JavaScript code that will show the heatmap on the specific event we want.

Add Custom Javascript in Convert

Then after you create your Javascript trigger, go into your Convert experiment variation and add Custom Javascript to the variation you want to enable the heatmap or the poll for.

Then add the following code, replacing "mypoll" with the name of the Javascript that you have added to Hotjar's trigger:


convert.$( document ).ready(function() {    
       hj('trigger', 'mypoll');
       console.log('Triggering hotjar poll or heatmap');
});

Once the variation is shown to a visitor, it will add the interaction to the heatmap or show the poll configured with the Javascript trigger.

Troubleshoot

You can enable Convert Chrome Debugger and see if this integration (Convert-Hotjar) is enabled. A new line will be added like this:

Have more questions? Submit a request

Comments