PsychoPy and Pavlovia
For experiments run online with PsychoJS on Pavlovia, parameters in the link are added to expInfo and saved with your data, so PARTICIPANT_ID, STUDY_ID, and SESSION_ID need no setup. Use your Pavlovia run link as your Populiva study link.
-
1. Send participants back when they finish
In PsychoPy Builder, open Experiment settings, then the Online tab, and set the Completed URL to your study's completion address (and the Incomplete URL to a screen-out code, if you use one). Copy the exact address from your study page:
https://populiva.com/c/STUDY_ID?code=COMPLETION_CODE -
2. Add the quality snippet (optional)
Add a Code component to your first routine and put this in its Begin Experiment tab, with the code type set to JS. The snippet reads SESSION_ID from the page address. It sends only counts, never responses.
// Code component, "Begin Experiment" tab (JS) const populivaSnippet = document.createElement("script"); populivaSnippet.src = "https://populiva.com/q.js"; populivaSnippet.async = true; document.head.appendChild(populivaSnippet); -
3. Tell participants
If you use the snippet, say so in your consent form, for example: “This experiment records counts of activity, such as time spent and switching away, to check data quality. It doesn't record your responses or what you type.”
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.