Skip to content

Instantly share code, notes, and snippets.

@ALTELMA
Last active December 2, 2015 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ALTELMA/3e7b0565120a232f5701 to your computer and use it in GitHub Desktop.
Save ALTELMA/3e7b0565120a232f5701 to your computer and use it in GitHub Desktop.
How to get google client with php by cookie ref https://github.com/waarneembemiddeling/php-google-analytics-cookie-parser
function getGAClient() {
$result = explode('.', $_COOKIE['_ga'], 3);
$count = count($result);
if ($count == 3) {
list($version, $depth, $clientId) = $result;
} else {
return false;
}
return $clienId;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment