views:

37

answers:

1

I am trying to alert the user when they leave the shopping page with cart filled up. And also get feedback or the reason for their exit.

I need to get event source id because to know whether they exit my site or navigate by clicking a link in my page.

Any one help me on this...

+2  A: 

It's not possible. You should be able to catch if the user clicked a link to leave the page by manually setting up a listener event on each of them, but the browser does not give you any information about what led to the unload event. If it was an event ouside the document ("Back" button etc.), you're out of luck.

Pekka