Plan availability
Available for Recordings and Heatmaps with Observe , Observe , or Observe Available for Recordings and Heatmaps with Observe , Observe
Available for Surveys with Ask , Ask , or Ask
In this article, we’ll share an overview of what Events are and how you can use them to go even further with your user insights.
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.
What are Events?
As users interact with your site, several things can happen. Users could be clicking buttons, scrolling, or typing. Your site might also be making elements load, errors appear, or page variants to be shown, such as in an A/B test. These occurrences are examples of actions that can be used with Hotjar’s Events feature to help capture specific sessions and filter collected data to improve your insights.
To use Events inside Hotjar, the events taking place on your site will need to be sent from your site to Hotjar through our Events API. This API is available on all pages containing the Hotjar Tracking Code. Unless you intend to send events to Hotjar using Google Tag Manager, Google Analytics, or Segment, then some custom JavaScript code will need to be written on your site to start sending events. The custom code might require the involvement of a web developer, depending on your level of technical expertise.
When you’re ready to set up Events, head over to our How to Set Up Events article.
Do not pass Personal Identifying Information as an Event
Personal-identifying information (PII) should never be used as events in Hotjar. If you'd like to connect session data with specific users, you should explore the User Attributes feature instead.
How can Events be used?
Events that you’ve sent to Hotjar using the Event API become available inside Hotjar for:
- Triggering session capture, which impacts Recordings and Heatmaps.
- Triggering Surveys to appear based on an event.
- Filtering Recording and Heatmap data by sessions that contained the event.
It is not possible to trigger a Heatmap screenshot based on an event
It isn't possible to trigger a screenshot based on an event, however you can filter Heatmap session data based on an event. When filtering, Hotjar will show data collected from sessions where users triggered the event at some point during their session. This doesn't mean the Heatmap screenshot will be captured at the moment the event fired.
For A/B testing purposes, ensure the event names you're using are unique to the page being tested.
Use Cases
The following are examples of common uses and not an exhaustive list of possibilities.
Recordings and Heatmaps | ||
Event (examples only) |
Use Case |
Goal |
logged_in |
Fire this event when a user logs in. |
Start session capture only for your logged in users so Recordings and Heatmaps represent these users. |
variant_x |
When a page is being A/B tested, fire the corresponding Event based on which variant is being loaded in the browser. |
Filter Heatmaps based on each event to compare the performance of each page variant. |
started_chat |
When a web chat widget on your site is opened, fire this event. |
Filter Recording and Heatmap sessions to compare users who used chat with those who didn’t. |
saved_to_wishlist |
Fire this event when a user adds something to their list of saved items. |
Filter Recordings by users who are saving items to compare with those who don’t to discover conversion improvements or opportunities. |
error_occurred |
Fire this event each time your site generates an error on the page. |
Filter your Recordings based on this event, and watch sessions where the user encountered an error, to help find and resolve bugs or common UX issues. |
Surveys | ||
Event (examples only) |
Use Case |
Goal |
clicked_unsubscribe |
Fire this event when a user clicks a button on your site that unsubscribes them from a newsletter. |
Trigger a Survey to appear asking how the newsletter could be improved. |
scrolled_to_end |
When a user has scrolled to the end of a page, fire this event. |
Trigger a Survey to appear asking for the user to review the page and leave any suggestions on content that could be included. |