Skip to content

waarneembemiddeling/php-google-analytics-cookie-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-google-analytics-cookie-parser

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

About

Parse the Google Analytics _ga cookie to a usable format

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages