Unbounce is a landing page builder that includes an A/B testing feature. It is designed to help you make high-converting landing pages without coding or design skills.
In this article, we'll first step through how to install the Hotjar tracking code inside Unbounce. You'll then learn how to use Hotjar's integration with Unbounce to get even more insights. This integration lets you filter session data in Hotjar by Unbounce page and variant, or target a survey or feedback widget to appear based on the Unbounce page variant a user lands on.
How to install the Hotjar tracking code on Unbounce
The steps in this section will install Hotjar on all pages, it can also be installed only on a single landing page
The steps below take you through the recommended approach of installing Hotjar's tracking code across all domains and pages in your Unbounce account. Instead, if you'd like to only install Hotjar on a single variant, you can do this inside the Editing view of the landing page variant. In the Editing view of the variant, click on Javascripts and paste in the Hotjar tracking code while changing the Placement to Head.
Visit your Sites page and copy the tracking code for your Site.
For this step, you may first need to add a new Site in Hotjar specific to your Unbounce site. For help with this, see our How to Add Organizations and Sites article.
Login to Unbounce and ensure you're in the Unbounce account where you'd like Hotjar installed.
Select the Settings section in the navigation sidebar, then click Script Manager.
Click Add a Script.
From the What would you like to add? prompt, select Custom Script.
Enter a Script Name, such as Hotjar Tracking Code, then click Add Script Details.
Update the Script Details section with the settings below.
- Next to Placement, select Head
- Next to Included on, select All pages
- Paste the tracking code you copied from Hotjar into the text field
Click Save to confirm the tracking code installation.
Using Hotjar's integration with Unbounce
The Unbounce integration enables you to filter session data in Hotjar by the Unbounce landing page and page variants. To get started with the integration, you'll need to have first installed the Hotjar tracking code inside Unbounce.
How to enable the Unbounce integration
The Unbounce integration is available on Observe or
plans.
Admin or Account Owner permissions are required
Only an Admin in your Hotjar Organization, or the Account Owner of your Hotjar account can enable the integration. Find out who the Admins and Account Owner are from your Team page.
Visit your Integrations page and select the site that will receive the integration. Then click Connect for Unbounce.
Turn on Automatically mark active experiments to enable the integration.
How to filter session data by Unbounce page and variant
The Unbounce integration is available on Observe or
plans.
Before filtering, the Unbounce integration must be enabled with at least one session captured in Hotjar
This integration first needs to be enabled inside Hotjar to apply Hotjar filters based on Unbounce page and variant. You will only see the page and variant in your Hotjar filter dropdown after Hotjar has captured at least one session that contains the page and variant.
The Unbounce page can be used to filter Hotjar session data. Hotjar tools that use session data include Heatmaps, Recordings, Funnels, and the Dashboard and Trends pages. It doesn't include Feedback widgets or Surveys.
Inside a Hotjar tool that uses session data, click Add filter and select Unbounce.
Enter your Unbounce Page name.
You can use the page field to search and select a page from the list.
Why can't I see any pages listed?
Hotjar will only receive Unbounce pages and variants when at least one session has been captured. If this is taking longer than expected, ensure that Session Capture is enabled and that any targeting settings will capture your Unbounce page(s).
Select the Variant(s) to filter by, then click Apply.
You'll now see only those sessions from users associated with the selected Unbounce page, based on the variant(s) you selected.
How to target a Hotjar survey or feedback widget on an Unbounce page variant
The Unbounce integration is available on Observe or
plans.
Visit the Targeting section in the set up of a survey or feedback widget.
If you're creating a new survey or feedback widget, see our How to Set Up Feedback and How to Create a Survey guides for further help.
Within the Pages subsection, select Specific pages and choose Event in the dropdown menu.
Enter the Event value for your page and variant using this case-sensitive syntax: page-name-variant-name.
For this event value syntax, special characters and whitespaces are replaced by hyphens.
The event name is also case-sensitive. For example:
- The page name is Sign up and the variant is Variant A, the targeting event value will be:
Sign-up-Variant-A
- The page name is Hotjar's landing page 2 and the variant is variant 2, the targeting event value will be:
Hotjar-s-landing-page-2-variant-2
Click Save changes and ensure the status of your survey or feedback widget is Active.
Your survey or feedback widget will appear when the event you've specified is present on a page. When using events for surveys, your behavior rules will still be followed. For example, you can set a survey to open after 10 seconds and use an event for targeting. In this case, the survey will appear 10 seconds after the event has been triggered (not 10 seconds after the page loaded).