Skip to content

Instantly share code, notes, and snippets.

View vishwapriyanatha's full-sized avatar

B.A.Vishwa Priyanatha vishwapriyanatha

View GitHub Profile
@vishwapriyanatha
vishwapriyanatha / README.md
Created April 3, 2018 06:45 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@vishwapriyanatha
vishwapriyanatha / server-side-ga-events.php
Created October 27, 2021 09:49 — forked from chrisblakley/server-side-ga-events.php
PHP functions to send data to Google Analytics
//Parse the GA Cookie
function gaParseCookie() {
if (isset($_COOKIE['_ga'])) {
list($version, $domainDepth, $cid1, $cid2) = explode('.', $_COOKIE["_ga"], 4);
$contents = array('version' => $version, 'domainDepth' => $domainDepth, 'cid' => $cid1 . '.' . $cid2);
$cid = $contents['cid'];
} else {
$cid = gaGenerateUUID();
}
return $cid;