Skip to content

Heatmaps and videos with Hotjar

Osvaldo edited this page Oct 8, 2023 · 5 revisions

If you use Hotjar and you have an enterprise account with the plus, business or scale plans you can integrate Abrantes with Hotjar.

The integration with Hotjar is optional and should be enabled or disabled using the plugin. See more about plugins here.

This integration will allow you to tag heat maps and video recordings with a event containing the experiment + variant. Once you do this the tag becomes available in your filters both in recordings and heatmaps.

To add a tag you just have to call Hotjar at the end of the experiment code. For example:

// Hotjar
MyTest.hotjar();

See the Hotjar example for more information.

GDPR compliance

The plugin will work if Hotjar is loaded and if it's called as described above. The way GDPR works is that you should only load the Hotjar script if/after the user has accepted cookies+tracking. Please note that this may not be available in all Hotjar tracking methods.

Because often user acceptance happens after the page has already loaded you should configure the user acceptance DOM events, like for example:

// Hotjar
MyTest.settings.hotjar.triggerEvents = ["load", "cookies:accept", "cookies:acceptall", "cookies:ok"];

This will make Abrantes try to tag the user, after any the 4 DOM events above.

Of course this should happen before MyTest.hotjar();

If you need to comply with GDPR and you can't ensure that only the users who gave explicit consent are tracked, do not use Hotjar!