You can monitor your A/B tests using different Hotjar tools to gain a comprehensive understanding of your experiment results. This way, you can enrich your numerical data with insights that can only be observed while analyzing interactions with your site.
In this article, you'll learn more about:
- Setting up Hotjar tools to monitor A/B tests
- Monitoring A/B tests with Heatmaps
- Monitoring A/B tests with Recordings, Funnels, Trends, and Dashboards
- Using Events to trigger Surveys or Feedback widgets for page variants
- Using User Attributes to trigger Surveys or Feedback widgets for your A/B experiment
Setting up Hotjar tools to monitor A/B tests
Depending on your goals and the tools you're using, you can use integrations or Events to monitor your A/B tests with Hotjar.
Using integrations
You can use Hotjar's built-in integrations with the below A/B testing tools. If you're using one of these tools, follow instructions in the articles linked below:
Using Events to track A/B tests
You can set up Events to get access to session filtering options that will allow you to compare user behavior for page variants or trigger surveys and feedback widgets for the test variants of your site.
Before setting up Events for your A/B tests, we recommend reviewing our articles on What Are Events and How to Set Up Events. To use Events with A/B testing, you can add code similar to what is shown below to each page variation you'd like to track. For each page, you can replace viewed_homepage_A and viewed_homepage_B with the name of each of your test variations.
hj('event', 'viewed_homepage_A');
hj('event', 'viewed_homepage_B');
When comparing two variants, ensure each page has a separate event being sent to Hotjar. An example would be having the event viewed_homepage_A sent when loading variant A, and viewed_homepage_B sent when loading variant B. Find more details on using our Events API and best practices in our Events API Reference article.
After adding the page variant Events to your site, you'll see the Events appear as filtering options for Heatmaps, Recordings, Funnels, Trends, and Dashboards. You can also use them to trigger surveys or feedback widgets.
Monitoring A/B tests with Heatmaps
You can generate heatmaps to compare your control against the variant and see what's attracting the attention of your users. Below, you'll find instructions that explain the two most common scenarios for tracking A/B test results with Heatmaps.
Tracking variations that use different URLs
When the URL for each variation in your A/B test is different, you can use the Heatmap URL filter to show data for a variation.
Visit your Heatmaps page.
Select a URL filter, enter your control URL and then click View heatmap.
It's important to keep in mind how each of Hotjar's URL filters work in relation to the URLs being used in your A/B test. You can review our What Are Heatmap URL Filters article to better understand how they work.
Below are some examples of the filter you may want to choose based on how your control and variation URLs might differ:
- Path is different: if the path of your control and variant differ, then the URL is filter will likely work best. It will match the URL provided for the heatmap, ignoring query strings and fragments.
- Query string or fragment is different: if the URLs use a query string or fragment that differs between the control and variant, the URL is exactly filter will refine your heatmap data to include them.
Open the Heatmaps page in a second browser tab.
Use the same steps as above to display a heatmap for a test variation URL. You can then compare the heatmaps for your control and variation URLs.
Tracking variations that use the same URL
Using integrations to track A/B test results.
If you're using AB Tasty, Omniconvert, Optimizely, or Unbounce to run your A/B test, you don't have to set up Events to monitor the results. You can set up the integration and use the filtering options to achieve the same result.
If your A/B test is set up to randomly load different content for each user visiting the same page, this can be tracked using Hotjar Events. For example, when changes or actions occur on your site, such as the loading of a specific page variant, this occurrence can be sent to Hotjar as an Event. You can use session filters to focus on only sessions where the event occurred.
Set up Hotjar Events for your control and variants.
For A/B testing purposes, make sure the Event names you're using are unique to the page variation being tested.
After some time for data collection has passed, visit your Heatmaps page.
Enter the URL used for the A/B test and click View heatmap.
Click Add filter and select Events
Enter the event name used for your A/B test and click Apply.
If you only sent an event when a variant was loaded, you can view a heatmap for the control by choosing the is none of these condition inside the Events filter and entering the variant Event name(s).
To compare this side by side with a variant, you can then open your Heatmap dashboard in a second browser tab and apply the Events filter with the condition is any of these with a variant event name.
It's not possible to trigger a heatmap screenshot based on an Event
When applying an Event filter, Hotjar will show data collected from sessions where users triggered the Event at any point during their session. If the same Event is used on multiple URLs, you may be shown a screenshot of a different page than the URL you selected for your heatmap.
To see the expected screenshot, you may need to adjust the URL filter or manually update the screenshot.
Monitoring A/B tests with Recordings, Funnels, Trends, and Dashboards
Once you set up Events or an integration for your A/B test, you can use filters to find sessions of users exposed to the test variants. You can watch recordings of these sessions to enrich your A/B test numerical results, use filters to build Funnels and Trends for your experiment or refine your Dashboard data for the specific page variant.
Use the Event or Experiment filters to find sessions relevant for your A/B experiment:
See How Do I Filter Session Data for more details on session filtering.
Using Events to trigger Surveys or Feedback widgets for page variants
When A/B testing, you may want to display a survey or a feedback widget on a specific variation of your page. Hotjar allows you to target users on a specific page variant using Events.
Events will take priority over URL-based targeting rules
If a targeted event is present on a page, it will cause the Feedback widget to show regardless of any URL-specific rules on the page.
Add the Hotjar event code on your variant page(s).
Create a survey or a feedback widget.
Enter the name and continue the setup process until you reach the Targeting section.
In the Targeting section, select Specific pages.
Select Event from the Specific page dropdown and enter the event name.
Only alphanumeric characters, dashes, and underscores can be used in the event name. For example, viewed_test_variant_a.
Finish the setup process.
Using User Attributes to trigger Surveys or Feedback widgets for your A/B experiment
If you want to target a specific group of users to gather feedback about your A/B experiment, you can also trigger a survey or a feedback widget based on User Attributes: