waarneembemiddeling/php-google-analytics-cookie-parser

1.0.0 2014-06-06 07:38 UTC

This package is not auto-updated.

Last update: 2024-11-18 20:20:10 UTC


README

Build Status Scrutinizer Quality Score

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