Tracking user specific exit links
I want to track exit link of a logged in user. I want to study thei开发者_如何学编程r page navigation according to their demography. I have all the details needed in profile table. I just need to know the exit link. I don't know how to do that. May b with PHP/Mysql/Javascript. And the exit links can be from adsense.
Can u guys put me in right direction ??
FYI: Google analytics and other sites like that can't help coz I need stats of individual user according to his/her userid not of all them combined.
Add an onclick handler for all your links that you consider "exit links". In this onclick handler, send an AJAX request to log the exit link. Depending on the network speed etc. the request might or might not be sent. If you always want it to be sent, prevent the default handler of the link and redirect to the link's target manually after the AJAX request has finished. That's not a good user experience though if the network connection is slow as the link will not react immediately.
Can the unload Event be Used to Reliably fire ajax Request? might also be interesting for you.
精彩评论