Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Implement a Reliable Web Page Counter?

Tags:

counter

What's a good way to implement a Web Page counter?

On the surface this is a simple problem, but it gets problematic when dealing with search engine crawlers and robots, multiple clicks by the same user, refresh clicks.

Specifically what is a good way to ensure links aren't just 'clicked up' by user by repeatedly clicking? IP address? Cookies? Both of these have a few drawbacks (IP Addresses aren't necessarily unique, cookies can be turned off).

Also what is the best way to store the data? Increment a counter individually or store each click as a record in a log table, then summarize occasionally.

Any live experience would be helpful,

+++ Rick ---

like image 525
Rick Strahl Avatar asked Jul 29 '09 17:07

Rick Strahl


People also ask

How do I count visitors to my website?

Google Analytics (GA) is the standard for measuring website traffic. GA provides an amazing amount of data and is the best way to count website visits for curiosity and to measure results of marketing efforts.

What is page counter?

Essentially, a page counter is the same thing as a hit counter: a line of code and a graphic device used to display the number of visitors who have viewed a page on your site. A page counter only measures and presents statistics for the page it is installed on.


1 Answers

Use IP Addresses in conjunction with Sessions. Count every new session for an IP address as one hit against your counter. You can store this data in a log database if you think you'll ever need to look through it. This can be useful for calculating when your site gets the most traffic, how much traffic per day, per IP, etc.

like image 170
Mike Trpcic Avatar answered Feb 12 '23 15:02

Mike Trpcic