Start Hotjar screen recordings when users interact with Task Analytics

Start Hotjar screen recordings with Google Tag Manager


Start a Hotjar screen recording as soon as your user interacts with Task Analytics. This will allow you to record only those visitors where intent and completion score are known. You will get fewer screen recordings, but you will know the task, completion score and optional category questions of the screen recordings you do get!



Tag screen recording tagging feature is only available on Hotjar's Plus and Business plan. More information 

Quick start? Use our Google Tag Manager import container

We've created an import container for Google Tag Manager. The only thing left to do is downloading the JSON-file and importing the settings to your Google Tag Manager. You'll be able to enrich your screen recordings with answers given by users.



Content of this tutorial
  1. Set up a Hotjar javascript trigger called "task_analytics" in Hotjar
  2. Create a trigger in Google Tag Manager 
  3. Create a tag in Google Tag Manager with the Hotjar javascript trigger

1. Setup screen recordings using a javascript trigger

You can use a javascript trigger to start Hotjar recordings. This allows you to set up a trigger in Google Tag Manager that starts a Hotjar recording once the user interacts with the Task Analytics invitation pop-up.

First thing you need to do is log in to Hotjar and start a new recording. Use a javascript trigger called "taskanalytics_and_hotjar" as a trigger to start screen recordings.
Use a javascript trigger to start screen recordings in Hotjar 
More info? Hotjar has written a great help article on how to set up javascript triggers. Visit Hotjar's Help article

2. Create a trigger in Google Tag Manager

Once done, log in to Google Tag Manager. Add a trigger that is fired once a user interacts with the Task Analytics pop-up. Use the following settings for the trigger:

  • Click Element
  • matches CSS selector
    that is equal to
  • [data-config-metrics-group="Task Analytics"]

This tells Google Tag Manager to fire an event once the user clicks on a link of Task Analytics.
Create a trigger to track interactions with the Task Analytics pop-up invitation

3. Create a trigger in Google Tag Manager

The last step is creating a tag that will be executed once the trigger is fired. Create "Custom HTML" as tag type and add the following HTML:

  1. <script>
  2.   hj('trigger', 'taskanalytics_and_hotjar');
  3. </script>
Add custom HTML to start Hotjar's screen recording
Add Firing Trigger
Add the firing trigger you've just created to the custom HTML tag. This will make sure the custom HTML is executed once a user interacts with the Task Analytics invitation pop-up.

You can publish your tag & trigger with Google Tag Manager to start the Hotjar screen recordings. You can use the same methodology to track user's interactions with tasks, completion scores and all other questions you might have added in your survey. Use Hotjar's javascript tagging to tag recordings with the answers given by users. Or, use our existing Hotjar integration.

Extra:
Google Tag Manager import container

You can download the Google Tag Manager import container to get started within minutes.
The benefits of using the import container:
  1. You'll start recording users once they interact with the Task Analytics invitation pop-up
  2. You'll be able to see tags of all answers given. This includes category questions and your own questions.
    Note! Open-ended answers and "Other"-answers are not being tracking to comply with GDPR.
  3. Don't forget to update or use your existing Hotjar tracking ID. That's the only thing left to change. 
You'll find the import container as an attachment at the bottom of this article.

    • Related Articles

    • Enable the Hotjar integration and start tagging screen recordings

      Task Analytics allows you to enrich Hotjar's screen recordings with task & completion scores. This is a powerful feature that allows you to sift through screen recordings and zoom in on videos for a specific task or filter based on completion scores. ...
    • Install Task Analytics with Google Tag Manager

      You can install Task Analytics on your website, app or intranet with the Google Tag Manager. Step 1: Get the Task Analytics javascript Retrieve the Task Analytics javascript. This javascript is generated automatically and is unique for your account. ...
    • The benefits of integrating Task Analytics with Hotjar

      Looking at videos of your users is one of the best things you can do to understand how they interact with your website or app. But setting up and recording users is one thing, analyzing and interpreting the result is a different ball game. You’re ...
    • Import Google Tag Manager container for Google Analytics

      We’ve created a Google Tag Manager import container, containing the necessary elements to make Google Tag Manager work with Google Analytics and Task Analytics. You can download the container settings and import into your Google Tag Manager. Download ...
    • Analyzing Task Analytics data in Google Analytics

      You've finished the integration of Task Analytics and Google Analytics. Great! Now it's time to analyse the Task Analytics in Google Analytics. Create segments, filter data based on completion scores, segments or audiences.  Google Analytics 3rd ...