oTree Forum >

How to record Prolific ID when using oTree session-wide link?

#1 by cjy2001

Hi all,

I'm planning to run an experiment by using both Qualtrics and oTree, and my plan is to redirect them to the oTree experiment after completing a survey on Qualtrics. For that reason, I'm going to provide a session-wide link at the end of survey. I also need to connect data from Qualtrics and oTree, so I want to record their Prolific IDs. I have checked out many online resources, and many have mentioned using oTree HR. However, since the Qualtrics survey is ahead of oTree, I have to enter the Qualtrics link as the study url on Prolific. 

I tried to use the function such as the following to extract participant's prolific ID, but the participant_label column is still empty. I guess since I'm not using the link oTree HR provided, it wouldn't record the correct prolific ID?
    "def before_next_page(player, timeout_happened):
            player.participant.label = player.PROLIFIC_PID"
            
An alternate solution I can think of is adding another page in oTree, asking participants to manually enter their Prolific ID and then export it. However, I'm just wondering if there is a more elegant way to record their Prolific ID? Should I change the session-wide link by adding PROLIFIC_PID={{%PROLIFIC_PID%}}, etc.?

Thank you for reading through this, and I really appreciate any helps in advance!

Best,
Jiayi

#2 by clintmckenna (edited )

You have stored the prolific Id in qualtrics by the time you redirect them, correct? If so, you can pass it to the participant label by redirecting them and adding this to the otree url: ?participant_label=${e://Field/PROLIFIC_PID})

Here is a short writeup using mTurk, but its the same process!
https://clintmckenna.com/blog/2020-05-06/

#3 by cjy2001

It works! Thank you very much!

Write a reply

Set forum username