Social behavioral science studies how people think, feel and act in relation to others: conformity, cooperation, prejudice, persuasion, group identity. Historically this research needed a room full of confederates. A surprising amount of it now runs in a browser, because the key ingredient is usually information about other people rather than their physical presence. This guide covers the paradigms that translate well online, the ones that have run into trouble, and the ethical and practical details of running them on a platform such as Cognition.
Conformity. In Solomon Asch's line-judgment studies (1951, 1956), participants gave a clearly wrong answer on about a third of critical trials when a group of confederates had done so first. Online adaptations replace the live confederates with displayed "previous responses" from supposed other participants, and measure whether judgments shift toward them. Effects are generally smaller than in the original face-to-face setting, which is itself informative about what drives conformity.
Economic games with simulated partners. Trust, ultimatum, dictator and public goods games can be run with pre-recorded decisions from earlier participants or with programmed partners. This allows full control over the partner's behavior (fair, unfair, reciprocating) at the cost of some realism, and it raises the deception questions discussed below.
Implicit Association Test. The IAT (Greenwald, McGhee and Schwartz, 1998) measures the reaction-time cost of pairing categories (for example, flowers with unpleasant words) relative to the opposite pairing. It is a keyboard-response task and runs well in jsPsych, which includes dedicated IAT plugins. Its interpretation is disputed: test-retest reliability is moderate, and meta-analyses (Oswald et al., 2013, among others) find weak correlations between IAT scores and discriminatory behavior. It is best treated as a measure of association strength rather than a diagnosis of individual bias.
Vignettes and scales. Much of social psychology manipulates a short scenario (the target person's group membership, the framing of a request) and measures attitudes on Likert-type scales. These studies depend on text and rating scales only and lose nothing online. Randomizing vignette assignment and item order is essential.
Social priming. Studies claiming that subtle cues (words related to old age, a briefcase on the desk) change subsequent behavior were central to the replication crisis. Doyen, Klein, Pichon and Cleeremans (2012) failed to replicate the elderly-priming walking-speed effect of Bargh, Chen and Burrows (1996), and found that the experimenters' expectations, not the prime, predicted participants' walking speed when they were manipulated. Many similar effects have since failed in large preregistered replications. If you run a priming study, preregister it and power it properly.
The following trial presents three items after a vignette and records a response to each. Item order is shuffled per participant.
const jsPsych = initJsPsych();
const agreement = [
"Strongly disagree", "Disagree", "Neutral", "Agree", "Strongly agree"
];
const vignette = {
type: jsPsychHtmlButtonResponse,
stimulus: "<p>Alex found a wallet with $200 and handed it in at the police station.</p>",
choices: ["Continue"],
data: { task: "vignette", condition: window.CONDITION }
};
const ratings = {
type: jsPsychSurveyLikert,
preamble: "<p>Please rate your agreement with each statement.</p>",
questions: [
{ prompt: "Alex is an honest person.", name: "honest", labels: agreement, required: true },
{ prompt: "I would trust Alex with my belongings.", name: "trust", labels: agreement, required: true },
{ prompt: "Most people would have done the same.", name: "norm", labels: agreement, required: true }
],
randomize_question_order: true,
data: { task: "ratings", condition: window.CONDITION }
};
jsPsych.run([vignette, ratings]);
The Likert trial stores responses as an object keyed by name, with values from 0 to 4, along with the question order used for that participant. window.CONDITION is populated by Cognition when you configure between-subject conditions, so you can vary the vignette (for instance, Alex's stated nationality or the amount of money) by condition and have the assignment balanced on the server.
Deception and debriefing. Simulated partners, fake "previous responses" and cover stories are deception. The APA Ethics Code permits deception only when the study's value justifies it, no non-deceptive alternative is feasible, and participants are debriefed as early as possible. Online, debriefing means a final screen that explains the deception plainly, gives contact details, and offers the option to withdraw data. Build this into the timeline rather than into an email you send later; many participants will not read the email.
Informed consent. Remote participants must see the same information they would receive in the lab: purpose, duration, risks, compensation, data handling, and the right to stop. Cognition lets you write the consent text in markdown and sends participants who decline to a URL you specify, so they never reach the task and no data is recorded for them.
Sensitive content and data. Studies on prejudice, politics or trauma can produce identifiable or sensitive responses. Collect only what you need, avoid free-text fields where a rating will do, and store data in a jurisdiction your ethics board accepts. Cognition offers a choice of storage region (United States, European Union or Asia-Pacific) on paid plans, uses HTTPS throughout, and supports multi-factor authentication on researcher accounts.
To host the example, create a free account, paste the code into the editor with jsPsych 8.2.3 selected, set the number of between-subject conditions, write the consent text, and share the https://<token>.cognition.run link. Every response is saved to the server as soon as it is given, URL parameters such as PROLIFIC_PID are attached to every row (see the Prolific, SONA and MTurk guide), single-use links prevent repeat participation, and the data can be downloaded as CSV or JSON. Collaborators with viewer, editor or owner roles can be added per task, which is useful when a supervisor needs to review the materials before launch. The documentation covers conditions and consent configuration in detail.