The Optimizely integration works with Hotjar's session filters and Surveys, enabling you to filter session data based on Optimizely X experiments and target Surveys alongside your Optimizely experiments.
How to enable the Optimizely integration
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 Optimizely.
Turn on Automatically track recordings with the active experiment. This enables the integration.
How to filter session data by Optimizely X experiments
Filtering session data with the Optimizely integration is available on Observe or
plans.
With the Optimizely integration, your Optimizely Experiments will be available as Events inside Hotjar, enabling you to filter Hotjar session data in tools such as Heatmaps, Recordings, Trends, and your Dashboards.
Unmask experiment names from inside your Optimizely settings.
By default, Optimizely masks the names of your experiments. Unmasking will enable Optimizely experiments to appear in Hotjar's Events filter with the descriptive experiment and variant names: [experimentName] / [variantName]. If masking is still applied in Optimizely, then experiments will appear in Hotjar as numerical IDs: [experimentId] / [variantId], making it more difficult identify the experiment and variant you're interested in.
You can unmask experiment descriptive names by visiting your Optimizely Settings and the Implementation tab. Then, unselect the option to Mask descriptive names in project code and third-party integrations.
For more help with this, see Optimizely's Mask descriptive names documentation.
Be aware of limitations with Optimizely Experiments and Hotjar Events
Optimizely experiments appear in Hotjar's Events filter and there are three limitations to be aware of. The event name must not exceed 250 characters and can only contain alphanumeric characters (a-z, A-Z, 0-9), underscores (_), and dashes (-). There is also a 1,000 unique event limit per Hotjar site, with an unlimited number of users associated with those events. Lastly, it's not currently possible to pass any event properties with the event.
Start the test from within Optimizely.
After visiting your Optimizely X interface and starting the test, users in the active test will have their sessions associated with the experiment event being sent to Hotjar.
Apply the Events filter in Hotjar to view session data from the Optimizely experiment.
After at least one session from the experiment has been captured, the experiment name and variant should become available in Hotjar's Events filter. You can then compare variants in an A/B test by using the Events filter to isolate sessions for one variant and then compare it to another variant by again applying the Events filter using the other variant.
How to target Surveys based on Optimizely X experiments
Survey targeting with Events is available on Ask ,
or
plans.
Optimizely experiments are passed to Hotjar as Events that can then be used to target Hotjar Surveys. This means if you'd like to run a survey or collect a list of user testers on a specific variation that you're testing, you can use Hotjar Events.
Follow the steps to create a survey until you get to the Targeting section.
In the Targeting section, select Specific pages and choose Event from the dropdown menu.
Enter an event name in the Event field for an Optimizely variation.
You can enter any string that describes the variation you're testing. In the example image below, you would replace the text viewed_optimizely_variation_a with your own string that relates to the variation where you want to trigger your survey.
You can add more Event triggers for other variations by clicking on Add another, ensuring that you use a different event name for each variation.
In the following steps, we'll add Hotjar's Events API code to your Optimizely variation so the survey can be triggered when the event occurs.
From within your Optimizely experiment, select the variation you'd like to trigger the event on.
Click the Variation Code Editor icon, located towards the top-right.
For more help with Optimizely's Variation Code Editor, see Optimizely's article on Adding custom code to a variation.
Enter the code needed to make calls to Hotjar's Events API, then click Save & Apply.
In the example code below, the viewed_optimizely_variation_a event is being sent to Hotjar. When the event occurs, a survey set up in Hotjar to trigger based on that event name will appear on the variant page.
You'll need to change the event name in the example code below from viewed_optimizely_variation_a to the string that you entered for your own variant in the Targeting section of your Hotjar survey, as described in the steps above.
window.hj=window.hj||function(){(hj.q=hj.q||[]).push(arguments);};
hj('event', 'viewed_optimizely_variation_a');
The survey will still use the survey behavior rules specified when the survey was first created.