• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to track visitors?

 
Daniil Sosonkin
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm at a lost. I need to track visitors who come to the site (IP, referer, browser, etc...) but I'm not sure how to do that in the best way. I thought of tracking unique visitor when a new session is created, but it seems to be impossible to get visitor's info when using SessionListener. But how else to am I suppose to get user's info whenever a new session is created?

Does anyone have any idea how to do tracking? Maybe someone can share their experience.

Help would be appreciated

D.
 
rick zorich
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at this to get started.
http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_20514811.html
Be sure to read Kenneth's final suggestions.
 
rick zorich
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be nice if you posted your final code here.
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would look for a free web log analyzer to do that kind of thing. My site uses webalizer and I like it.

http://www.mrunix.net/webalizer/
 
Daniil Sosonkin
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to have live charts so webalizer won't help.

Thanks for the link, rick, sounds like a plan! I'll be working on it today and place results here.
 
Daniil Sosonkin
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I've worked it out and now able to track visitors. Thanks for direction. The code is below. It only tracks and doesn't count current visitors (for that I have a SessionListener). Visits are stored in the database and allow for tracking of what visitor actually went through. This assumes that new session is a new visitor (maybe not entirely correct, but I just can't think of anything better). Enjoy:

Tracker.java (filter)
===============================



web.xml
==========================================
<filter>
<filter-name>Tracker</filter-name>
<filter-class>com.fototalk.filters.Tracker</filter-class>
</filter>

<filter-mapping>
<filter-name>Tracker</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
 
rick zorich
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daniil, thanks for sharing. rick
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!