Automatically Transmit and Retrieve an Identifier via URL in LimeSurvey.

Settings Participant management Customization
2025-10-21 16:34:34
Admin

Objective

  • Transmit a participant identifier automatically from an external application to LimeSurvey via the URL.
  • Configure a hidden question in LimeSurvey to capture the transmitted parameter.
  • Link survey responses to an identifier without any manual input from the participant.

Why use URL parameter passing?

  • To automatically identify a participant without asking them to enter their identifier.
  • To link survey responses to an external system (application, portal, database).
  • To ensure data reliability by avoiding manual input errors.

1. How it works

The workflow relies on three simple steps: your application generates a personalised link, and LimeSurvey reads the URL to fill in a hidden question.

  1. Identification: your website or application identifies the logged-in user.
  2. Generation: it creates a personalised URL such as ...?participantId=USER_001.
  3. Capture: LimeSurvey reads the participantId parameter and automatically stores it in the database.

2. URL structure

The URL format must follow a precise structure:

https://your-instance.be/index.php/[SURVEY_ID]?participantId=[VALUE]

Example: https://limesurvey.ulb.be/index.php/123456?participantId=a1b2c3d4

Note: The parameter name in the URL (here participantId) must be strictly identical to the question code in LimeSurvey. Pay attention to case sensitivity: participantId and participantid are considered different.

3. Configuration in LimeSurvey

This step is essential for LimeSurvey to correctly capture the parameter transmitted via the URL.

Create the capture question

  1. Open your survey in LimeSurvey and navigate to the desired question group.
  2. Click on "Add a question".
  3. Select the type "Short free text".
  4. In the "Question code" field, enter exactly participantId (this code must match the URL parameter).
  5. In the "Question text" field, enter an internal label, for example Participant ID.
  6. Save the question.

Hide the question

  1. Open the settings of the question you have just created.
  2. Go to the "Display" tab.
  3. Set the option "Always hide this question" to "Yes".
  4. Save the changes.

Tip: The question will exist in the database and will record the transmitted value, but the participant will never see it in the form.

4. Passing multiple parameters

You can transmit several pieces of data simultaneously by separating parameters with the & character.

https://limesurvey.ulb.be/index.php/123456?participantId=U123&group=PRO&session=04

Each URL parameter must correspond to a question in LimeSurvey:

URL parameter LimeSurvey question code
participantId participantId
group group
session session

Note: Create a hidden "Short free text" question for each parameter you wish to capture.

5. Security and best practices

  • GDPR: avoid transmitting names or email addresses in plain text in the URL. Use UUIDs or hashes instead.
  • Encoding: if your identifiers contain special characters, use the urlencode() function from your programming language.
  • Pre-launch testing: always test manually by adding ?participantId=TEST to the end of your survey URL before distributing it.

6. Troubleshooting

The identifier is not recorded in the responses

Solution: Check that your survey is properly activated. Also verify that the question code does not contain any hidden spaces and that it exactly matches the URL parameter (case sensitivity matters).

The question is visible to the participant

Solution: Go to the advanced settings of the question, "Display" tab, and verify that the option "Always hide this question" is set to "Yes".

Need help?

For any difficulty, contact the LimeSurvey team via: Cellule.Web@ulb.be

On the same topic