How to create a reliable and reliable pageview counter in a web application?

I want to count visits on a web page, and this page is an element of my model, as well as pageviews of the stack overflow question.

How to do it in reliable (one visit, one page view, without repetitions) and reliable (thinking about performance, not just the new attribute of the visit_count table)

+3
source share
3 answers

You can not.

  • Multiple people can visit your site from the same IP address (makes ip storage useless)
  • Several people can access your site from the same PC.
  • ( cookie )

, , IP- , . , cookie, . IP-, , - .

- , - , .

+7

, , Google Analytics. , , , , .

4 000 000 .

http://www.google.com/analytics

+1

- . -

UPDATE stat SET viewcount = viewcount+1 WHERE date = CURDATE()

, .

- . cookie, , cookie ..

0

Source: https://habr.com/ru/post/1703365/


All Articles