Running online experiments for both Prolific and non-Prolific participants

Hi developers & community,

My Honours student is running an online experiment involving randomisation to groups (using @wakecarter’s code & the Pavlovia Shelf). We will be using mainly Prolific participants, but I wondered if it is possible to include non-Prolific folks (e.g. students doing the experiment for credit, friends & family etc.). We do have a site license for Qualtrics, so I thought of using that to generate unique random IDs for non-Prolific participants and channel through to the Pavlovia link, but how do I differentiate the participants for the completion URLs? Will this approach mess up the randomisation?

Thanks!

Deborah.

Are you including any expInfo variables other than participant in the launch URL? What I do is check the value of a variable which identifies the participant as not coming from Prolific and then change the redirect URL for those participants.

Hi Wake,

My student says Pavlovia automatically includes a bunch of things in the launch URL, so that the launch URL includes PROLIFIC_PID, STUDY_ID and SESSION_ID. I could include anything I want in the alternative launch URL - was planning to include ResponseID from Qualtrics at least.

Secondly, how do I change the redirect URL at the end only for those participants? I presume this will require some code, but it isn’t clear from your link what that would look like.

Thanks!

Deborah.

Hello @deborah.apthorp

This is how I create my redirect URL at the end of my experiments. Please note that I do not use Prolific or Qualtrics. However, this may provide you with enough information to adapt the code to your needs.

const baseURL = "https://your.server.address.for.not.finishing/";

const params = new URLSearchParams({
    exp: expName,
    VPn: VPn,
    VPCode: VPCode,
    Email: Email,
    Vorname: Vorname,
    Nachname: Nachname,
    Matrikelnummer: Matrikelnummer
});

const vpStundenURL = `https://your.server.address.for.credits/${params}`;

if (EmailYesNo === "True") {
    psychoJS.setRedirectUrls(vpStundenURL, baseURL);
} else {
    psychoJS.setRedirectUrls(baseURL, baseURL);
}

All the variables in params are created during the experiment run. EmailYesNo is a survey variable that allows participants to indicate whether or not they want to receive credit.

Best wishes Jens

If the Prolific link includes a value for STIUDY_ID then you could add STUDY_ID to the expInfo dialogue and add &STUDY_ID=NA to the non-Prolific URL .

Then you can add the following JS only code:

if (expInfo["STUDY_ID"] === "NA") {
     psychoJS.setRedirectUrls("nonProlificCompletedURL", "nonProlificIncompleteURL");
}

Hi Wake,

OK, great, that would be perfect. I’m almost done setting this up - just a quick question, where exactly should the JS-only code go? Should I add it to the final routine in the experiment, where the code component for finishing up the counterbalancing sits? (Assuming it should go in the “end routine” section of the code component.) Also, should I also include the completed & incomplete Prolific URLs here as above in Jens’ code, or is that not necessary since they are already in the Experiment settings?

Oh, also - I don’t really need to redirect the non-Prolific participants at all, since they won’t be receiving credit. I just don’t want to direct them back to Prolific, since they didn’t come from there.

Thanks

Deborah.

That JS code can go anywhere since the information (expInfo[“STUDY_ID”) should be available from the start. Note, that I recommend that you add STUDY_ID to the expInfo dialogue box, since I’m not sure that the code will work without it.

You could set the URL to your university home page, or anywhere else that feels relevant. You might also be able to set the redirect to “” but that might give an error.

If the Prolific return URL is in experiment settings it doesn’t need to be here too. This code is for changing the redirect URL if you don’t want to use the one in Experiment settings.

Great, thanks, that is very helpful. Good idea re the university home page!

I guess I could also set the default STUDY_ID to a number that isn’t the Prolific study ID (e.g. 42), so that the participant doesn’t see a blank dialogue box and maybe enter a number in there?

Also, it seems odd to me that our original redirect link included "&session={{%SESSION_ID%}}, but the csv file does not have that session ID in the “session” column - instead there is a separate column headed “SESSION_ID”. Why might this be? We DID have session in the expinfo dialogue box (with the default set to 001).

So, just this code segment (as JS only):

if (expInfo["STUDY_ID"] === "42") {
     psychoJS.setRedirectUrls("https://www.une.edu.au", "https://www.une.edu.au");
}

Or should the number not be in quotes (if I do use a number)?

Strangely, the previously “consumed” credits seem to have been returned to my account.

Thanks!

Deborah.

You can hide the entry in the expInfo dialogue box simply with &STUDY_ID= I suggested &STUDY_ID=NA instead of a number because of the potential confusion. expInfo variables are treated as strings, so if (expInfo["STUDY_ID"] === 42) will never be true.

Are you sure the missing credits weren’t reserved rather than consumed?

As I’ve noted elsewhere, expInfo['session'] also gets set by the counterbalance code. If you want the Prolific session id then you should ensure one of these two locations is saving to a different column (which might be fine anyway).

Hi Wake,

Ah, yes, I could set the study ID in the forwarding link, good idea. I’m kinda liking 42 now, though!

The credits had been reserved before I downloaded the data, but were then marked as “consumed”, but now they’re back. I don’t really know what was going on there.