Parsing __utmz tracking cookie to get referral

久未见 提交于 2019-12-04 04:26:12
Joao Correia

Check my Google Analytics Cookie Parser.

Google Analytics PHP Cookie Parser is a PHP Class that you can use to obtain data from GA cookies such as campaign, source, medium, etc. You can use this parser to get this data on your contact forms or CRM.

Just updated to version 1.2 with minor bugfixes and more info, number of pages viewed in current visit.

You could use $_SERVER['HTTP_REFERER'] to get the Referer.

Overall it is a bad idea to use other's people's cookies to get data unless you know exactly how they work, and when they update, or you use an API that THEY have made available.

Lets say the Google decides to revamp the cookie altogether so that the Referer information isn't available on the cookie, your system would break. It is best to get data directly from your own sources rather than someone else's.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!