Adding custom data to survey responses using External IDs

SurveyLegend has a feature called “External ID” which can be used to add arbitrary data to survey responses.

External id can be used for many purposes, for instance identifying an individual respondent (e.g. custom id from your system, email address, name, phone number), grouping respondents together (e.g. consumer, business, government, ngo, control group, age group), tracking where responses came from (e.g. email campaign, social media, store location, country, city, company etc) or any other parameters.

How to add data as external IDs

External ids are part of the survey URL, they are appended at the end of long survey links as query parameters, e.g

Parameter names and values of the external id should be url encoded, e.g. param1, value1, param2 and value2 in the query string.

It’s easier to read the and understand the external id when used with characters that do not need to be url encoded. This includes uppercase and lowercase letters (A-Z), decimal digits (0-9), hyphen “-” , period “.” , underscore “_”, and tilde “~”.

Generating links with external IDs

There is a link generator in the Share step of SurveyLegends survey editor. Type the external id in the field and an appropriate link will be generated, parameter names and values will be correctly URL encoded.

External IDs are not passed along when the short link, (e.g. is expanded to a long link, the survey will load but the external id will not be saved. Therefore always use the long link together with Exernal IDs.
Generate a link with an External ID

To view then long link of a survey, open the short link in another browser tab. Add the external id to that link.
It’s possible to use spaces in an external id as long as they are URL encoded e.g, spaces will become %20. Consider using hyphens/dashes (-) or underline (_) to separate words instead of spaces.


SurveyLegend does not impose any limits on the length or contents of the external id values. However there are limitations in how browsers (e.g. Chrome, Firefox, Safari, Edge, Internet Explorer) handle URLs.

Internet Explorer 11 has a limit just above 2000 characters for a URL, more modern browsers have a much higher limit. To make sure that the survey loads and works for the widest possible audience, keep the entire survey link at 2000 characters, URL encoded of course.

When characters are not URL encoded they might not be saved exactly as they looked like in the URL. Some characters are reserved, such as & and ?, and might result in some part of the external id not being included.

Examples of external ids

General structure

Multiple parameters with only values:

Multiple parameters with parameter names and values:

Multiple parameters with mixed with parameter names, values and only values:


An email directly appended after the survey id ([email protected], %40 is the @ sign url encoded):

Email with a parameter name:


Pass url as query parameter, this is a bit contrived example including https:// in the url, it’s to clearly illustrate that the value should be url encoded.

( url encoded)

Real world examples

For instance when loading a survey on a tablet in a store for shoppers to participate.

Tracking source of respondents

A survey can be shared using several different platforms, e.g. social media, email, embedded in a webpage, sms. printed media with QR-code etc.

Some researchers might not be interested in tracking each individual respondent, but might prefer to instead analyze the traffic and see from which sources responses are coming from.

Use the source as external ID, for instance:


Using only query parameters to load survey and include external id

Using only query parameters is also possible in case it might be needed or convenient.

Legacy external ids

Previously SurveyLegend surveys used longer links which included some redundant information. The hash (#) and the user id with first tilde (~) are removed in the new format of survey links.

Legacy long link

External ID using tilde (~) as separator

Mixed usage of tilde (~) and query parameters

All links with the legacy structure will continue to work just as before. When opening a link with the legacy structure it will quickly change into a link with the new structure in the browsers bar.

Note: can not handle links with a hash (/#/) in them. It will redirect to

How to view External IDs

There are several ways to view external IDs.

Individual responses

The External ID can be viewed after selecting a response in Individual Responses view of SurveyLegend, in the Metrics tab.

An illustration of individual responses, showing how IPs and External IDs are shown to survey creators.

The illustration above shows an example of what is shown under the Metrics tab in the Individual Responses view.

External ID will also be included when an individual response is exported to PDF.

Export of responses to Excel, CSV or ODS

When exporting responses to a dowloadable file, External IDs will all be in one column, they will look just like in the link of the survey.

Did you come to our seminar last week? How satisfied are you with the following aspects of the seminar? What is your current position? External id
Yes Satisfied Supervisor [email protected]
Yes Satisfied Marketing [email protected]
No N/A Accounting [email protected]
Yes Very satisfied IT [email protected]

* The above data is fake.
The above table shows an example of a downloaded spreadsheet file. First row shows survey questions, and each of the next rows represent one respondent.

It’s possible to split up the External ID column into several other columns in Excel or LibreOffice.
Use amperesand (&) or tilde (~) character as delimiter. The cells might need some more processing in case param=value format is used.

Google Sheet integration

External IDs will also be in a separate column in the connected Google Sheet.


External IDs can be accessed as externalId property on each survey response retrieved from the SurveyLegend API.

API call



		externalId: "param1=value1&param2=value2&param3",

API documentation

User guide

Become a Legend Now ;)

Make your 1st free online survey today!

starMobile-ready surveys
starUnlimited responses
starLots of amazing features!