Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to find number of visitors for my website?

 
Gaurav Pravin Dighe
Greenhorn
Posts: 23
Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to find how many visitors visited by website and display it on my website as "Total Number Of Visitor: ####". I am not looking for database approach.

I am thinking of using Listener Classes and Interfaces, but i don't have any idea.

Please help.

 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start by defining what a "visitor" is. It's easy to count how many sessions get created - if your web app creates a session for every visitor. It's also easy to count how many times a particular web page is accessed - but each visitor might access a particular web page more than once. So think about what you want to count as a "visitor".
 
Kartik Mavani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a very open ended question.
Now if you say you just want the counter, define a static variable and keep on incrementing that variable. But if you go via this approach then you will have to take care of the IP addresses from which the request is coming.
The reason that I am saying about the IP addresses is say you hit the index.jsp from your machine 10 times then that should not increment the counter to 10. Perhaps you can look at Google Analytics.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic