In online experiments we often want to dispatch participants randomly to different versions of an test or questionnaire. One simple way to achieve this is to make two different versions of the experiment using Google Forms or something similar, and then use a start page website which randomly selects which of the two to send each person to. Making the start page is very simple: it requires copying and customising a snippet of html code with a tiny bit of javascript.
A free and simple way to make and host the website is with Github Pages. It only takes a few minutes. The steps are as follows:
- Make a GitHub account on https://github.com
- Follow the instructions for making a GitHub Pages website on https://pages.github.com/
- Copy and customise the html code from the index.html file in this repository to the index.html file you created in your new repository. You need to replace the urls in this file with the urls for your different versions of the experiment. You will also want to put in some appropriate introductory text to be displayed to the user.
If my username is evoling and my repository is called sample-ab-test, then the repository url will be https://github.com/evoling/sample-ab-test/ and the automatically generated webpage will be https://evoling.github.io/sample-ab-test/.
Optional
Repositories are visible to the entire world by default. To be able to host private, members only repositories you need to update your account:
- Once you've got a GitHub account you can also get a free student GitHub package from https://education.github.com/pack. You will be required to sign in with your already existing GitHub account, and to provide your mail from the university, e.g.
aabbcc@lingfil.uu.seto prove you are a student).