Using Prolific IDs in OSWeb experiment
Edited to add:: oops I'm sorry I didn't know that Elisa moved over my previous question to the correct part of the Forum! As I cannot delete this post myself, feel free to do so!
Hi!
I'm almost ready to run the experiment I've created in OSWeb on Prolific. I've uploaded it to our university's JATOS server, and it works fine from there (I've send people links and they work as well).
As I want to run it on Prolific, and they make use of huge ID numbers, I wanted to integrate these numbers right away, as is also indicated on the JATOS website and is explained (but for a different hosting site) on the Prolific site. However I have to admit that I'm a bit lost. In Prolific I can indeed find the URL Parameters, and I'd need the PROLIFIC_PID
to register Prolific ID's I'd say.
However where I get stuck is what I now need to do to make sure that these parameters are accounted for. The JATOS site just says that "Then you can access those URL parameters in your study’s JavaScript via jatos.urlQueryParameters". I'm not quite sure how to do something like that? I assume that I would have to change it in my OSWeb file in some way? But I'm just not sure how to do this.
I also have another question related to Prolific IDs. Will they be treated as the subject number? I'm currently giving people a certain condition based on their participant number, but this is based on a number, not a combination of letters and numbers.
Kind regards,
Sanne
Comments
Just add the following code to a java codeblock in your experiment:
var prolific_id = jatos.urlQueryParameters.prolific_pid;
vars.prolific_id = prolific_id;
and make sure to save the variable 'prolific_id' in your logger.
Then, when you input the experiment link in Prolific, add this to the end of the link:
&prolific_pid={{%PROLIFIC_PID%}}&STUDY_ID={{%STUDY_ID%}}&SESSION_ID={{%SESSION_ID%}}
Hi Sanne,
Can you report back whether Jasper's response solves your problem? In the mean time, I will close the other discussion Elisa moved here. So, let's gather the information on that question in this discussion here.
Thanks,
Eduard
Hi Eduard,
Yeah of course! The current plan is to run the experiment at the end of this week/beginning of next week, so I'll let you know by then if it works!
Kind regards,
Sanne
Hi!
It does indeed work! I didn't notice at first that the link that was given here differed from the one that they give in Prolific, so for others please indeed copy the link that Jasper provided!
Kind regards,
Sanne
All credits go to @Yavor for figuring this out btw!
This solution works when the participants come directly from Prolific to Osweb (hosted on JATOS) but in my experiment I need participants to come from Prolifc to a Qualtrics Survey and then to Osweb. When doing that, I can't register participants' Prolific ID on Osweb/JATOS even if I place the code
at the end of the link on Qualtrics (as mentioned in this link [https://osdoc.cogsci.nl/3.3/manual/osweb/prolific/] which is aimed at directing participants directly from Prolific to Osweb).
Is there a solution to register the Prolific ID on Osweb/JATOS when providing the link on Qualtrics?
Best,
Sullivan
Hi Sullivan,
I have no clue, but maybe @Yavor has some experience with stuff like that?
Sorry for not being able to help,
Eduard
Hi @SullivanFontesse ,
I had a similar issue, but I have worked around it by implementing whatever was in Qualtrics in my OSWeb study (I only had to implement the consent form, demographic data can be imported through the prolific IDs). Depending on how big your Qualtrics component is, this may or may not also work for you. The main issue is that, even though Qualtrics can recognise the prolific ID and can register it automatically, the forwarding function at the end of a Qualtrics survey to the OSWeb study link does not have this functionality unfortunately. You may want to address that question specifically to the Qualtrics community forum to see if there is a custom script that allows for this functionality.
Best
Jelle
Hi @SullivanFontesse & @JelleStudentRug,
I'm planning to do something similar to what Jelle is describing Prolific to Qualtrics to Jatos to Prolific, but I haven't implemented it yet.
This said, I did in the past use Qualtrics to link to online tasks, passing information as URL parameters. Qualtrics can receive the PROLIFIC_PID, STUDY_ID and SESSION_ID variables from the URL automatically (as long as you passed them on correctly from Prolific). To pass them on to JATOS when the Qualtrics survey is completed, you need (1) to have setup variables in Qualtrics to read the parameters from Prolific, and then pass the piped text corresponding to these in the JATOS URL you are redirecting to.
For the first step, you need to use the "Set Embedded Data" tool in the flow:
For the second step, work out what the piped text is for the variable of interest you want to pass on to JATOS. If you're not sure, go to any text component of your survey and use the "Insert piped text / Embedded Data FIeld" tool:
Once you insert it, you'll know what to insert in the URL you send participants to upon completion of the Qualtrics survey. In this case: ${e://Field/PROLIFIC_PID}
Set up the customize end of survey event to indicate where to redirect your participant. Here's a dummy example (adapt it your need, passing on more parameters if you need).
Again, I haven't tried it myself yet, but I think it should work along those lines.
You can also find useful descriptions and even some sample task to do JATOS to Qualtrics or Qualtrics to JATOS here:
Hope it helps.
Fab.
I'm also having a problem integrating with prolific. I have included the lines above
var prolific_id = jatos.urlQueryParameters.prolific_pid;
vars.prolific_id = prolific_id;
But when trying to test the code I get the following error:
Uncaught TypeError: Cannot read properties of undefined (reading 'prolific_pid')
which is thrown by the first line var prolific_id...
This happens if I test the code manually by pasting the worker link and adding a made up prolific id (e.g. '&prolific_pid=dffjhdjgh') and also if I test it using the preview function in prolific.
What am I missing that will make jatos recognise the ID?
my experiment is written using jspsych and I had previously used jsPsych.data.getURLVariable('PROLIFIC_PID') to get the ID but this is now returning me an undefined.
thank you,
Juliet