TemperStack
Intermediate8 min readUpdated Mar 18, 2026

How to set up user attributes on Hotjar

Quick Answer

User attributes in Hotjar allow you to segment recordings and heatmaps based on custom user data. Set them up by implementing the hj('identify') function in your website code with relevant user properties.

Prerequisites

  1. Active Hotjar account with Business plan or higher
  2. Hotjar tracking code installed on your website
  3. Basic JavaScript knowledge
  4. Access to your website's code or tag manager
1

Access your Hotjar dashboard

Log into your Hotjar account and navigate to your site dashboard. Click on Settings in the left sidebar, then select User Attributes from the menu. This section shows all currently configured attributes for your site.
Tip
User attributes are only available on Business plans and above.
2

Define your user attributes schema

Click Add User Attribute to create new attributes. Enter a Name (e.g., 'subscription_type') and select the Data Type (string, number, or boolean). Add a Description to help team members understand the attribute's purpose.

Common attributes include:
  • User ID or email
  • Subscription plan
  • User role
  • Geographic location
Tip
Keep attribute names lowercase with underscores for consistency and easier implementation.
3

Implement the identification code

Add the Hotjar identification script to your website. Place this code after user login or on pages where user data is available:

hj('identify', 'USER_ID', {
  subscription_type: 'premium',
  user_role: 'admin',
  signup_date: '2026-01-15'
});

Replace USER_ID with the actual user identifier and update the attributes with real user data.
Tip
Call hj('identify') on every page load to ensure consistent user tracking across sessions.
4

Set up dynamic attribute tracking

For dynamic user data, implement conditional logic to capture different user states:

if (user.isPremium) {
  hj('identify', user.id, {
    plan: 'premium',
    features_enabled: user.features.length
  });
} else {
  hj('identify', user.id, {
    plan: 'free',
    trial_days_left: user.trialDaysLeft
  });
}
Tip
Use your existing user management system to populate attribute values automatically.
5

Test user attribute implementation

Open your website in a new browser window and perform actions that should trigger the hj('identify') function. Open browser developer tools (F12) and check the Console tab for any JavaScript errors. You can also verify the implementation by checking the Network tab for Hotjar API calls.
Tip
Test with different user types to ensure all attribute variations are captured correctly.
6

Verify data collection in Hotjar

Return to your Hotjar dashboard and navigate to Recordings. Wait 10-15 minutes for data to process, then click on any recent recording. In the recording details panel, you should see your custom user attributes listed under User Information. Verify that the values match your implementation.
Tip
It may take up to 30 minutes for user attributes to appear in your Hotjar dashboard.
7

Create user attribute filters

Go to Recordings or Heatmaps and click Add Filter. Select User Attributes from the dropdown menu. Choose your custom attribute and set the filter criteria (equals, contains, greater than, etc.). Apply the filter to view segmented data based on your user attributes.
Tip
Save frequently used filter combinations as custom segments for quick access.

Troubleshooting

User attributes not appearing in dashboard
Check that you're calling hj('identify') after the Hotjar tracking script loads. Verify your plan includes user attributes feature and wait up to 30 minutes for data processing.
JavaScript errors when implementing hj('identify')
Ensure the Hotjar tracking code is properly installed and loaded before calling identification functions. Wrap your hj('identify') calls in a try-catch block to handle any errors gracefully.
Inconsistent user attribute data
Make sure hj('identify') is called on every page load with consistent user data. Check that your user data source is reliable and attributes are being set with the correct data types.
Filters not working with user attributes
Verify that attribute names in your code exactly match those defined in Hotjar settings. Ensure sufficient data has been collected - filters require multiple sessions with the specified attributes to function properly.

Related Guides

More Hotjar Tutorials

Other Tool Tutorials

Ready to get started with Hotjar?

Put this tutorial into practice. Visit Hotjar and follow the steps above.

Visit Hotjar