Skip to main content

Survey tool guides

oTree

oTree identifies people in a room by participant_label. Use a placeholder in your Populiva study link so each participant's PARTICIPANT_ID becomes their label. Populiva also adds the three IDs under their own names, which oTree ignores.

  1. Create a room in your oTree project and use its room-wide link with participant_label={{PARTICIPANT_ID}} added, as your Populiva study link:

    Because the label stays the same for a participant in your lab, someone who reopens the link returns to the same oTree participant instead of starting again.

    https://your-otree-server.example.edu/room/your_room?participant_label={{PARTICIPANT_ID}}
  2. 2. Send participants back when they finish

    On your last page, add a link (or button) to your study's completion address. Copy the exact address from your study page. In a template:

    If you redirect with JavaScript instead, use Django's escapejs filter on the URL so the & in the address isn't escaped.

    <a href="https://populiva.com/c/STUDY_ID?code=COMPLETION_CODE" class="btn btn-primary">Finish and return to Populiva</a>
  3. Your consent page should say the study is recruited through Populiva and that you receive an anonymous ID, not names or emails.

Test before you launch

Open your survey link with test values added, for example ?PARTICIPANT_ID=test&STUDY_ID=1&SESSION_ID=test, and check that the three values are saved with your test response.

The snippet ignores sessions it doesn't know, so tests don't create data. The completion address will say there's no active study for you; that's expected outside a real session.