An existing Google Analytics setup is required
Before getting started, you'll need to have Google Analytics setup and running on your website. See Google's Get started with Analytics article for help with this.
The Hotjar Google Analytics (GA) integration enables you to drill through your Google Analytics data to see your users' actual experience inside Hotjar. This article provides some common use cases and outlines setting up the two features available with this Google Analytics integration.
The setup process for finding recordings, based on Hotjar User IDs being sent to Google Analytics, is different for those using Universal Analytics vs. Google Analytics 4. Be sure to follow the steps that match the Google Analytics version that you're using.
- Common use cases for the Google Analytics integration
- Creating Hotjar Events from Universal and Google Analytics 4 Events
- Finding recordings of users identified in Universal Analytics
- Finding recordings of users identified in Google Analytics 4
Note: The video above steps through the process using a Universal Analytics instance which will look different if you're using Google Analytics 4. See our written guides below for the steps involved with Google Analytics 4.
Google Tag Manager is not supported for this integration.
This integration does not support implementations of Google Analytics through Google Tag Manager (GTM), and possibly other tag managers. If GA is being added through GTM, the integration will not work. Google Analytics must be added to your website directly, not through a tag manager, in order to benefit from this integration.
Common use cases for the Google Analytics integration
The following are some example use cases for the Hotjar Google Analytics integration:
- You identify a behavior change in a Google Analytics user segment, such as an increase in bounce rate or a decrease in conversions. Get a complete understanding of the problem or opportunity by filtering Hotjar Recordings by a user from that Google Analytics segment.
- Enhancing your Google Analytics quantitative data with the related Hotjar Recordings to add support to your hypothesis for a product improvement opportunity.
- Analyze user flows in Hotjar by filtering Recordings with the related Events from Google Analytics, such as GA_started_checkout and GA_didnt_complete_order. Use the filtered recordings to find opportunities to optimize the user journey.
- Use Google Analytics Events to filter Heatmaps to see what's getting clicked on or ignored by users who triggered an event such as GA_cart_abandoned.
- Trigger a Hotjar Survey or Feedback widget when a specific user action fires a Google Analytics event.
Creating Hotjar Events from Google Analytics Events
Google Analytics "Goals" are not supported by this integration
Creating Hotjar Events from Google Analytics Events works with the current and upcoming version of Google Analytics (GA4). As GA4 will no longer use Goals, they aren't supported by the Hotjar Google Analytics integration.
Sending Google Analytics Events to Hotjar enables you to:
- Filter Recordings and Heatmaps by Google Analytics Events.
- Target Surveys and Feedback widgets based on Google Analytics Events (Requires the Ask Plus, Business, or Scale plan).
With your Site selected on the Hotjar Integrations page, click Connect for Google Analytics if you haven't already done so.
Turn on Automatically create events.
Hotjar will begin capturing Google Analytics Events and attaching them to session data used in Recordings and Heatmaps. You may need to allow some time to pass before captured Google Analytics Events appear in the Hotjar Events filter.
-
Filtering Recordings and Heatmaps by Google Analytics Events
From your Recordings or Heatmaps page, add a new filter and select Event. Then, start typing GA_ followed by the Google Analytics event name to find the relevant event.
-
Targeting Surveys and Feedback Widgets using Google Analytics Events
From the Targeting Settings of your Survey or Feedback widget set up, select Specific Pages and choose Event from the dropdown menu. Enter GA_ followed by the Google Analytics Event name as the value for the Event targeting field. Then click Done and Activate the Survey or Feedback widget.
Find recordings of users identified in Universal Analytics
With the Hotjar Google Analytics integration, you'll find the Hotjar User ID in Google Analytics which you can use to filter the Hotjar Recordings tool and isolate recordings for specific users.
Setting up this feature
Visit your Google Analytics Admin page by clicking on the gear icon found at the bottom-left of the sidebar.
In the Property column, click Custom Definitions.
Within Custom Definitions, click on Custom Dimensions.
Click New Custom Dimension.
Enter Hotjar ID as the Name, set the Scope to User, and leaving Active selected, click Create.
From the Custom Dimension table, make a note of the Index number for your newly created custom dimension.
Visit your Hotjar Integrations page, select your Site from the dropdown menu and click Connect for Google Analytics.
Turn on Automatically share Hotjar user IDs, enter the Index number you noted in Step 6 and click Save.
Using this feature
Visit the User Explorer page in Google Analytics.
Click on the Client ID for the user you're interested in.
Under Custom Dimensions, copy the Hotjar ID value.
Visit your Hotjar Recordings page and click Add filter.
Select Hotjar user ID, paste the Hotjar ID value into the ID field and click Apply.
This will filter your Recordings list by sessions that Hotjar has captured for the user you've identified from Google Analytics.
Find recordings of users identified in Google Analytics 4
Setting up this feature
Create a Custom dimension.
From the left side menu, click Configure. Then select Custom definitions section and click the button, Create custom dimensions.
Define the Custom dimension properties.
In the New custom dimension overlay, fill the following properties:
-
Dimension name: hjuid
-
Scope: User
-
Description: Hotjar User ID
-
User property: hjuid
After entering the properties above, click Save.
Create a User explorer page.
If you do not already have a User explorer page, follow these steps to create one in Google Analytics 4. The User explorer page will be utilized later.
Enable the Google Analytics integration from your Integrations page.
Visit your Hotjar Integrations page, select your Site from the dropdown menu and click Connect for Google Analytics if it's not already enabled.
Turn on Automatically share Hotjar user IDs, and leaving the text field blank, click Save.
The text field can be left blank when using Google Analytics 4. This is only used for Universal Analytics.
Using this feature
Open the User explorer page.
In Google Analytics 4, click on Explore from the left side menu. If you don't see any results in the "User explorer 1" tab shown below, you might need to adjust your date range filter. You should see something similar to this:
Open the User activity tab.
Click on a GA User Id (As shown in the "User explorer 1" tab in the screenshot above), to show the properties and events related to that user.
Click on the detect_user event.
After clicking on a user row, search for the detect_user event, and you'll find the hjuid (Hotjar User ID) under User Properties. It will look similar to this:
Visit your Hotjar Recordings page and click Add filter.
Select the Hotjar user ID filter.
Paste the hjuid (Hotjar User ID) value from Google Analytics 4 into the ID field and click Apply. Note that the ids shown in the screenshots will be different than the IDs in your account.
This will filter your Recordings list by sessions that Hotjar has captured for the user you've identified from Google Analytics.