You can send Events using Google Tag Manager, Google Analytics, or Segment
It's possible to start sending Events to Hotjar using Google Tag Manager, Google Analytics, or Segment. For more details, see our How to Send Events with Google Tag Manager article, Using Hotjar with Google Analytics, or if you're using Segment visit our Using Hotjar with Segment guide.
With Hotjar Events, you can send events to Hotjar based on actions or changes happening on your site such as scrolling to a specific part of the page or when a specific page variant is shown. This article steps through how these events can be used in Hotjar to trigger Surveys to appear.
For more detail on Events and how they work, see our article on What are Events?
Using Events for Survey targeting can be useful when Hotjar's URL targeting rules are not enough. Keep in mind that Event-based targeting will override all URL-based targeting, including Excluded URL targets.
The Hotjar Events feature needs to be set up on your site and sending events before you follow this guide
You'll need to set up Hotjar Events on your site before following the steps in this article. See our How to Set Up Events article for an overview of what's required and our Events API guide for the code required to implement this feature.
Follow the steps to create a survey until you get to the Targeting section.
See our How to Set Up Surveys article for help creating a Survey.
In the Targeting section, select Specific pages and choose Event from the dropdown menu.
Enter the event name in the Event field.
This is the name of the event that, when triggered on your site, will make the Survey appear.
Click on Add another if you would like to add another targeting rule. Only alphanumeric characters (a-z, A-Z, 0-9), underscores (_), dashes (-), spaces, periods(.), colons (:), pipes (|) and forward slashes (/) can be used in the event name.
Events take priority over other targeting options such as URLs
If the targeted event is present on a page, it will take priority over other targeting rules present, including URL targeting rules. As events take priority, it will cause the Survey to show regardless of any other rules present.
If multiple events are being fired on the same page, and the events are being used to target different surveys, Hotjar will prioritize the most recently fired event. This means that one event might trigger Survey A to appear, but then if a different event (targeting Survey B) is fired on the same page, it would trigger Survey B to appear (and cause Survey A to disappear) because Survey B was targeted by the most recently fired event.
Finish creating the survey and set its status to Active.
Your Survey 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).
Trigger on page events, not state changes
Hotjar Events were designed to allow Surveys to appear based on events that occur on a webpage. Targeting Hotjar Events based on state changes rather than events on the page can cause inconsistent performance and is not advised.