I want to track the usage of an API. So I'm using Zend_Http_Client to send POST-parameters to Google Analytic's collector. The Google developers-page tells me, that I have to send a cid
(Anonymous Client ID). But how can I send it via PHP when it is part of the _ga-cookie
?
Am I supposed to create my own cid
? Or am I just too dumb to understand the manual?
Thanks!
All of the parameters sent directly through the Measurement protocol must be created by you.
Client ID / Cid
This anonymously identifies a particular user, device, or browser instance. For the web, this is generally stored as a first-party cookie with a two-year expiration. For mobile apps, this is randomly generated for each particular instance of an application install. The value of this field should be a random UUID (version 4) as described in http://www.ietf.org/rfc/rfc4122.txt
I normally use a GUID for this. There appears to be a PHP-function that does this: com_create_guid or maybe uniqid
Anwsers:
TIPs: