• Customer Experience
    Customer Experience
  • Employee Experience
    Employee Experience
  • Brand Experience
    Brand Experience
  • Product Experience
    Product Experience
  • Core XM
    Core XM

Passing Information via Query Strings

What's on This Page:

Was this helpful?

The feedback you submit here is used only to help improve this page.

That’s great! Thank you for your feedback!

Thank you for your feedback!

About Query Strings

A query string allows you to pass information to and from a website by simply adding, or “appending,” that information to the end of a URL. This information is stored in the query string and is captured by the website when it reads the URL.

Data can be passed into a survey using a query string. Once passed, the data can be saved as Embedded Data with the survey response. At the end of a survey, query strings can be used to pass data to another website or survey.

Query String Structure

Query strings follow a very specific syntax. They are added to the end of a URL in the general format of ?FieldName=FieldValue. The FieldName is the name of your data field while FieldValue is the specific data value of your field. Let’s take a look at an example URL with a query string appended to it. The query string is in bold.


When a respondent takes the survey with the above link, the data field “Source” with a value of “Facebook” will be saved with the response.

Multiple Query Strings in One URL

Query strings allow you to pass multiple pieces of data all within one single URL. However, when your URL contains multiple query strings, the syntax is a bit different. Let’s take a look at a URL with multiple query strings appended to it. The query strings are in bold.


The second query string begins with an ampersand (&) instead of a question mark (?). This is because URLs can only support one question mark. Additional query strings can be appended by adding more fields in the format of &FieldName=FieldValue.

Attention: While there is no Qualtrics limit to the amount of data you can pass via query strings, web browsers do have URL character length limits. These limits vary by browser. We recommend trying to keep your URLs below 2,000 characters. For information about a specific browser’s limits, consult the browser’s help documentation.

Passing Information into a Survey

You can use query strings to pass information into a Qualtrics survey. You can save this information as Embedded Data and then use this field in Branch and Display Logic along with saving the data with the survey taker’s response.

Example: You can use a query string to track from what source a participant is accessing a survey. Let’s say you’re running a survey on multiple social media sites. If you want to track which participants are coming from Facebook and which are coming from LinkedIn, you could create two customized links (query strings in bold).


These query strings will save two different values for the field “Source”. These values are “Facebook” and “LinkedIn”. You can then use this data in your reporting, pipe it into questions to display for your respondents, and base Branch and Display Logic on it to show or hide relevant questions.

Passing information into a survey via query strings requires a two-part setup. The first part consists of appending data to your URL with query strings, and the second part consists of creating Embedded Data elements in your Survey Flow to capture the information from the URL.

Part 1: Appending Data to a Survey URL

  1. Copy the anonymous link for your survey and paste it into a text editor, such as Word or Notepad.
  2. Add a question mark (?)to the end of the URL.
  3. Type the name of the Embedded Data field (e.g., “state” or “city”) after the question mark.
  4. Add an equal sign (=)
  5. Type the value of the field (e.g. “Utah” or “Provo”)
  6. For any additional fields you’d like to add, repeat steps 2 through five using an ampersand (&) instead of a question mark (?).

Part 2: Capturing Information from a URL as Embedded Data

  1. Go to the Survey tab of your project and open the Survey Flow.
    the survey tab. Click Survey Flow
  2. Click Add a New Element Here.
    The survey flow. click Add a new element here
  3. Select the Embedded Data element.
    a new survey flow element. select embedded data
  4. Enter the name of any fields you’d like to capture from the URL. Do not assign a value for these fields. For these fields, it should read Value will be set from Panel or URL.
    an embedded data element with 2 fields corresponding to our query string

    Qtip:The capitalization of your fields matters! Make sure your fields in your Survey Flow match the capitalization of the fields in your URL.
  5. Move the Embedded Data element to the top of your Survey Flow. This is especially important if you want to use the Embedded Data fields in logic or want to display the values with Piped Text. The Embedded Data element must appear before the elements in the Survey Flow that reference it.
    the embedded data element has been moved to the top of the survey flow

    Example: In the Introduction question block, we want to pipe in the value for “city” into some question text. Therefore, we need to move the Embedded Data element to before the Introduction question block in the Survey Flow.

Passing Information from a Survey

You can pass information from a survey to another website or from one survey to another survey by appending information to the Redirect URL. This is commonly done when working with a third party panel provider.

Attention: The redirect destination needs to be configured to accept the information passed in the URL. Otherwise, the passed information won’t be captured. See Passing Information into a Survey above to learn about configuring a survey to accept information passed in the URL.

To Pass Information from a Survey

  1. Generate the Piped Text code for each piece of data you would like to pass  (e.g., answers to survey questions, Embedded Data, or any other information collected with the response). Copy these codes and save them for later.
    Example: We want to pass along the respondent’s answer to two of our survey questions. The Piped Text for our selected survey questions are ${q://QID7/ChoiceGroup/SelectedChoices} and ${q://QID3/ChoiceGroup/SelectedChoices}.
  2. Copy the redirect URL. This is the URL you want to send survey respondents to and will be the website that captures the information.
    Example: We’re redirecting from one Qualtrics survey to a third party panel provider, so our URL is https://www.survey.panelcompany.com
  3. Add a question mark (?) to the end of the URL.
  4. Type the name of the variable you’d like to pass.
  5. Add an equal sign (=) to the end of the URL
  6. Paste the Piped Text code for the value for the variable.
  7. Repeat steps 3 through 6 for any additional variables you’d like to pass. Use an ampersand (&) instead of a question mark (?) for additional variables.
  8. Paste your completed URL from step 7 in the appropriate survey termination area (e.g., Survey Options or End of Survey element).
    Qtip: Do you have a query string that does not seem to be working? It might have to do with how your Piped Text is formatted. Best practice is to add ‘?format=urlencode’ to the end of piped text values, before the last bracket. This ensures values with spaces and special characters carry over properly into the query string. For example, pull Embedded Data called Department into your query string by using ${e://Field/Department?format=urlencode} instead of ${e://Field/Department}. However, don’t add format=urlencode to Email fields. This will convert the @ symbol to %40.

After making your redirect link, you’ll need to make sure your redirect website can capture the information from the query strings. If you’re redirecting to a Qualtrics survey, details about preparing your survey to capture the information can be found in Part 2 of the Passing Information into a Survey section above.

Some of the Qualtrics email editors contain piped text for your survey link instead of the survey link itself. This includes emailed survey invitations along with the XM Directory Task. You can add query strings to the piped text for these links so that the query strings are added to the link when the email sends. One such scenario where this is useful is if you’re sending many similar distributions and want to track which responses come from which distribution. Extra steps need to be taken to make sure your link is built and hyperlinked properly in your Qualtrics emails.

  1. Open the email editor and begin composing a message. This could be the email editor for email survey invitations, or the XM Directory Task.
  2. If your message already has Piped Text code for a survey, delete the code. Survey link Piped Text code is generally in the format of ${l://SurveyURL}. We do this to ensure the link we build is free of errors.
    the email editor with piped text for survey links
  3. Click the Piped Text icon {A} and select Survey Links → Survey URL.
    the email editor. click the piped text button --> survey links --> survey URL to insert the correct piped text
  4. Build your link using the instructions from Part 1 of Passing Information into a Survey. The Piped Text code that you inserted will act as your URL.
    Example: Let’s say we’re sending a survey out in waves and want to track which wave a respondent was a part of. Our URL in the email editor will look like ${l://SurveyURL}?Wave=wave1


    Qtip: You can also use Piped Text for your query string variables and values. However, to make sure your piped values are encoded correctly, you need to add ?format=urlencode to the end of piped text values, before the last bracket. This ensures values with spaces and special characters carry over properly into the query string. For example, pull Embedded Data called Department into your query string by using ${e://Field/Department?format=urlencode} instead of ${e://Field/Department}. However, don’t add format=urlencode to Email fields. This will convert the @ symbol to %40. Additionally, do not add format=urlencode to the Piped Text for the survey URL.
  5. Copy the newly created link and highlight the link in the message editor.
    highlight your URL in your email editor and click the hyperlink button to hyperlink the URL
  6. Click the hyperlink button.
  7. In the URL box, paste your copied link.
    hyperlinking the survey link
  8. Change the protocol to <other>.
  9. If desired, change the Display Text of the link, e.g., “Click here to take the survey.”
  10. Click OK.

How to Use Q_EED

Q_EED can be used as a URL parameter to pass obfuscated (or Base64 encoded) Embedded Data parameters. One of the most common use cases is to pass JSON data in a binary format through a URL.

In the example below, we are going to communicate a respondent’s gender (Male) and age (32) into a Qualtrics survey using Q_EED appended to the end of a survey link as a query string.

  1. Add the Embedded Data Gender and Age to your Survey Flow.
  2. Write out the information you want to pass in JSON format. For example:
  3. Now Base64 encode the entire JSON format, from bracket to bracket. Once encoded, the JSON from Step 2 looks like this:
  4. Get your survey URL.
  5. If the URL has a question mark (?) anywhere in it, add an ampersand (&) to the end. If there is no question mark, then add a question mark (?) to the end.
  6. Add the result of Step 3 to the end of your URL. It should now look like this:
Qtip: Do not vary the spelling, punctuation, or case sensitivity of your variables. If your Survey Flow says “Gender,” the G must always be capitalized to successfully encode and then carry this information over.

How to Use Q_PopulateResponse

Q_PopulateResponse is used as a URL parameter to pre-populate survey responses.

Values are passed through the URL as JSON formatted fields:

YourSurveyURL?Q_PopulateResponse={"QID1":"6","QID2":"4","QID3":"this is my text","QID4":"1"}

If you want to pipe in last year’s answers to this year’s surveys, you can upload the answers as Embedded Data to a contact list and then set up a custom individual link that references these answers. First, write out some clickable text in your distribution email, then get the piped text for the survey URL, and then use the link button in the Rich Content Editor to link to something like this:


This example is referencing the contact fields QID1, QID2, and QID3. Be sure to encode the quotation marks (“) with %22, but do not encode the entire URL string as it will disable the piped text.

This link will populate last year’s answers. If the person changes some of these default answers and then exits the survey, when they re-enter the survey, the most recent save overrides what the URL states should be populated. Also, if there is display logic on a question, it will fill that question, but it will not be recorded unless the person chooses the correct logic that would display that question.

Qtip: See the FAQs at the bottom of the page for help with JSON formatting.

Common Use Cases

Below are some common Qualtrics use cases that use query strings. Visit the linked pages for more information.