PDA

View Full Version : Hit counter on homepage?


barnettgs
10-05-2002, 11:48 PM
I am thinking of putting a hit counter on my homepage but the problem is, if people visit other page and then goes back to homepage again, giving hit counter an inaccurate counts? I know about putting counter in 'entance' page but i don't want a entance page to homepage. Any solulation? Thanks

webmarkart
10-06-2002, 09:27 PM
Using a server side language (I use ASP) you can set session variables so that the counter only gets incremented once while the person is on your site. You can set the session to timeout whenever you want, but generally the session doesn't close until the user has closed their browser.

Obviously this would require knowledge of a server side language. If you dont know a SSL then post a question in the SSL section of the forums explaining that you want to build a counter using session variables. All of this assumes that your host supposts the server side language.

webmarkart
10-06-2002, 09:37 PM
I just found this post in the ASP section... http://www.codingforums.com/showthread.php?s=&threadid=7502

This should be all you need as long as your host supports ASP.

murphyz
10-07-2002, 11:17 AM
You can get a free hit counter at http://www.sitemeter.com which allows you to put the counter on one or all of your pages.

If a user visits your site within 30 mins of leaving it won't register as a new hit.

Mxx

starglow
10-08-2002, 05:52 AM
Originally posted by murphyz
You can get a free hit counter at http://www.sitemeter.com which allows you to put the counter on one or all of your pages.

If a user visits your site within 30 mins of leaving it won't register as a new hit.

Mxx

it should do it by IP addy each day... that would be more accurate. dunno how sitemeter works but I think thats how dejacey.com works. it also counts unique/reloads so you can see new users hitting each day and how many reload or come back that day.

barnettgs
10-09-2002, 05:29 AM
Originally posted by murphyz
You can get a free hit counter at http://www.sitemeter.com which allows you to put the counter on one or all of your pages.

If a user visits your site within 30 mins of leaving it won't register as a new hit.

Mxx

Thanks...I have put it in my site and it is looking good so far now

Cheers

murphyz
10-09-2002, 09:22 AM
Just so you are aware, you are able to put either an html or a java version on - which is under their options.

You need to have the java version to be able to see who has referred your site (usually good for seeing what funny google searches lead to your page - my latest was 'cowflip').

Mxx

Alekz
10-09-2002, 10:42 AM
Hi,
A bit off topic, but..

it should do it by IP addy each day...

Bad idea in my opinion...
Unique IP addresses does not mean unique visitors...
Most users have a proxy server and even if the tracker checks te X-forwarded-for header (not always), some proxies will not send this header, so the client IP will be resolved to the proxy server IP. In the other hand suppose You got the X-forwarded-for header and that's a private IP, such as 192.168.... which is the usual case of intranets - You'll have the same IP for different people...
Cookies (could be per session ones) are the most convenient way to detect unique page hits, but even they will produce just an estimate of what happens...
1. some users disable cookies
2. a cookie indentifies the browser, not the person using it, so in a cyber cafe, You'll get the same cookie if the previous user have not closed the browser.

Alex

starglow
10-10-2002, 06:36 PM
Originally posted by Alekz
[B]Hi,
A bit off topic, but..

Bad idea in my opinion...
Unique IP addresses does not mean unique visitors...

I'm aware of that by if it resets daily it's unlikely that a different person on a diff pc visits your site the same exact day with the same exact IP addy. And if it does happen to happen once or twice it's not really that big of a deal. Its much more accurate then if the same person visits your site like 5 times a day but all at least 30 mins apart cos thats gonna count as 5 serperate people.

I never said any counter was totally accurate, I just think having it reset vistors daily or even a few hours inbetween is more accurate then a mere 30 mins!

Akujin
10-23-2002, 09:11 PM
I have been searching the net for a couple of days now trying to figure out a way to code a Hit Counter in Javascript. I can easily do this in Perl or ASP but i do not want to use a Perl or ASP page, i want my page to be in normal HTML format. The problem i run into is that i do not know how to access outside files in Javascript, so i can't just create a file with the number of hit in it and print that to the document.

Is there a way to edit and call from an external file in javascript that i don't know of? Or is there another way to write a hit counter in Javascript?

also, i don't want to use code from another website, i'd like to write this on my own so don't bother telling me to download a hit counter from another website.

If anyone can help with this i'd be glad to share my knowlege of whatever you wish in return.

Nightfire
10-23-2002, 09:43 PM
STOP CROSSPOSTING