How do I assign a unique id for the site visitors?

Hello!
The essence of the problem is as follows:
you need to make indentificator user such as Google Analytics and assign certain results
the visitor comes to the site the first time it must be recorded in the cookie and in the database a unique id, for that would then identify the user (and his next visit is not to write the id) but if the user cleaned the cookies or change the browser, then determine were visited before the user site or not? and if visited use already recorded in the database a unique id, and if not then create a unique id and recorded in database with this id should not be repeated
July 2nd 19 at 14:00
2 answers
July 2nd 19 at 14:02
But if the user cleaned the cookies or change the browser, then determine were visited before the user site or not?

No, but you can ask the user to enter username/password and find it in your DB
and if you write such data as Country, ip, and even something you can compare?? I'm interested in the implementation - alena_Hilll commented on July 2nd 19 at 14:05
perfect of course would be to use the mac address of the machine, but Google replied that it is not real - alena_Hilll commented on July 2nd 19 at 14:08
username/password is impossible, since I need it for logs, I want to assign an id to the user on the website and then when it goes out of the app then that would not create a new user and use the existing - alena_Hilll commented on July 2nd 19 at 14:11
: well, you can make some hash from ip, headers, etc, but it will not work correctly.

If You need to fix the transition from the app to the website, you can add the current id GET parameter, for example. - nicklaus.Will commented on July 2nd 19 at 14:14
you need to make indentificator user such as Google Analytics and assign certain results - alena_Hilll commented on July 2nd 19 at 14:17
: mac address will not give you anything. I like the laptop + home computer + tablet + computer. I turns out - 4 different user? And maybe Vice versa to be from the same computer(and browser) on the Internet sits the whole family. They are - 1 user? - Lucius.Park commented on July 2nd 19 at 14:20
July 2nd 19 at 14:04
There are many chips as possible to identify the user. One with the easiest to identify it in a network. There is also a "black" methods and "white". Many times it was written on Habre.
https://habrahabr.ru/post/312636/
One figure, there is no 100% guarantee that after the user has brushed the cookie or change a browser we will be able to identify him :-)
was looking for something but found nothing =( - alena_Hilll commented on July 2nd 19 at 14:07

Find more questions by tags AnalystPHPWeb DevelopmentMySQLHTTP Cookies