With the User Attributes feature, you can send attributes about your users to Hotjar and use those attributes to target on-site Surveys and Feedback widgets based on predefined conditions. For example, you could tell Hotjar exactly when somebody signed up for your service, what industry they work in, or what their total customer lifetime value is.
This allows you to target a specific set of users to your site, such as “target this Survey to paying customers only”, offering more relevant answers to the questions you have about your users.
If you haven't yet set up User Attributes for a site now, check out our 4 step guide to setting up User Attributes.
Can I see User Attributes in my Survey or Feedback responses?
User Attributes will only be visible in the download file for Survey responses. We hope to expand this to Feedback, and make the attributes visible within Hotjar in the future. However, currently, this is functionality is not available.
Targeting On-site Surveys and Feedback widgets with User Attributes
Create a new Survey or Feedback widget.
If you're not sure how the following guides can help:
In the Targeting section, select Specific users
Click Add attribute
Once you have selected one attribute and condition, you can add more by clicking Add attribute again. Hotjar will only display the widget if the user matches all the attributes listed. ('AND' logic is used here, not 'OR')
Remember when adding multiple attributes to the targeting rules
If you're combining any triggers with user attribute targeting, then the trigger code will need to be added after your identify API code has executed. This is because the trigger will rely on information the identify API has already sent to Hotjar.
Select the attribute you want to target.
Select the attribute condition you want to trigger the widget on.
This allows you to be more specific about what user attributes the widget can trigger on. For example, you could select "all users who became a customer less than 7 days ago".
User Attributes needs to be set up in order to see a list of available attributes
Consult with your web developer and head to our 4 step guide to setting up User Attributes for more information.
Once you have selected the correct condition, click Apply. After you've finished creating/editing the Survey or Feedback widget, it will only appear for users who match the conditions set with your User Attributes filters.
Important things to remember:
In order for a user to be targeted, the attribute(s) must be sent to Hotjar each time the Session state changes. This means that you should be sending User Attributes to Hotjar every time a new page loads, or the state changes in a Single Page Application. Hotjar reevaluates User Attributes after each state change, so without a new Identify API call for each page load or state change, the Survey/Feedback widget may not match correctly.
In order for UAs to be stored with feedback responses, Session capture must be enabled AND the user’s session must have been tracked by Recordings. If the user's session was not recorded, it might have been missed due to Sampling.
Targeting via UAs does not require Session capture to be enabled, so it is possible to show users a survey/IF based on UAs without having Session capture enabled. However, those user attributes won’t be stored unless a recording was captured for the session.