Answer the question
In order to leave comments, you need to log in
How to get user id from Google Analytics and Yandex.Metrika?
I need to identify a user on a site. Options with IP or cookies (etc.) are good, but almost all have dynamic IPs and different browsers.
I learned about such a thing as user id (Google Analytics) and yandexuid (Yandex.Metrika).
If I understand correctly, the user id is _gid (or _ga?) in cookies. Why is this key always different on different sites?
Everything is easier with yandexuid, when working from one browser everything is ok, but it's worth adding another one - the key is different. Why doesn't it combine information about two devices, etc.?
How can I get the data I need? What other options are there for implementing such analytics? How do you solve such problems?
Answer the question
In order to leave comments, you need to log in
I found a more universal way - I hang a script on all pages that creates an iframe into which parameters are passed, in the iframe the page in PHP receives parameters from the GET script, completes their IP, generates my ID and saves it to the database.
Thus, it is possible to record the routes of any user even before he has registered, in most situations it turns out to match the data even if the user logged in from another browser or cleared the cache.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question