Automatically Transmit and Retrieve an Identifier via URL in LimeSurvey.
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.
- Identification: your website or application identifies the logged-in user.
- Generation: it creates a personalised URL such as
...?participantId=USER_001. - Capture: LimeSurvey reads the
participantIdparameter 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:participantIdandparticipantidare 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
- Open your survey in LimeSurvey and navigate to the desired question group.
- Click on "Add a question".
- Select the type "Short free text".
- In the "Question code" field, enter exactly
participantId(this code must match the URL parameter). - In the "Question text" field, enter an internal label, for example
Participant ID. - Save the question.
Hide the question
- Open the settings of the question you have just created.
- Go to the "Display" tab.
- Set the option "Always hide this question" to "Yes".
- 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=TESTto 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