Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What logic is best to use for counting articles read by the same person over time?

I'm planning on storing the number of times an article / page has been viewed in a database. This is so that I can have a list of "most popular posts / articles" in Wordpress.

This was a good thread for similar question: How "View Count" is best implemented?

My question is: A person may view an article multiple times on the same day / week.

What is the industry best practice for counting the number of times an article is read by the same person?

And is there a way to solve multiple users being behind same IP Address?

Update

I'm not after the coding techniques for counting article / post viewes (session, cookies IP address, CGI etc).

I'm just wondering what logic is best to use for counting articles read by the same person over time?

like image 275
Steven Avatar asked Nov 06 '22 07:11

Steven


1 Answers

For anonymous viewing, you can associate an IP address with an individual. For non-anonymous usage, you can use the credentials of a person to make sure that multiple viewings of the same page by the same credentials (i.e., individual) do not result in multiple increments to your view counts.

like image 71
Michael Goldshteyn Avatar answered Nov 09 '22 04:11

Michael Goldshteyn