R
R
Roman2016-11-14 14:00:21
PHP
Roman, 2016-11-14 14:00:21

How to competently implement the collection of visitor statistics?

According to the conditions, it is necessary to implement the collection of visitor statistics without the use of third-party services.
The first thing that came to mind was the parser of the nginx web server logs by cron and writing data to the database, and then displaying and grouping. It would seem a reliable solution, but the task arose to determine the time the user was on the page, then calculate the average values, determine the support for FLASH, JS, etc.
What are the modules for nginx? to store information about the visitor's country, system distribution, mobile traffic, etc.
Is it possible to set up saving data directly to the database?
To determine some metrics by user actions, js tracking code is required, the question is how to combine this with the nginx log?
Probably the easiest option is to pass server variables, such as an IP address through js tracking code and pull an asynchronous js script in the background, ajax will probably work here.
I would be grateful for advice on linking nginx+php+js+postgresql.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question