Google Analytics missing __utmz cookie

I have universal analytics installed on my website and you want to parse __utmz cookie to get referral information. However, I never see this cookie set.

Something has changed? Why is this not set?

I see the _ga cookie when I browse my site, and I see the __utmz cookie in the browser cache if I go to other sites.

I checked the docs and see no link to this change recently, so a bit of a dead end.

+6
source share
3 answers

Universal Analytics does not create the __utm * cookie.

However, you can use the Universal Analytics code (analytics.js) and the traditional code (ga.js) simultaneously on your site. This will allow you to fill out your UA profile and clear the values ​​from __utmz.

+8
source

It seems that with Universal Analytics this cookie disappeared and you only get one _ga cookie.

Source: https://developers.google.com/analytics/devguides/collection/analyticsjs/cookie-usage

Also mentioned here: How to get referrer, paid / natural and keywords for the current visitor in PHP using the new Google Analytics?

Also, given that analytics is primarily a tool for collecting aggregated information, I could not find (and I doubt) that there is any way to request GA to get this information, given the _ga cookie.

+3
source

You can create your own cookie and save the query string parameters that Google Analytics uses (utm_campaign, etc.). See this project for an example: https://github.com/dm-guy/utm-alternative

+3
source

Source: https://habr.com/ru/post/953114/


All Articles