Learn / Guides / Intro to Hotjar Events
Choosing the right Hotjar Events to set up: your complete guide
Learn how to set up the correct Hotjar Events for your business, and start gaining valuable insights today!
By now, you probably know that Hotjar Events enhances user behavior analysis by letting you add filters to recordings and heatmaps based on user actions that matter to your business. For example, an event might fire when someone purchases an item on your site, causing Hotjar Recordings and Heatmaps to start session capture. With an event, you can also trigger surveys and collect feedback when a customer does something like subscribing to a newsletter or scrolling to the end of the page.
The specific actions that determine when events are sent to Hotjar differ from business to business. In other words, Events are unique to your organization. You can set up your own criteria using JavaScript, which powers dynamic sites.
It all sounds great in theory, but how exactly do you come up with custom events? What should you think about to ensure you track the right set of events? We get it; you don’t want to collect the wrong type of data. It can be nerve-wracking, especially if you’re starting from scratch. But don’t worry because this guide will show you the way.
Glean insights that impact your goals
Fire an event based on the most important user actions to your business. Then filter recordings and heatmaps to better understand how users behave on your app or site.
How to choose the right Events to set up
Hotjar Events allow you to tailor and target the actions you want to track on your site or app. You have the freedom to define the parameters of each event you pass to Hotjar through the Events application programming interface (API). But you need to tick a few things off a list to ensure you’re making the right calls—literally and code-wise.
💡Pro tip: if you need a refresher on how the API works, read our Help Center article.
Let’s go over the technical stuff first—this part is short, so don’t leave yet!
The right format for a call to the Events API includes the following:
hj(‘event’, ‘action_name;’)
The string value “event” as the first parameter
The custom name assigned to your event as the second parameter (“action_name” in the example, but this can be anything you choose, such as “cta_click”, “opened_modal”, “shown_variant_a”, etc.)
An event name that does not exceed 750 characters and contains only alphanumeric characters (a-z, A-Z, 0-9), underscores (_), and dashes (-)
Step 1: identifying the main goals for your site or app
The goals you focus on will depend on your business. It could be increasing conversions, reducing errors, boosting newsletter signups, or tracking an A/B test. When you define your primary goals, consider the kind of data you want to analyze across the Hotjar platform. Here are a few examples:
Filter recordings where users encountered an error to spot and resolve the issue
Filter heatmaps to compare the performance of page variants during A/B testing
Trigger a survey for users who unsubscribe to understand how you could improve your newsletter
Step 2: determining the events that support these goals
Once you’ve set your goals, you can look into what’s happening—or not happening—on your site or app. You can create an event based on these user actions, e.g., clicking on a call-to-action (CTA) button, encountering a broken link, or loading a page variant.
Step 3: tying the two together
Before continuing to Event API implementation, you should bring together your goals and the events that support these goals. Here’s an example: “Pass an event to Hotjar when an error is triggered (the event) so that I can filter my Hotjar Recordings by that error event to find and resolve bugs or common UX issues (the goal).”
Once you’ve done all three steps, you can start sending events via Google Tag Manager or Segment integration.
💡Pro tip: you can find the detailed instructions for either platform in this Help Center section on Events: what it is, how to set it up, and more.
Some use cases for Hotjar Events across industries
While goals for creating events usually revolve around UX, sales, conversion, and revenue, the data gathered can impact nearly every area of operation. You can track purchased items to identify opportunities for conversion. But you can also collate insights into customer demand to forecast future demand and work with your suppliers to meet it.
All sorts of businesses can find success in setting up events—industries like software as a service (SaaS), ecommerce, and digital marketing immediately come to mind. But even long-established ones, such as transport, manufacturing, and fast-moving consumer goods, can find value in Hotjar Events.
Below are some example use cases for events, which you can apply to any of these industries:
Items sold
hj('event', 'item_purchased')
Fire this event each time a user buys an item on your website. It will trigger a recording on Hotjar, which you can use later to analyze the behavior of individuals who converted.
This action particularly helps retailers and manufacturers delve into people’s purchase decisions. Traditionally, this type of data informs sellers of fast-moving consumer goods about their top-selling items, allowing them to handle the demand and meet specific needs.
Online merchants can do the same but with the added perk of viewing session recordings. In turn, they can glean insights into why users convert and compare their behavior with non-converting ones.
Error events
hj('event', 'error_occured')
Whether you just launched your website or are conducting a conversion rate optimization (CRO) audit, this event lets you put yourself in other people’s shoes. Specifically, it enables you to see where users encounter an issue while interacting with your site or product.
This brings about a number of benefits. For one, you can spot a bug and find a fix before it becomes something major. You can also analyze this data via Hotjar Recordings to uncover where and why users are dropping out, and if the problem is isolated or part of a bigger pattern.
This way, your team can also measure the success of a product or site launch.
Email subscriptions
hj('event', 'subscribed_to_email_list')
From ecommerce brands to SaaS companies, many businesses can benefit from building an email list. Consider the enduring power of email (it's not dead, after all), proven by its 21.5% open rate and 2.3% click-through rate averages.
Then, think about the journey of a user who has signed up to receive your updates straight to their inbox. They went to your website, filled out a form, and confirmed their email address—they’re already invested in what you offer.
All that effort goes into generating an audience that is likely to convert. So there are two goals this event can support: increasing your subscriptions and growing your conversions.
Call-to-action clicks
hj('event', 'clicked_homepage_cta')
Your homepage is like a store’s facade, the area in which you display featured products and invite people to come in, while a CTA prompts your visitors or leads to take action. So it makes sense that your homepage CTA compels users to perform a significant action, such as purchasing a product, joining your email list, or enrolling in a service.
To measure how effective your homepage CTA is, you can start tracking it by creating an event tied to users clicking on it. Trigger Hotjar Heatmaps or Recordings to capture this action as it happens so that you can assess the behavior of those who clicked and those who didn’t.
User logins
hj('event', 'logged_in')
Do you have a login option on your product or site? Set up an event that allows you to track individual user logins. This action may sound simple, but it offers an overview of things happening, including (but not limited to):
Seeing how many times a particular user logs in
Identifying security loopholes and enhancing protection
Monitoring other user actions after a login
Further, you can zone in on logins to understand and meet users’ needs. For example, you observe someone has logged in multiple times in the past week. You can search for the relevant recording and investigate what’s going on.🕵️♀️
A/B testing
hj('event', 'variant_x')
Marketing teams often perform A/B testing. This process is an experiment that shows two or more variants of a page. By comparing the performance of each variant, you gather data from the results that helps you:
Improve the user experience (UX)
Enhance revenue from existing customers
Increase sales for a product or products
These are just a few ways A/B or split tests benefit businesses.
To start collecting data based on split-testing factors, set up an event that fires when the browser or app is loading a specific variant. This will send a signal to Hotjar Heatmaps, which will start capturing sessions accordingly.
Live chats or chatbots
hj('event', 'started_chat')
If you, like many other companies, have added a live chat or chatbot on your site or app, you might want to track what users feel or think about the feature. Events has got you covered here too:
Tailor an event that activates when someone starts a chat
Then, compare their collective behavior with those who don’t
Why is a simple detail so important? Whatever your industry is, you probably already know that customer service holds the key to keeping people happy. In fact, approximately 90% of customers say it’s a big deal for them to get a quick response to their customer service questions. (It’s worth a mention that they also define “quick” as 10 minutes or less.)
Wishlist saves
hj('event', 'saved_to_wishlist')
Wishlists are personalized collections of products that people save on a site for future reference. They have no intention of buying the items immediately, but they may only need a nudge to convert.
Ecommerce brands can fire this event when customers add to their list of saved items. You can then filter recordings by this segment of users who are saving items to compare with those who don’t. This way, you can discover conversion improvements or opportunities. If you run email marketing and pay-per-click campaigns, you can also check wishlist data when devising strategies.
Email unsubscribes
hj('event', 'clicked_unsubscribe')
This is the opposite of email subscriptions but still worth keeping an eye on. When a user clicks a button on your site to unsubscribe from a newsletter, trigger an event to pass to Hotjar. This will cause Hotjar Surveys to display a few questions about the reason for unsubscribing, suggestions for improving the newsletter, etc. In turn, unsubscribed users’ responses will allow you to figure out a solution to retain existing subscribers.
End-of-scroll events
hj('event', 'scrolled_to_end')
Fire this event when a user has scrolled to the end of a page. This will then trigger a Hotjar Feedback widget to appear. The widget could encourage the user to review the page and leave any suggestions, such as the type of content they want to see.
If you employ content marketing across all stages of the customer journey, you can make the most out of this Event + Feedback combination. Users spend more time looking above the page fold than below it—even if they’re scrolling more vertically now than ever before. This means those who reach the bottom of the page are thoroughly engaged (verifiable through user behavior data). And you can ask them about what will keep them interested and give them more of what they want.
Customized targeting for every brand or business
Refine your user behavior analysis and deepen your understanding by sending events-based data to Hotjar. These events reflect user actions that are genuinely important to your product or site—and your user experience.
You can create up to 1,000 unique events per Hotjar site, with an unlimited number of users associated with those events.
Start tailoring what you want to track on your site. And then filter your recordings and heatmaps or trigger surveys and feedback using the data passed to Hotjar when an event fires.
This way, you can discover opportunities to increase conversion, spot an issue and fix it, or improve the user experience. It all depends on what you’re trying to achieve. So, why don’t you start setting goals and choosing the events that support them?
Understand how people experience your product
Then improve your UX, conversion, revenue, and more by collecting the right data through Events.