Sona Systems : oTree Help Page

oTree Help Page

External Study Credit Granting with oTree

While these instructions refer to "credit granting", they work for both credit and paid studies. For paid studies, participation will be marked (instead of credit granted) just like with any other paid study.

Here are the basic steps, which are subject to change (since the product is controlled by oTree):

  1. On your Sona Systems site, change the Study URL so it includes ?participant_label=%SURVEY_CODE% in the URL. So if the oTree URL is:
    then change it to

  2. In oTree set-up, configure the last page of the room to go back to your Sona system. See example return here. The URL to use would be similar to:
    "" + str(sona_id).

    In order to get an example of this URL, login to Sona and go to your Study information. Pull the client side URL from here:

    Remove the XXXX from the end of the above copied URL and use in the bolded area below. In oTree Studio, you might have a def vars_for_template(player) block of:

    sona_id = self.player.participant.label
    link = "" + str(sona_id)
    return{'link': link}

    Then the HTML Template block might have this to redirect to the above URL to grant credit:

    <meta http-equiv="Refresh" content="0; url='{{link}}'" />

This page is a reference post used in the creation of the above. These features are described on oTreeā€™s site at the following URL:

("Participant Labels")