Help Center

Use querystring parameters to prefill survey questions

No comments

The more you know about your respondents in advance, the less they will need to fill in. Even when you’re sending out a survey without using contacts, you can add information to identify respondents. Here’s how: use hidden questions that are automatically prefilled by the survey URL. Your respondents won’t see the questions, but they will be prefilled based on values sent as querystring parameters in the URL.

For example, you could distribute your survey via different channels (website, newsletter, Facebook …). Using a hidden question you can determine which channel generated the most respondents. Or add a tracking code, like a user id to identify the respondent later. You can prefill any question as long it is one of the 3 question types below. The information from the querystring parameters will be added in real time to your reports and you can filter on it.

How to add parameters to your survey URL

  1. Add a new question to your survey. This needs to be a radio buttons question, checkbox question or text box question.
  2. In the Settings, select Yes for the option Hide questionhide question

Tip!  Show the question as long as you have not launched your survey. While testing you will immediately see that the question is filled out correctly. Don’t forget to hide the question before launching your survey, though!

  1. Click on Save.
  2. Click on Distribute.
  3. Depending on the distribution options you have chosen, a different URL will be generated. Click on the link to the URL for your survey.
  4. Click on Copy to clipboard.
  5. Paste it in a text editor such as Word or Notepad.
  6. Add the following parameter to the URL: &qx=y. The x stands for the question number and y for the prefilled answer.
    The URL of your survey should look like this: [survey-url]&qx=y.
  7. To add more parameters you can repeat step 8.
    With 2 parameters the URL of your survey should look like this: [survey-url]&q1=1&q2=text.

Which parameter do I use?

The querystring parameter(s) will look different depending on whether you are using text box questions, radio buttons questions or checkbox questions. Here are 3 examples:

  • Textbox questions use a word as parameter. For example, if you want to know from which channel your respondents clicked on the survey URL, you can place different links on each channel. Using a text box question you can add the name of the channel (eg. Website) to the URL. For this question (Q1), the parameter will look like this: &q1=Website.
    textbox querystring parameter

Attention! If your response consists of more than one word or special characters, url-encode it. Spaces are replaced by “%20” for example: “q1=company%20site”

  • For radio buttons questions the querystring parameter is a number that corresponds with an answer choice. The answer choices are numbered beginning at the top with 1. To select the first option “Newsletter”, use the parameter &q2=1. For “LinkedIn” the parameter should look like this: &q2=4. Place a different survey URL on each channel to track them correctly.
    radio buttons querystring parameter
  • Checkbox questions use different numbers that correspond with different answer choices. For the first choice use 1, use 2 for the second, etc. Multiple answer choices have to be separated by commas. Let’s say you want to prefill the first and third answer choices in this question (Q3), use parameter &q3=1,3. Make sure you create and distribute different URLs for every combination.
    checkbox querystring parameter

Skipping first page

Add &as=1 to the url to skip the first page.

Attention: Make sure that you don’t show the introduction page on a seperate page when you want to skip the first page.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.