Integrate oTree with CloudResearch (Turkprime)

287 views
Skip to first unread message

Pei-Hsun

unread,
Oct 17, 2021, 8:13:17 PM10/17/21
to oTree help & discussion
Hi everyone,

I'm wondering if anyone tries oTree software by CloudResearch (Turkprime)? In oTree's documentation, it said, "oTree tracks each worker by their MTurk ID and displays that in the admin interface and shows whether they arrived on the last page," but I presumed it is not the case if I create a session without "for mTurk" option and just input the oTree link to  CloudResearch wizard? If this is the case, Does anyone know how to track mTrurk id?

I would also appreciate any tricks to use oTreeon CloudResearch.

 Thanks!

Chris @ oTree

unread,
Oct 17, 2021, 8:39:44 PM10/17/21
to oTree help & discussion
If you use CloudResearch, you shouldn't use oTree's MTurk integration. Instead, give CloudResearch the session's room URL.

Pei-Hsun

unread,
Oct 17, 2021, 10:08:07 PM10/17/21
to oTree help & discussion
Thank you Chris. Do you know how to track MTurk ID in this case with CloudResearch?

Chris @ oTree 在 2021年10月17日 星期日下午8:39:44 [UTC-4] 的信中寫道:

Pei-Hsun

unread,
Oct 18, 2021, 12:10:24 AM10/18/21
to oTree help & discussion
Because I think I need MTurk ID which can link with the data to know how much to pay each participant?

Pei-Hsun 在 2021年10月17日 星期日下午10:08:07 [UTC-4] 的信中寫道:

BonnEconLab

unread,
Oct 19, 2021, 1:54:20 PM10/19/21
to oTree help & discussion
Isn’t this the same problem as the one addressed in https://groups.google.com/g/otree/c/FIDiiE-H3Tc/m/f1Nm7180AQAJ?

In other words, couldn’t you use URLs of the form http://localhost:8000/room/live_demo/?participant_label=MTurk_ID? This, of course, requires CloudResearch to have access to the MTurk ID so that it can replace MTurk_ID by the actual ID when distributing the URLs to the participants.

Pei-Hsun

unread,
Oct 19, 2021, 5:57:26 PM10/19/21
to oTree help & discussion
Thank you! The cloudresearch would add a this behind the link ?workerId=ABCD1435&hitId=35hgfsbdu&assignmentId=vbwufg
If the URL I give to cloudresearch is http://localhost:8000/live_demo/?participant_label=
would otree automatically record all the query strings?

BonnEconLab 在 2021年10月19日 星期二下午1:54:20 [UTC-4] 的信中寫道:

BonnEconLab

unread,
Oct 20, 2021, 12:09:58 PM10/20/21
to oTree help & discussion
Hi Pei-Hsun,

Please read the thread that I linked to! It addresses the question whether information separated with ampersands will be recorded properly. The answer is that the participant label will contain only the information up to the first “&”. Since the worker ID is unique (I guess), recording the worker ID will suffice, however.

Of course, you will not provide the URL http://localhost:8000/live_demo/?participant_label= to CloudResearch literally!


You can test this with your local oTree (otree devserver) instance by opening http://localhost:8000/live_demo/?participant_label=workerID=Pei-Hsun in your browser (assuming that you have activated the “Room for live demo”).

Best,

Holger

BonnEconLab

unread,
Oct 20, 2021, 12:13:42 PM10/20/21
to oTree help & discussion
Sorry, the local test URL should have been http://localhost:8000/room/live_demo/?participant_label=workerID=Pei-Hsun (i.e., the “/room/” was missing in my previous message).

Likewise, the URL supplied to CloudResearch will be https://yourservername.com/room/name_of_your_room/?participant_label=.

Zhang Sr

unread,
Dec 9, 2021, 12:35:10 AM12/9/21
to oTree help & discussion
Hi guys, 

I am facing the similar issue, I run the experiment on Cloud Research. CloudResearch recorded the Mturk worker id, but from Heroku Otree monitor, this information is missing. 

I generate the unique completion code, however if one player close the tab on WaitPage, the code is not shown on Wait Page, so that I cannot trace them.

I read through the above posts, so to add a participant label can identify the workers? Is it correct? Sorry that I feel confused about that.

Shaorong

MC_NeuroEcon

unread,
Jan 18, 2022, 2:17:00 PM1/18/22
to oTree help & discussion
Hi all,
An update for anyone looking for guidance about CloudResearch / TurkPrime URL parameters: they have changed them and the participant_label strategy no longer works. As of now the little image in their setup flow still reflects the old format, but what they're really appending after "?participant_label=" looks like this: "&hitId=HIT_ID&workerId=A_WORKER_ID&assignmentId=ASSIGNMENT_ID&a=EGSS0&tp_a=EGSS0&b=ASSIGNMENT_ID&tp_b=ASSIGNMENT_ID&c=340990&tp_c=340990". Since it starts with an ampersand Otree will capture nothing in participant.label.

The ways I have found to handle this are:
--capture the required information by asking participants to enter it manually via a form
--capture the URL params using Otree HR, which is a small page before the main task that turns the URL parameters into items in participant vars via the API endpoint (https://github.com/oTree-org/HR)
--capture the URL params using a page with javascript that turns them in to something else (see discussion here https://groups.google.com/g/otree/c/FIDiiE-H3Tc/m/f1Nm7180AQAJ )

Chris @ oTree

unread,
Jan 19, 2022, 1:06:11 AM1/19/22
to oTree help & discussion
Thank you for sharing this!
Reply all
Reply to author
Forward
0 new messages