With the User Attributes feature, you can send attributes about your users and then filter Survey responses based on these attributes. You can also use those attributes to target on-site Surveys based on predefined conditions. For example, you could send us attributes such as 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 visiting your site, such as “target this survey to paying customers only”, offering more relevant answers to the questions you have about your users.
- Sending User Attributes with survey responses
- Filtering survey responses by User Attributes
- Targeting surveys with User Attributes
- User Attribute FAQs
Sending User Attributes with survey responses
When exporting your survey responses, it can be useful to see the User Attributes for users who submitted a response. User Attributes will only be captured alongside responses for on-site Surveys (Popover, Button, Embedded, or Full Screen) and can only be viewed in the downloaded CSV or XLSX survey responses file. Link Surveys will not include User Attributes with responses, as this type of Survey is hosted on a different domain to your site, meaning the code used to send User Attributes won’t be present on the Link Survey page.
Filtering survey responses by User Attributes
After setting up User Attributes, your survey responses will be associated with any attributes that apply. These attributes can then be used to filter your responses list and show only responses that have an attribute matching your filtering condition.
You can apply a filter by clicking 'Add filter', selecting the relevant attribute and the condition depending on the attribute value type. For more details on attribute value types, see our Identify API Reference.
Targeting surveys with User Attributes
1. Ensure you've set up User Attributes and that User Attributes is enabled on your User Attributes page.
2. Create a new survey.
3. In the 'Targeting' section, select 'Specific users'.
4. Click 'Add attribute'.
Once you have selected one attribute and condition, you can add more by clicking 'Add attribute' again. The widget will only be displayed if the user matches all the attributes listed. ('AND' logic is used here, not 'OR')
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.
5. Select the attribute you want to target.
6. 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".
7. Once you have selected the correct condition, click 'Apply', then click 'Save' and ensure the status of your survey is 'Active'.
After you've finished creating/editing your survey, it will only appear for users who match the attribute targeting conditions.
User Attribute FAQs
Can I see User Attributes in my survey results and responses?
After setting up User Attributes, these attributes are currently only visible in the downloaded CSV or XLSX file for your survey responses.
How can I send a new User Attribute to later be used for survey targeting?
User Attributes that have already been sent to us can be used to target a survey. You can check what User Attributes are already available on your User Attributes page. To target based on a new User Attribute, you can execute an Identify API call with the attribute while sending a survey response.