Personalize Survey Links
Introduction
Each Survey Page has a unique web address (URL) that you can share with your audience. Once your survey is published, you can share the provided URL without any modification.
You can choose to add optional URL parameters to your survey link to personalize them and automatically provide contextual data.
On this page we’ll go through all options to personalize survey links with URL parameters.
Overview of URL parameters
The below table gives a quick overview over the most common URL parameters. Each parameter is described in more detail further below. All parameters are optional.
Parameter | Description |
contact_id | A unique identifier for each survey respondent. Providing an Id will identify survey respondents in your Refiner dashboard. |
contact_email | The email address of the respondent. The email address can act as an alternative to the contact_id. |
contact_<something> | Any kind of user trait you want to provide (see below) |
locale | The language string of the user when using in the translation feature. |
response_<something> | Any kind of contextual data that you want to attach to the survey response (see below) |
signature | The computed signature when using the Identity Verification feature. |
tags | Automatically add tags to a survey response. |
Example use cases
Identify users
You can choose to identify respondents with URL parameters, which is also the recommended way to operate Survey Pages.
Identifying respondents can easily be done by providing either a “contact_id” and / or a “contact_email” parameter in your URL.
Here is an example of an survey link using “contact_id” as the identifier:
https://survey.refiner.io/0mnp5e-dz54qj?contact_id=ABC123
And here is an example of a survey link using the email as the identifier:
https://survey.refiner.io/0mnp5e-dz54qj?contact_email=test@test.com
Import user traits
In addition to the ID and email address of your user, you can provide any kind of user data within the URL.
Providing additional user data fields is easy. All you need to do is to add parameters starting with “contact_” to the URL of your survey page.
The following URL includes a user ID, an email address and additional user data.
https://survey.refiner.io/0mnp5e-dz54qj?contact_email=test@test.com&contact_is_customer=true&contact_is_cool=yes
Providing additional user traits is a powerful method to better analyze your survey data.
All data points provided while identifying your users can be used to segment and filter your survey results in your Refiner dashboard later on.
Prefill first question
Next to identifying your users, you can also use URL parameters to add data to a survey response.
URL parameters starting with “response_” will either preselect survey responses or add hidden fields data to the survey response.
Below you can see an example link that identifies your user by their email address (see above) and sets the response of a NPS survey to the value 9 / 10 by providing a ‘response_nps’ parameter.
https://survey.refiner.io/0mnp5e-dz54qj?contact_email=test@test.com&response_nps=9
In this example, the value for the question “nps” is set by a parameter that starts with “response_” followed by the identifier of the question. The resulting URL parameter is “response_nps”.
To find the identifier of a any question in your survey, click on “Show Advanced Options” in the survey editor and locate the field “Internal Identifier”.
URL parameters can also be used to private “hidden” data which is not represented as a question in your survey.
You can add any “hidden field” to your survey by simply providing an arbitrary “response_<something>=<value>” parameter in your URL. Data provided through URL parameters gets automatically attached to responses provided by the user.
https://survey.refiner.io/0mnp5e-dz54qj?contact_email=test@test.com&response_how_satisfied=3&response_a_hidden_field=yes
There is no need to create a question with a matching identifier in your Refiner dashboard. Refiner will try to match the hidden field data to a known attribute in your Refiner account. If no attribute with the same key can be found, a new attribute gets created the first time we see the data key.
Set survey language
When you use our Translations feature, Refiner automatically sets the survey language based on the “preferred language” web browser settings of the user.
You can also explicitly set the language by adding a locale parameter to the URL.
https://survey.refiner.io/0mnp5e-dz54qj?locale=fr
Besides providing user traits and hidden response data, you can also add tags to survey response with the “tags” parameter.
You can add up to ten tags to a survey response by separating each of them with a comma as shown in the example below.
https://survey.refiner.io/0mnp5e-dz54qj?tags=Tag1,Tag2,Tag3
Advanced options
Magic Variables
Magic Variables allow you to add contextual data to survey responses or user profiles. You can use Magic Variables to store things like the URL, information about a user’s web browser, or their IP address alongside survey responses.
Magic Variables can be used when identifying a user or attaching data to survey responses as shown in the code sample below.
Here is the list of all Magic Variables supported by the Refiner Web-Client:
Variable | Description |
__COUNTRY_CODE__ | The country code of the user as described here |
__CURRENT_URL__ | The current URL of the user |
__IP_ADDRESS__ | The current IP address of the user |
__LOCALE__ | The locale value as described here |
__WEB_BROWSER__ | The web browser name of the user (e.g. Chrome 27) |
__WEB_DEVICE_OS__ | The operating system of the user (e.g. Mac OS) |
__WEB_DEVICE_TYPE__ | The device type of the user (e.g. desktop, tablet, mobile) |
Data type casting
When you provide numeric values as URL parameters (e.g. “1234”), we’ll automatically cast them to number format and they will show up as a Integer Number Trait in your Refiner environment. This default behaviour is true for any URL parameters, except “contact_id” and “account_id” which are always casted as strings.
If you want to instruct Refiner to cast a numeric value as text, you can prefix your value with “string:”. An example would look like this:
https://survey.refiner.io/0mnp5e-dz54qj?contact_email=test@test.com&contact_a_numeric_string_value=string:1234
In this example, a trait with the identifier “a_numeric_string_value” will be added to the user profile with the text value “1234”.