waarneembemiddeling / php-google-analytics-cookie-parser
Installs: 9 718
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-12-16 20:41:15 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