I have a study written in jsPsych and run on Prolific using JATOS as my server, and I’m having real trouble getting URL parameters from prolific. I wondered if anybody had successfully integrated prolific and JATOS and had any advice?
I have currently switched to asking participants to paste their prolific IDs in manually but ideally I would like to get URLs automatically to avoid any element of user error.
I have tried following the instructions provided by JATOS (below) but this crashes the script with the error pasted below
var prolific_id = jatos.urlQueryParameters.prolific_pid;
vars.prolific_id = prolific_id;
error:
Uncaught TypeError: Cannot read properties of undefined (reading 'prolific_pid')
This happens if I test the code manually by pasting the JATOS 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.
As 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.
If anyone has any experience integrating Prolific and jsPsych using JATOS I’d love any tips or feedback.
Thank you,
Juliet