Plan availability
For Observe tools (Heatmaps and Recordings): Observe
For Surveys: Ask , Ask For Observe tools (Heatmaps and Recordings): Observe , Observe
For Surveys: Ask , Ask
This article shows you the steps you’ll need to take to implement User Attributes for your Hotjar site. If you’re looking for an overview of User Attributes and how to use them, see our article What are User Attributes? For help with disabling User Attributes, see the steps in How can I disable User Attributes?
- Step 1 - Decide on the User Attributes most relevant to your business.
- Step 2 - Review your privacy requirements.
- Step 3 - With the help of a web developer, implement the Identify API code.
- Step 4 - After implementing the Identify API code, start using User Attributes.
Decide on the User Attributes most relevant to your business.
Start by assessing what data from your site's database you want to send to Hotjar as User Attributes. Then give your web developer a list of the data you'd like to send (users you'd like to target), so they can check if the data values are available from your site.
Here are some common uses for User Attributes to get you started thinking about what data is relevant to you:
- Filtering Recordings by paying customers.
- Displaying a Survey to users who created an account in the past 30 days.
- Showing a Feedback button to users with a total spend of at least $500 worth of products on your site.
- Asking logged-in users to fill out a Survey.
You'll find more use cases in our article on What are User Attributes?
A limit of 100 unique attributes is allowed for each Hotjar Site.
You can send up to 100 user attributes on any site, with any number of users associated with those attributes. For this reason, it's not recommended to use User Attributes for product SKUs or other unique items that might cause you to exceed the 100 attribute limit.
Review your privacy requirements.
Hotjar is designed to help you de-identify data as much as possible by default. User Attributes are slightly different since they can include Personally-Identifying Information (PII). With User Attributes, we want to empower your ability to manage personal information sent to Hotjar while complying with privacy legislation.
You can read more about Hotjar's stance on privacy on our privacy page. We recommend reviewing your data privacy requirements before implementing User Attributes.
Since PII must be deleted if a user requests it, you are required to send a User ID as part of your User Attribute if you wish to send any PII to Hotjar. See our Understanding the User Lookup Tool article for more information about deleting PII based on user requests.
With the help of a web developer, implement the Identify API code.
The User Attributes feature is available and pre-enabled on sites with one of the following plans: Observe Business, Observe Scale, Ask Business, Ask Scale. However, your web developer will need to write additional code to send data from your site that will become User Attributes inside Hotjar.
To help your web developer with this, we provide details about the Identify API in our Identify API Reference Guide. A snippet of code is also available below that can be used as a template to help get started. You'll find this same code template snippet on your User Attributes page in-app before setting up User Attributes. On its own, the code template below is not enough to send data from your site to Hotjar. Your web developer will need to write additional code.
<script>
// Install this entire snippet AFTER the Hotjar tracking code.
var userId = your_user_id || null; // Replace your_user_id with your own if available.
window.hj('identify', userId, {// Add your own custom attributes here. Some EXAMPLES:
// 'Signed up': '2019—06-20Z', // Signup date in ISO-8601 format.
// 'Last purchase category': 'Electronics', // Send strings with quotes around them.
// 'Total purchases': 15, // Send numbers without quotes.
// 'Last purchase date': '2019-06-20Z', // Send dates in ISO-8601 format.
// 'Last refund date': null, // Send null when no value exists for a user.
});
</script>
You can send User Attributes using Google Tag Manager or Segment
It's possible to start sending User Attributes to Hotjar using Google Tag Manager or Segment. For more details, see our How to Send User Attributes with Google Tag Manager article, or if you're using Segment visit our Using Hotjar with Segment guide.
After implementing the Identify API code, start using User Attributes.
After your developer has implemented the code necessary to send data to Hotjar, you'll begin seeing User Attributes appear on the User Attributes page in-app.
Session Capture needs to be enabled for User Attributes to work with Observe tools.
User Attributes require a Session to be sent for Heatmaps and Recordings. You can read about enabling Session Capture in our article Configuring Site Settings. Enabling Session Capture is not required for targeting Survey.
From here, you can currently do the following with User Attributes:
- Filter Recordings by User Attributes.
- Filter Heatmaps by User Attributes.
- Create a Recording Segment.
- Target Surveys by User Attributes.
- Lookup and delete user data by user ID.
- When you export Survey data as CSVs/XLSX files, User Attributes will appear in the data.
When testing Survey exports, User Attributes may not be added immediately.
The User Attributes service is separate from the Survey feature. When you're testing if your User Attributes have been correctly added to Survey results, you may want to wait up to 30 minutes for attributes to be associated with the Survey results.