0

Hi ,

In one of my web application I want a real visitor count. I am not looking for any third party one. Also I want to know visitors are from which country ?

I wrote a code and that will add in database when each page visit. But if the user refresh the page then also that will add a visit. Really "How real visitor counts are calculating ?" My question is

1. If a user visits my page in morning and it will added into database. After 2 or 3 hours the same visitor visits again.. Then is it count as new visit or ignore that visit and only calculate only one visit per day from a IP address....

I am sorry for my bad grammar and I am expecting good advises
Thanks in advance
Rajeesh

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by rajeesh_rsn
0

Use cookies or sessions. Just as a user visits the page, create a cookie with an expiry of one day. if the cookie exits implies that the visitor has already visited.

0

An alternative approach would be in mySQL's end; if you are familiar with using table indexes, then you might already know that it's possible to make multiple fields into a single index. This would allow you to have... say a field in the table named "ip" and another called "date"; you could then make a UNIQUE index combining those two fields, which means mySQL won't insert the record again if there is already a record that has the combined ip/date index.

0

Use cookies or sessions. Just as a user visits the page, create a cookie with an expiry of one day. if the cookie exits implies that the visitor has already visited.

Hi thanks for the reply and I just wanna know about the real logic behind the visitor count. In which logic google and other ranking sites calculating our visitor count per day ...

Thanks
Rajeesh

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.