At the moment we are conducting a survey to study the use of our website. We kindly request you to participate.

This is supposed to represent a host site for Site Survey, that is, a site whose owner has asked for a survey. The Site Survey script is added to every page on this site, and it should work flawlessly.

The following is supposed to happen:

  1. When you arrive at this page, a random is drawn to see if you're included in the survey. (In this example, everybody is, but when the survey is deployed on very busy sites, only half, a quarter, or even a fiftieth of the visitors are selected.)
  2. If you're included in the survey, clicking anywhere on this page opens the Site Survey popup. Note that it stores the URL of the page you're leaving, and not the URL of the page you're entering.
  3. Now you can go through this site, and the popup will keep track of where you're going.
  4. When you leave this site, the popup notices and switches to the questionnaire.
  5. You can close the popup at any time; you won't be bothered any more.

This page also contains a text generated by a script of the site owner. This script may not be disturbed by the Site Survey script.

Leave site. The popup should now switch to the survey.


I set a status cookie to "Yes" when you're selected for the survey (and in this test version every visitor is selected for the survey). At the same time I make sure that the popup is opened as soon as you click on anything.

When you arrive at a page on this site and the cookie already reads "Yes", the script does nothing because it assumes you've already participated in the survey. That means that once you've closed the popup you're never bothered again.

However, in this special case I give you the option to erase the cookie, so that you can try the script again.
Erase cookie.