Does anyone out there know of a way to detect if a user is about to leave your website, and then take some action?
I am working on a manufacturing companies website, where users can request samples.
We want to detect if they have selected some samples, but are then about to leave the website without having entered their address details.
All suggestions gratefully received.
Jimmy.
Subject: Detecting a user leaving your website
Because the web is an uninstantuated connection we know that you arrived but you could be having coffe, gone to the washroom or just closed your browser. You can use the unload property as previously suggested but that is only on the page and I don’t believe it works in anything other than IE (could be wrong).You can put a time out on the page so that if a person waits to long to respond the connection is no longer valid, but I don’t think this is what you want.
In our Log Analyzer product we just set a maximum idel time between hits to establish the end of a session, but this is an after the fact situation, not a real time response.
I’m not a real web developer so there could be someone out there that has a way to do this, but there are so many different ways a person could leave your site.
Subject: RE: Detecting a user leaving your website
Could be wrong, but you’re not. All we can do server-side is send somebody (an agent) around to pick up the abandoned shopping carts. Anything incomplete that’s more than 24 hours old is fair game.
Subject: Detecting a user leaving your website
Even if you are able to detect when they leave your website, you don’t know whether they may be intending to come back in 30 seconds. Maybe they are handling a interrupting phone call. I would not delete a shopping cart (sample cart) until the end of the day.
Subject: Detecting a user leaving your website
In IE you can use the onbeforeunload event to raise a confirmation dialog, but that’s per-page, not site-wide.