Answer the question
In order to leave comments, you need to log in
How do I assign a unique id to site visitors?
Hello!
The essence of the task is as follows:
you need to make a user identifier like Google Analytics and assign certain results to it, a
visitor comes to the site for the first time, he must be recorded in cookies and in the database with a unique id, in order to then identify the user, (and on his next visit not write id) but if the user cleared the cookies or changed the browser, how then to determine whether the user visited the site before or not? and if visited, then use the unique id already recorded in the database, and if not, then create a unique id for it and write it to the database, while the id should not be repeated
Answer the question
In order to leave comments, you need to log in
But if the user cleared the cookies or changed the browser, how then to determine whether the user has visited the site before or not?
There are many tricks on how to identify a user. One of the simplest is to identify it in some network. There are also "black" methods and "white" ones. Many times it was written on Habré.
https://habrahabr.ru/post/312636/
One fig, there is no 100% guarantee that after the user has cleared cookies or changed the browser, we will be able to identify him :-)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question