How to create a simple Analytics for your website like google analytics?

Need very simple solution. Your bike. On the client, only on server through server logs.
Are there any good articles? Habré was not found.

Most importantly-how to identify unique users, have more or less working algorithms? I understand that without the code on the client it will not work to do?
June 14th 19 at 20:21
1 answer
June 14th 19 at 20:23
You can just write to the database all visits by unique sessions. You can save the ip address, user agent, time of visit, the page link where a user is coming from, etc.
I said unique and not just unique session. a unique session-it's just a thing. - tate76 commented on June 14th 19 at 20:26
So you set the COOKIE the user has to restore the same session, if the user came to the site. COOKIE, you will understand that it is not unique already. You can basically write to any COOKIE the tag to verify that the user is already on your site or not. - peter.Armstro commented on June 14th 19 at 20:29
cookies can be removed. or the user can block them.

other options? - tate76 commented on June 14th 19 at 20:32
, then the localstorage, as it makes GA and YandexMetrika. And the best, and there (cookies) and here (localstorage). - Carter commented on June 14th 19 at 20:35
and then still have to send them the last visit? because every day should be considered in new ways. or like better? - tate76 commented on June 14th 19 at 20:38
, localstorage can also be deleted like cookies. This does not insure completely. But you will have a small error, I think it's not so bad. The cookie can be set on the day, and localstorage to record the time of the installation on which to test the day passed or not. - peter.Armstro commented on June 14th 19 at 20:41

Find more questions by tags Web Development