Tracking Users with a Serverlet -- Need help
OK, I really need help with this one. First, the problem: I need to be able to track where users go on our site, and depending upon the number of pages they visit before leaving, They will recieve one of three or four questionnaires.
Second problem: Obviously, the easiest way to do this would be by using a cookie, and having every page click a counter in the cookie. Unfortunately, most of our users are Organizations that do not accept cookies. Also, our site has over 1,100 public pages, and adding javascript to every page would be a pain.
I figured the best way would be to run a serverlet that opens a new thread whenever a user connects. At most there would be 100 threads open at any given time. While the user is connected, the thread would store every URL the user goes to in a Vector. If the URL does not begin with our domain name, then it will open one of the questionnaires, and close the Thread.
Please let me know if this is possible, and if so, how would I go about doing it.
Thanks
RC
[1041 byte] By [
rchargel] at [2007-9-27 19:11:34]

I'm assuming you have some sort of authentication so that your users have to sign in, right? Otherwise, how are you going to know when they return?
Anyway, to do what you're trying to do, you could set a db with a table with 2 columns, user and pages. You pass the pages the user has been to by using a request variable, and then save the value with every new page request.
Unfortunately, we do not use logins. What we are trying to do is give them the survey before they leave our site, not when they return. Basically, I wanted to see if there was a way to see if the URL they are requesting is not ours, and if not, to throw up the survey and close the Thread
Nothing you do on your server will help you tell when the user goes to some other URL. The browser won't tell you that because it's none of your business. You could perhaps use some Javascript on your page, but I can't guarantee that because I'm no Javascript expert.
Have you considered that this is a good way to annoy your users? Put yourself in their place: you have just been using somebody's site. You try to go to Hotmail to get your e-mail, but instead of going there you're sent somewhere else to fill in some stupid survey...