Carrying Participant ID from Qualtrics, to Pavlovia, and back to Qualtrics

In my study, I have participants see an information letter hosted on Qualtrics and then answer some demographic questions.

When that Qualtrics section ends, I have set the termination redirect URL to be my Pavlovia study. In addition, I’ve added ‘id’ and ‘participant’ variables into the URL such that ‘id’ is filled in from the ID set in the Qualtrics study, and ‘participant’ is set to “PARTICIPANT” with the intended purpose of it not appearing in the experiment dialog box:

https://run.pavlovia.org/Lab/remembering-words-and-symbols-online/html/?__pilotToken=3c59dc048e8850243be8079a5c74d079&__oauthToken=a229b1ee8594f27743c2d1447691ff55640fff170f1be70b9057b811f35f924f?id=${e://Field/id}&participant=PARTICIPANT

working blank dialog

As you can see in the dialog box above, as well as this example URL below, the ‘termination URL’ works just fine by removing the ‘participant’ dialog option and setting ‘id’ correctly:

https://run.pavlovia.org/Lab/remembering-words-and-symbols-online/html/?__pilotToken=3c59dc048e8850243be8079a5c74d079&__oauthToken=a229b1ee8594f27743c2d1447691ff55640fff170f1be70b9057b811f35f924f?id=273514&participant=PARTICIPANT 

However, I’m at a loss when transferring this ‘id’ value from Pavlovia back to Qualtrics. In my experiment, after the initial Qualtrics part followed by the Pavlovia study, I have the study redirect back to a different Qualtrics study for a feedback letter and automatic participation credit granting. So far, here is what I have set trying to accomplish this task:

These settings result in the following URL on my final Qualtrics section:

https://uwaterloo.ca1.qualtrics.com/jfe/form/SV_cOylp3qXrZLbnql?id=undefined 

So, it seems my ‘id’ variable is not carrying through from Qualtrics to Pavlovia and back again. because of this, I can’t populate ‘id’ in Qualtrics and therefore can’t have automatic credit granting. Does anyone have a solution for carrying through the ‘id’ variable from the Pavlovia URL to the second Qualtrics section?

Please check my crib sheet (pinned post) for how to do this.

I did try to follow the instructions at the top of page 4 in your crib sheet, but wasn’t able to figure out how to integrate ‘id’ as a variable in the complete URL, and have it auto-fill from the URL of the Pavlovia experiment, and have it not appear as a text-entry box in the initial experiment dialog screen. For instance, I can get the complete URL to display the variable ‘id’, or ‘participant’ (or anything else set in the Experiment Options), but I can’t get this variable to automatically update from the Pavlovia URL (i.e., the last bit of code pasted in my original post above). Any thoughts on how to store ‘id’ from an existing URL instead of having participants type it in during the initial dialog box?

Here are the issues I can spot.

  1. In your URL you have ? twice because you’re using a pilot link. The format for passing variables in a URL is URL?var1=val1&var2=val2&var3=val3 etc. So you need & not ? in front of id=. When you change to your final URL you’ll need to switch this back to ? because there won’t be a pilot token.

  2. In the URL you are sending a value for id and a constant for participant. However since your expInfo box only contains participant not id, then id would be lost, even if you were successfully sending it. Personally I’ve been sending two values, participant set by a quota value and id set as a random value.

  3. Your data file name has been changed to id, which doesn’t match your expInfo variable (participant).

  4. Your completed URL wouldn’t add your value for id, even if there was one. You should have $"https://qualtricsurl/?id="+expInfo['id'], The example in my crib sheet is $"https://brookeshls.co1.qualtrics.com/surveyname?expname="+expName+"&participant="+expInfo['participant']

2 Likes

Good catches @wakecarter! I’ve got the study working now with ‘id’ as a blank experiment info field (see screenshot below).

Then the following code for the ‘complete URL’ that forwards to my second Qualtrics phase. The ‘id’ does indeed forward onto the next Qualtrics phase too in the URL, which is great!

$"https://uwaterloo.ca1.qualtrics.com/jfe/form/SV_cOylp3qXrZL/?id="+expInfo['id'] 

The only weird thing is, I’m still getting “PARTICIPANT” at the start of each data file name, even though the word ‘participant’ doesn’t appear anywhere now. For instance, here is my data file name code that is suppose to have ‘id’ be the first bit of the filename:

 u'data/%s_%s_%s' % (expInfo['id'], expName, expInfo['date']) 

Any thoughts on this last issue?

Editing the code for the data file name only works offline. I’d recommend that you switch back to participant, especially if you’re setting it remotely anyway.

Unfortunately I can’t use ‘participant’ because I’m using auto-crediting for participants via a SONA system that must have identities set to ‘id’ for it to work. Still, the data file names are differentiable by the timestamp, so I’ll likely just leave it alone. Thanks!

You can use participant.

You can set participant to your Sona id value in Qualtrics and then set id as expInfo[‘participant’] in your completed URL.

Hi, I know this thread is pretty old, but could you elaborate on this please?

(p.s. huge fan of your crib sheet–thank you for your service)

Please could you paste what you’re trying so I can see where you need help?

In Qualtrics you would need to set an embedded variable in the survey flow to capture the Sona ID value. You would then need to send that value to Pavlovia and then back to Sona.

This slide about how to connect Sona to Qualtrics might help.

1 Like

Never mind, I think I maybe figured it out. I was trying to figure out how to change “id” to “participant” (and how to do all of it in general). I might have it now hopefully.

1 Like

Hello! Thank you SO much for all of your extremely useful crib sheet and responses.

I’m stuck on an issue related to carrying the Pavlovia Participant number back to Qualtrics. I am using SONA and the SONA ID which is carried from SONA to Qualtrics to Pavlovia and back to Qualtrics. The SONA ID (which i have changed to ‘participant’) is working perfectly when transferring over to the first Qualtrics survey and Pavlovia. However, it does not seem to be carrying back to the last Qualtrics survey from Pavlovia. I’ve done exactly what you have listed. Whenever I download the Qualtrics data, this is all I get for the participant information:
Screen Shot 2020-10-27 at 8.14.22 PM

I have no clue how to get this to instead read in the Participant ID. Could you please guide me?

Here is my link that is pasted in PyschoPy:

Thank you again :slight_smile:

You’re missing $" at the start of your two URLs

1 Like

Oops can’t believe that was missing! I added the $". However, now when I try syncing the experiment to Pavlovia, I receive an error and cannot sync:

it also appears that the link for some reason is not being accepted?

Your single quotes around participant look slanted, not simple.

1 Like

I think you need to change “?participant=” to “?id=” because Qualtrics recognizes the variable “id” and not “participant” like Pavlovia does. So it will be $"https://uc ... ?id="+expInfo['participant'] (I think anyway, sorry if that doesn’t work)

Hi sorry, I have a few more questions I was hoping you could help with.

  1. You had a post in this thread saying that you used a branch to have participants come back to the same Qualtrics survey after finishing the Pavlovia experiment. Where did you put the branch? Right now, I have some survey question, then a link to the Pavlovia experiment on a Qualtrics page, and then put a branch after that to branch to the end of the survey if var = 1, which I define in the completed URL from Pavlovia ( I have $"https:// ... ?var=1&id="+expInfo['participant']for the URL). Does this work or am I doing something horribly wrong?

  2. Relatedly, I’ve had one participant so far and she said that there was an error when she clicked to end the Pavlovia experiment. She said it brought her back to the ‘initializing experiment’ screen like it was starting over. Do you know why it might be doing that?

  3. The output file from Pavlovia doesn’t have the participant ID from Sona or Qualtrics. Under the ‘participant’ column, it just says “{e://Field/id}”. So it looks like it might not be transfering correctly from the link?

I’ve been making this Sona --> Qualtrics --> Pavlovia --> back step-by-step as I go along. I was planning on sharing it with you to share with others once I figured it out, but it will also help now to show you exactly what I’ve done so far. Thanks for your help!

  1. Although I have sent a participant back to the same Qualtrics, I didn’t manage to continue the same response, so I wouldn’t recommend it. I now use two Qualtrics surveys – one containing the PI sheet which ends on “Continue to Experiment” then a second which has demographics and other elements.

Are you remembering to add var as an embedded variable in the survey flow?

  1. That sounds like she didn’t click on the popup to be redirected. I feel like I used to know more about this error but I can’t remember now.

  2. That does look like you’ve got an issue. Here’s my template redirect URL for one of my experiments.

https://run.pavlovia.org/Wake/emotional-stroop/html/?participant=${e://Field/participant}&id=${e://Field/ResponseID}&group=${e://Field/group}&researcher=${e://Field/researcher}

The embedded variables are all set in the survey flow.

Please could you give me comment or edit access to your step-by-step guide using email p0071480@brookes.ac.uk ?

Best wishes,

Wakefield

Thanks for the response!

  1. I really don’t need them to go back to Qualtrics, but I think going from Qualtrics to Sona is how Sona gives the participant credit, right? So it was really just going back to Qualtrics to end the experiment. I know you don’t use Sona, but do you think I could put the Sona URL as the Pavlovia completed URL and skip the last Qualtrics step?

1.5. Yes I am. It’s actually called “fin” and I embed it after the block with the link and before the branch.

  1. I didn’t know there would be a popup after the experiment…I thought participants would just click my ‘finish’ button and then the study would be over. Do you think there could be a popup blocker issue then? I really wish I could’ve looked at her console.

  2. Ohhhh I’m missing the dollar sign! Thanks!

I added you to the Google Doc. Thanks again!