waarneembemiddeling / php-google-analytics-cookie-parser
Installs: 9 534
Dependents: 1
Suggesters: 0
Security: 0
Stars: 9
Watchers: 6
Forks: 2
Open Issues: 1
Requires (Dev)
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2024-11-04 20:04:52 UTC
README
Parses the _ga analytics.js cookie to a ParsedCookie result which includes version, depth, client id and timestamp.
Usage
use Wb\GoogleAnalyticsCookieParser\GoogleAnalyticsCookieParser;
$string = 'GA1.2.230657868.1384941727';
$parser = new GoogleAnalyticsCookieParser();
$result = $parser->parse($string);
// Available properties
$result->getVersion(); // Output: GA1
$result->getDepth(); // Output: 2
$result->getClientId(); // Output: 230657868.1384941727
Acknowledgements
- Thanks to Matt Clarke for his research on the analytics.js/_ga cookie format: https://plus.google.com/110147996971766876369/posts/Mz1ksPoBGHx