Using URL parameters to record participant IDs from a survey company #92
Replies: 3 comments 3 replies
-
We literally just added this feature over the past few days :) @pingfan-hu made a demo survey here, and he's still working on a video to showcase it. It will eventually be posted on the demos page, and we'll add a whole article on it in the documentation. |
Beta Was this translation helpful? Give feedback.
-
This could also work if the respondent is able to provide a completion code, but a few points: When you make a completion code in the main body like this: completion_code <- sample(10^5:(10^6 - 1), 1) This will create a single code that is the same for all respondents. It's basically just running once and then getting embedded in the survey. Also, this code doesn't get stored in your response data, so you won't know what the code is unless you go to the end of the survey yourself to get it. If instead you wanted to generate a unique code for each respondent, then you should create the code reactively in the server code chunk. So your server chunk would have something like this somewhere before the main call to completion_code <- sample(10^5:(10^6 - 1), 1)
sd_store_value(completion_code, id = 'completion_code') # Can be any id you want This will store the value in your response data so you'll know the code for each respondent. Then in your survey you could display the created code like this: Completion code: **`r sd_output('completion_code')`** We recently made the |
Beta Was this translation helpful? Give feedback.
-
I'm going to close this as this is now supported. |
Beta Was this translation helpful? Give feedback.
-
I am wondering whether the potential to include URL parameter parsing in the
server.R
function is possible. Having recently used Prolific to recruit participants without using URL parameters I would definitely recommend using this feature if possible rather than allowing participants to input their ownuserID
.Below is some code that I think should solve this, though is not functional as session object is not found.
Beta Was this translation helpful? Give feedback.
All reactions