Creating an exit survey that pops up when user leaves site

Options

Hi,

We would like to survey our users and ideally would like the survey to appear when a user leaves our site.  Anyone have advice about how to do this?  Is there a simple script I can use?

Thanks,

Colleen

Tagged:

Comments

  • You could do something like this. I think though the problem would be making sure they weren't going to another page on your site, and I don't know if you'd want to ask everyone... which makes things a little more complicated. You might have to track what link they clicked (if any -- they may just be closing the browser)

    There is also the event on beforeunload

    <script language="javascript">

    function UnloadTrigger(pop) {

    if (!pop) {

         if (confirm("Are you interested in taking a survey. If yes click ok, if no, click cancel")) {

              window.open("http://action.sierraclub.org", "survey")

         } else {

         }

    }

    }

    window.onunload = UnloadTrigger;

    </script>

    For controlling if everyone gets it or not, you could just test a random number, and a certain percentage of time, throw up the confirmation box.

    For checking the website, knowing whether they are leaving your site or not... one could manipulate all one's links so that that a flag is set when a link is clicked and its an internal link versus external. But you also have to worry about forms and things like that.

    If you google around survey script... you'll find there's a whole bunch of different methods out there.

Categories