Skip to content

Instantly share code, notes, and snippets.

@susanBuck
Created October 14, 2025 19:53
Show Gist options
  • Select an option

  • Save susanBuck/a652e12a97fe9dfdbaba7b6c23e2d5bb to your computer and use it in GitHub Desktop.

Select an option

Save susanBuck/a652e12a97fe9dfdbaba7b6c23e2d5bb to your computer and use it in GitHub Desktop.
Embed jsPsych experiment in Qualtrics via iframe

Embed your jsPsych experiment in a Qualtrics survey

Using a HTML iframe element, you can embed your jsPsych experiment directly in a question within your Qualtrics survey - E.g.:

<iframe 
    src='https://susanbuck.github.io/psy1903/projects/lexical-decision/?qualtricsId=${e://Field/ResponseID}' 
    id='experimentEmbed'>
</iframe>

CSS to style the iframe:

#experimentEmbed {
    width: 100%;
    height: 500px;
}

Observe how just like with the link, we’re attaching a Qualtrics ID that can be attached to the experiment results (see code from the above example) so we can make the connection between the survey and the experiment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment