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.
- Configuring User Attributes for survey targeting
- Targeting surveys with User Attributes
- Filtering survey responses by User Attributes
- User Attribute FAQs
Before you begin
- To enable survey targeting based on User Attributes, you need to manually send the required attributes to Contentsquare in advance by first submitting a survey. See the section below on Configuring User Attributes for survey targeting.
- User Attributes will only be captured alongside responses for on-site Surveys (Popover, Button, Embedded, or Full Screen)
- Attributes can only be viewed alongside responses when you download and view the 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.
Configuring User Attributes for survey targeting
Follow these steps to send User Attributes to Contentsquare, which will make the User Attributes available for survey targeting.
1. Click the Integrations icon (a puzzle piece), then select 'User Attributes' on the sidebar.
2. Select the relevant site, then click 'Enable User Attributes'.
3. Set up a survey with targeting set to a test URL.
You'll use this survey for sending User Attributes to Contentsquare. A test URL is targeted so that the survey only appears on that URL and you avoid impacting regular users. An example test URL is https://www.mysite.com/?VOCTest.
4. Visit your test URL, then open your web browser console.
If you're not familiar with your browser developer tools, or the console, check this guide to learn how to open your browser console.
5. Prepare to send your User Attributes by modifying the code example below with your specific attributes.
hj('identify', null, { 'attribute_1': 'data1', 'attribute_2': 'data2', });
6. Still on your test URL, enter the modified code in your web browser console, then press Enter/Return.
Ignore messages appearing in the console such as "No recording in progress. Not sending."
7. Submit a survey response for the survey on your test URL.
The User Attributes will be processed and available within approximately one hour.
8. In Contentsquare, visit your User Attributes page again by clicking the Integrations icon (a puzzle piece), then selecting 'User Attributes' on the sidebar.
9. Check the User Attributes that you sent are now listed.
These attributes can now be used for targeting your surveys.
10. You can deactivate or delete the test survey that was created.
Targeting surveys with User Attributes
1. Ensure you've first configured User Attributes for survey targeting.
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',
8. You can combine multiple conditions with AND or OR logic to create precise targeting rules.
9. Finish your survey setup and make sure that 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.
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.
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.