Pageview implementation

Posted by The Elite Gentleman on Stack Overflow See other posts from Stack Overflow or by The Elite Gentleman
Published on 2010-03-17T10:55:03Z Indexed on 2010/03/17 11:41 UTC
Read the original article Hit count: 313

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?

© Stack Overflow or respective owner

Related posts about web-development

Related posts about Development