Page 1 of 2

how can we get the no of hits of our site

Posted: Wed Aug 15, 2007 2:17 pm
by djdon11
Hi friends ..

i want to know that how we can show the no. of visits of our sites means how many times our site has been visited by users , i want to show this numbers in the title bar ....

Posted: Wed Aug 15, 2007 2:20 pm
by thiscatis
Statscounter.com is a free counter,
With some tweaking you can get the javascript in your heading too.

Posted: Wed Aug 15, 2007 2:36 pm
by miro_igov
I believe by logging every hit in a database. If you need to log only unique hits you should compare the client IP.

@thiscatis this counter does not give the stats as PHP value.

Posted: Wed Aug 15, 2007 3:48 pm
by superdezign
miro_igov wrote:I believe by logging every hit in a database. If you need to log only unique hits you should compare the client IP.
... Or, more reliably, create a session.

Posted: Wed Aug 15, 2007 3:57 pm
by feyd
Count them.. analyze your access logs... there's a myriad of ways.

Posted: Thu Aug 16, 2007 4:06 am
by miro_igov
superdezign wrote:
miro_igov wrote:I believe by logging every hit in a database. If you need to log only unique hits you should compare the client IP.
... Or, more reliably, create a session.
Sessions are much unreliable than IPs. It is simpler to delete cookies than change ip.

Posted: Thu Aug 16, 2007 4:11 am
by jmut
miro_igov wrote:
superdezign wrote:
miro_igov wrote:I believe by logging every hit in a database. If you need to log only unique hits you should compare the client IP.
... Or, more reliably, create a session.
Sessions are much unreliable than IPs. It is simpler to delete cookies than change ip.
Why would anyone want to delete a cookie? it is not something you will benefit like breach security or something. And IPs can legally change on each request.

Posted: Thu Aug 16, 2007 4:17 am
by miro_igov
Imagine some of these sites who webmasters enter their links and people vote. If the uniqueness of the visit is kept in cookie guess the benefit.

Posted: Thu Aug 16, 2007 4:30 am
by jmut
miro_igov wrote:Imagine some of these sites who webmasters enter their links and people vote. If the uniqueness of the visit is kept in cookie guess the benefit.
not sure I understand what you mean...session is used to create unique visit...not counting on each refresh of page.
Of course that might not be the goal...

Posted: Thu Aug 16, 2007 4:35 am
by miro_igov
jmut wrote:session is used to create unique visit..
Totally wrong. What happens when you delete your cookies? Session is destroyed. What will cause another visit? Increment the counter (another unique visit).

Maybe you do not know that session identifier is client-side attribute and could be manipulated?

Posted: Thu Aug 16, 2007 5:33 am
by jmut
And here we come to my first comment. why would anyone want to change/manipulate such data? It is not any security risk and client will not get any real benefit of faking unique visits.

Just don't tell me unique visits are better implemented based on IP address.
Cause in case of cookie it should be intentional while with using ip address...it can be wrong without intention.

Posted: Thu Aug 16, 2007 6:02 am
by superdezign
@miro_igov The use of IP addresses as an identifier for users is unreliable. Your argument that sessions are less reliable isn't a correct one. Users can restart a session, but the user likely will not, especially if the site has any sort of user system. Secondly, the only real invalid data you'd get from the use of sessions is that there are users that do not have cookies enabled. Those users would not be counted.

What would you do for user's who have blocked their IP from you, or who's IP changes per-request? It isn't an issue of opinion, but of practicality. Basing a hit counter on uniqueness can never be totally accurate, as we can't force users to identify themselves as such. It's a matter of using a method that is most likely to return near-accurate results.

Posted: Thu Aug 16, 2007 6:20 am
by miro_igov
jmut wrote:And here we come to my first comment. why would anyone want to change/manipulate such data? It is not any security risk and client will not get any real benefit of faking unique visits.

Just don't tell me unique visits are better implemented based on IP address.
Cause in case of cookie it should be intentional while with using ip address...it can be wrong without intention.
Did you read about the site ranking service i posted above? If the site rating is based on sessions user will abuse the results voting 1000 times, that is the benefit of manipulating cookies.

@Superdizi "who have blocked their IP from you" are you talking about proxies? Is this not a method of uniques - no one will abuse with the same proxy IP if it's already used.

Posted: Thu Aug 16, 2007 6:30 am
by superdezign
miro_igov wrote:@Superdizi "who have blocked their IP from you" are you talking about proxies? Is this not a method of uniques - no one will abuse with the same proxy IP if it's already used.
That's hardly the issue. The real problem is not counting users multiple times as opposed to users that don't get counted at all.

Posted: Thu Aug 16, 2007 10:27 am
by The Phoenix
Please, PLEASE read Analog's explanation of how the web works. It tells you everything you need to know about what you can (and more importantly, what you cannot) reliably measure.

At best, you can reliably measure the number of requests. There are a huge number of tools for doing so (including analog), and numerous php based free/open solutions.

Hope that helps.