Closed ALTELMA closed 8 years ago
Please refer: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cid
Not sure from where you're trying to access the client ID but that can be set using a random generated UUID. Refer the docs above.
for this "setClientId()" Where can I get it?
Now I get from javascript var clientId = tracker.get('clientId');
I don't know. please example to get it, please.
You don't get that. You need to set a random generated ID. Even the JS version of Google Analytics simply generates a random number for that browser session and stores that in a cookie to send hits later.
Go through the above link i sent you and this one to understand: https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id
So the example would be:
$gamp = GAMP::setClientId( '<randomly generated id>' );
$gamp->setDocumentPath( '/page' );
$gamp->sendPageview();
Sorry for newbie question. I try to get from session or cookie not work. Can you advice me to get it, please.