Random redirector

This tool is similar to the wide range of URL shorteners out there e.g. goo.gl, tiny.cc, bit.ly etc., except that the shortened URL will send you to one of two survey-based links at random. I couldn’t find anything like this out there when I searched (but I may have been using the wrong search words!) which is why I set up this tool. [Edit: Scroll down to the bottom to learn how to set up your own random redirects using Google App Scripts]

It is useful in particular for online experiments, where you want to send participants to one of two different pages (e.g. a Google survey) without them necessarily being aware of this randomisation process. To setup the URL, head to allocate.monster and follow the instructions on the page.

Due to abuse of this tool by dodgy folk, only links with domains on the approved list will now be accepted! Please complete this form to request a domain to be added to the approved list, but don’t expect any new additions to happen any time soon (this is a free tool remember and was created for simple classroom-based randomised experiments with Google forms).

Any random redirect URLs created using this tool can be disabled at any time. If this has happened to you and you are a legitimate teacher, educator or researcher, then send me an email and I might be able to help you.


Want to set up your own random redirects without using my tool?

Awesome! Here is something you could do using Google App Scripts.

Approach one (doesn’t work on some mobile phones)

  1. Under Google Drive, create a new Google Apps Script (you might have to look under “More” after you click the “New” button).
  2. Give your project a name e.g. Random redirect
  3. In the Code.gs tab, delete what is there and replace with this code.
  4. Replace the links to the Google forms with your own 🙂
  5. Save the project then select “Deploy as web app” from the “Publish” menu. Under “Who has access to the app” select “Anyone, even anonymous”.

You should then get a “Current web app URL:” that looks something like this: https://script.google.com/macros/s/AKfycbwu_Fv8gGGbzMCqot1e1-u8TereYJ9uJVfIMw02NxNUTj9WNII/exec

You can then give people this URL (or use a URL shortener first to make it look nicer e.g. bit.ly, tiny.cc or embed it in an existing webpage), and it will randomly redirect them to one of the Google forms you’ve added to the code.

Approach two

Is very similar to approach one,  and the Index.html file can be used independently of Google Apps Script 🙂

  1. Under Google Drive, create a new Google Apps Script (you might have to look under “More” after you click the “New” button).
  2. Give your project a name e.g. Random redirect
  3. In the Code.gs tab, delete what is there and replace with this code.
  4. Create a new HTML file using the File menu, and call this “Index.html”. Delete what is there and replace with this code.
  5. Replace the links to the Google forms in the Index.html code with your own 🙂
  6. Save the project then select “Deploy as web app” from the “Publish” menu. Under “Who has access to the app” select “Anyone, even anonymous”.

You should then get a “Current web app URL:” that looks something like this: https://script.google.com/macros/s/AKfycbw0WK1Ih65H9YoEJqnmrE7-uOpozkMdLrg0577kzAwek4dcyWqp/exec

You can then give people this URL (or use a URL shortener first to make it look nicer e.g. bit.ly, tiny.cc or embed it in an existing webpage), and it will randomly redirect them to one of the Google forms you’ve added to the code.

You can also just use the code for the Index.html file by itself without Google Apps Script.