Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: finding out if a user left our website ?

2 views
Skip to first unread message

Martin Zvarík

unread,
Aug 27, 2010, 9:17:57 AM8/27/10
to php...@lists.php.net
Dne 25.8.2010 22:32, Vinay Kannan napsal(a):
> Hello Guys,
>
> Wanted to know if there is a way for us to find out, when a user moves away
> from our website( closing the window and entering a different url in the
> address bar )
>
> closing the window i guess, we could use the javascript onclose or something
> similar but for the user moving away from my website by entering a different
> URL is what i would like to be able to find out.
>
> Thanks,
> Vinay
>

Hi,
you can use: window.onunload function()

In this function you can add an AJAX that sends a server request that
the user left.

I used it for administration and it worked in 80% of cases - sometimes
the request is just not sent.


Martin

Vinay Kannan

unread,
Aug 27, 2010, 2:16:05 PM8/27/10
to kesavan trichy rengarajan, PHP DB
Thank you everyone window.onunload() function works perfect, thats what I
was looking for !!

Thanks,
Vinay Kannan.

On Thu, Aug 26, 2010 at 3:24 AM, kesavan trichy rengarajan <k...@trk7.com>wrote:

> Have a look at this: https://developer.mozilla.org/en/DOM/window.onunload
>
> <https://developer.mozilla.org/en/DOM/window.onunload>But, as someone
> pointed out a few days ago, please do not post stuff that is not related to
> PHP DB.

0 new messages