Targeting based on respondent attributes

What are respondent attributes?

Attributes are any pieces of information you know about a respondent that can be included in data export - we will send it along with answers from specific person. It means, that you target surveys basing on demographics, department or type of company they work in. You can pass custom respondent attributes from your website or application and use it to target your surveys, filter your responses for better respondent sampling and analyze.

You can also use these attributes to include or exclude your logged-in users from specific surveys.

How to collect visitor attributes?

To use attributes you need to paste an additional code right before regular Survicate tracking code. If you haven't installed the Survicate tracking code yet, check this article to see how.

Here’s an example tracking code with reserved attributes attached.

<script type="text/javascript">
  (function(opts) {
      opts.traits = {
          "email": "Respondent's email",
          "first_name": "Respondent's name",
          "last_name": "Respondent's last name"
       };
  })(window._sva = window._sva || {});
</script>

Here’s an example tracking code with reserved and custom attributes attached.

<script type="text/javascript">
  (function(opts) {
      opts.traits = {
          "email": "Respondent's email",
          "first_name": "Respondent's name",
          "last_name": "Respondent's last name",
          "my_custom_attribute": "Custom attribute value"
       };
  })(window._sva = window._sva || {});
</script>

Your developer has to modify the code with proper values in order to work correctly.

How to target respondents using custom attributes?

If you want to set up attribute-based targeting, you need to create a new segment of visitors. Go to the Settings section of your survey, open Who should see the survey? and click on Create new segment button.

You will see a menu of targeting criteria from which you need to pick How do they use your website?

Click the checkbox They have custom attribute and write attribute name and value.

For example company size and 50 will target only users with company size of 50.

How to target logged-in users

If you are collecting user_id or email attribute, you will be able to target your surveys based on the log-in status of your users, include or exclude them from certain surveys.

You can setup this setting from Create a new segment > How do they use your website? > They have known/unknown identity.

Don't forget to enable your segment after saving. If you have two or more segments enabled, we trigger the surveys to all enabled segments.


Do you find this helpful?