It is necessary for self-made crm to find out from which search request the user came to the site (using javascript or php), as well as other additional information.
watched and tried both here . I understood that with $ _SERVER ['HTTP_REFERER'] it will not work, only the address of the site where I came from. For identifying adwords and direct, you can use utm-tags, but this is only a small part of the traffic ...
Google analytics and Yandex metrics are connected to the site, is it possible to extract this information from them somehow? (in real time).
In general, in what way and what can you learn about the user, to transfer this information to crm.