This article involves the Events filter, which is available on Observe , or plans.
This article involves the Events filter, which is available on Observe or plans.
Before setting up Events with your A/B test, we recommend reviewing our articles on What Are Events and How to Set Up Events. To use Events with A/B testing, you could add code similar to what is shown below to each page variation you'd like to track. For each page, you would replace viewed_homepage_A and viewed_homepage_B with the name of each of your test variations.
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, Hotjar will be sent these events during user sessions on those pages. After a recording has been collected with the associated event, you'll see the events appear when selecting the event filter on your Recordings list page.
See our article, How Do I Filter Session Data, for more details on session filtering.