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
Observe , Observe Observe , Observe
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, Funnels, 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.
Check that your experiment names are compatible.
Once your experiment names are unmasked, you can make sure they aren't affected by any of the limitations that apply to Hotjar Events and Optimizely experiment names:
- The experiment name cannot contain 9 or more consecutive digits, or it will be flagged as personally identifying information, and Hotjar will not store the event.
- The experiment name must not exceed 250 characters and can only contain alphanumeric characters (a-z, A-Z, 0-9), underscores (_), and dashes (-).
- There is a 1,000 unique event limit per Hotjar site, which means you cannot track more than 1,000 unique Optimizely experiments
- 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
Plan availability Ask , Ask , Ask
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.
The survey will still use the survey behavior rules specified when the survey was first created.
Why don’t I see any Optimizely experiments in the events filter?
If you don’t see your experiments in the Events filter, there are two common places to check for errors: