Custom variables allow you to save additional participant information by passing it into the test via the test recruitment link. The custom variables you include will be saved on the participant’s response, are visible on the test results page, and included in the CSV export of responses.

Custom variables are available when recruiting participants from your own audience on the Pro plan.

In this article

Common uses for custom variables

  • To track each participant individually by including a unique variable such as an email address, user ID, or other identifier in the recruitment links.

  • To enrich responses with contextual (non-identifying) information such as a participant’s segment, persona, or department.

  • To monitor the success of different recruitment efforts (eg. Facebook, LinkedIn, email newsletter), by including a“source” variable in the recruitment links distributed in each channel.

How to use custom variables

There’s no special set-up required on your test to use custom variables. All you need to do is:

  1. Enable the recruitment link for your test. See how to recruit your own participants for instructions.

  2. Create variants of the link by adding your custom variables to the end of it

  3. Share these links in the right places or with the right people

Adding custom variables to your recruitment link

Your recruitment link will look something like this:
https://usabi.li/do/yourtest

Custom variables are added to the end of this URL as a query string. If you already know what a query string is, you’re all set. Otherwise, keep reading—it’s easy.

  1. Start by copying and pasting this link into a text editor such as Notepad

  2. Add a question mark (?) to the end of the URL

  3. For each variable you would like to save on the response, add the name of the variable, then an equals sign (=) and then the value. For example name=Tom or userId=456.

  4. If you’re using more than one custom variable, put an ampersand character (&) between them.

Examples

Using a single custom variable

Note the question mark (?) before the variables.

Link template:
https://usabi.li/do/yourtest?name=[name_value]

Example link:
https://usabi.li/do/yourtest?name=Tom

Using multiple custom variables

Note the ampersand (&) between each variable.

Link template:
https://usabi.li/do/yourtest?name=[name]&userId=[userId]&plan=[plan]

Example link:
https://usabi.li/do/yourtest?name=Tom&userId=456&plan=Starter

Sharing your links

Once you’ve created link variants you will need to ensure that you share them correctly.

When using personalised links, share each link with the correct person.

Share this link with Tom:
https://usabi.li/do/yourtest?name=Tom

Share this link with Sally:
https://usabi.li/do/yourtest?name=Sally

Or share each link in the right place.

Share this link on Facebook:
https://usabi.li/do/yourtest/123?source=Facebook

Share this link on LinkedIn:
https://usabi.li/do/yourtest/123?source=LinkedIn

Generating large numbers of links with custom variables

The examples above have described how to create links manually. When recruiting at a larger scale you may want to generate different links for each person automatically using your CRM, email marketing tool, or a script. These tools will allow you to specify where particular attributes (eg. email address) should be added into the test URL, and will substitute the appropriate values in for each user.

Viewing custom variables

Once you have collected responses your test results page displays all of the custom variables that were passed in. Open a participant’s full response and expand the section Participant information to view the custom variable information that was passed in for that participant.

All custom variables are also included as columns in the CSV export of test results.

Did this answer your question?