That makes sense as far as a starting point. How would I then figure out where they are leaving to?
Main Topics
Browse All TopicsIs it possible to log a user leaving your website and which website they are navigating to? I'm open to any suggestions.
Ideally this will be dynamic as the users will be able to create their own content and put href links in the copy. I am either thinking of a parser that will reinterpret all the href tags into a server call that logs it or some type of IIS component that will do that automatically for me. The server code I am working with is ColdFusion but I will take examples in any language.
Thanks in advance.
-Eric
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Sorry, I didn't really read your question thoroughly. You could log if a user clicks on a link from your site to an external site by generating the links so that the point to a "pass through" template that logs the url they navigated to and then uses cflocation to send them the the external site so your links would look like:
<a href="redirector.cfm?redir
and then in your redirector.cfm file you would have code that logs the value of the url.redirect variable then uses cflocation to send them to the url in url.redirect
OR if you want to do something more difficult you could do it by generating those links in such a way that there is an onclick event that sends the information back to your server via AJAX before redirecting them to the external site
I'm trying to do something similar, I'm trying to track how long users are on my site. I am successfully tracking their entry on to the site with some code in the Session_Start() event in the global.asax file. This is fine. Equivalent code in the Session_End() event to log their exit never runs. From what I've read the Session_End() event only fires if the session times out, it doesnt seem to fire if the user leaves the site and thus ends the session.
The site does not have a log off button where this code could go but even if it did, the user could just hit the top right close button to close IE and I'd need to be able to log that they had left in that way.
Any ideas? I'm stumped!!!
Business Accounts
Answer for Membership
by: SBennettPosted on 2007-11-26 at 13:38:21ID: 20353372
I would make sure to use application.CFC, use session management, and put the logic into the onsessionEnd function.