Hi everyone
I want to add a pageview feature on my current web application. This page view is based on the count of user viewing the page. It must be unique, i.e. I must not view a person's page 10000 times and record it as 10000 views, just record 1 view instead.
My question is, should I base my pageview count on IP address? If not, what is/are the best approach in doing this?
I know that if the person has logged in to my system, I can simply use the user id stored in the session and check on the record if the user has/hasn't viewed the page and update accordingly. But for "anonymous" viewers, what is the best approach?
Thanks.
PS How does Youtube does it?
After reading most of the comment here, I'm still not sure if the solution provided will help. Take a typical example: Youtube videos. They store pageviews in a persistent storage and they make sure that it doesn't record the same user twice. If there are anonymous viewers, it (somehow) makes sure that (I know it's not full proof, or is it) the anonymous viewer updates the pageview counts once. It can do it via cookie (but what if you delete it) or via IP address (but that won't help if you're sitting behind company firewall). Is there other strategy that can best help with this?
PS Especially for user pageview (i.e. your youtube account), it can tell how many viewers who viewed your profile. Does that have another approach to getting pageview?