💡 Why would we want to conduct online experiments? It’s better to think thoroughly about the pros and cons before you start learning the technical details.
-Pros: more subjects from a more general pool; almost no time constraint; easy data collection across multiple sessions…
-Cons: limited control over subjects regarding how they interact with the task, and you may even encounter frauds/bots; poor internet connection could lead to data loss; imprecise time control and measurement; if your experiment needs to create a sense of social connection among strangers, it may be more challenging online.
While some of the cons can be improved through experiment designs or technical tricks, others are more intrinsic and unavoidable. Here are some articles for further reading:
Crowdsourcing research: Data collection with Amazon’s Mechanical Turk
You’ll need a similar process for running online experiments compared to in-person experiments.
From wherever you recruit people for in-person experiments —>
Instead of using MATLAB/Python to run a task on a local computer —>
Participants open the web link and complete the task on their own. The task is playable in a web browser.
This is quite intuitive for in-person experiments. You have a save_data function in your experiment program, and you pay the participants in cash. —>
The data needs to be saved from participants’ browsers to somewhere you can download, and you usually pay them through the recruitment platforms or manually by gift card or bank transfer.
The most widely used recruitment platforms are Amazon Mechanical Turk and Prolific. Unfortunately, I don’t have personal experience using these platforms, as I use a local recruitment platform run by UZH and ETH. However, here are some great resources I saved for my possible future use:
Meanwhile, there is a tool called psiTurk developed by cognitive scientists to help run experiments on Mturk.
To code a task that is playable in a browser, you will usually need JavaScript, HTML, and CSS. To put it simply, JavaScript is for the parts with “animations” and where participants take actions, basically your task itself; HTML is for integrating the elements in a webpage, including your task; CSS is for making your webpage look nicer.
Sometimes you may need to use other programming languages (for example, Python) to achieve specific functions in your task. This is doable, but it means that you will need a server to host your experiment.
It is unusual to need game engines to code your experiment, which typically require C# or C++.
(I personally used codecademy to learn Javascript and the basics of web development.)
There are also some toolboxes which require no coding, and some are even one-stop experiment platforms:
Usually, the flexibility of a programming toolbox is negatively correlated with its complexity. Therefore, there is no single correct answer for the choice of toolbox. What programming toolbox you should use highly depends on the specific needs of your task.
Sometimes you don’t need to have a playable task but only a survey, and usually you may need a survey as a supplement to your task to collect some user information, show instructions and run quizzes. Here are some survey websites:
And surveys can have advanced functions, for example:
SMARTRIQS: A Simple Method Allowing Real-Time Respondent Interaction in Qualtrics Surveys
As I mentioned before, participants will open a web link to play the task. But where does the link come from? In other words, where is your task hosted, and where is the data saved?
This is basically the function of a web server. If you use platforms like Mturk or Prolific, you don’t necessarily need a server, as long as your code can be run on their platform and this is also where the data is saved. However, if you want more control over your experiment and data, you will need a server to host your experiment.
Here comes another question: do I need a server to locally test my experiment? Yes, I used MAMP.
Here are some free online resources for graphic design of your task.
Here are some code examples:
The programming libraries’ websites usually have their own examples as well.
If you use Mturk or Pavlovia, they have their own documents about saving data. Meanwhile, the recruitment platforms usually have a solution for paying participants. If you use your own server, you’ll need to have a chunk of code transferring the data to server.
Resources for Running Developmental Studies Online
Acknowledgement: I learned a lot of the information in this blog from the great tutorials by my previous lab mates and current colleagues. Special thanks to Qixiu Fu and Ili Ma ❤️