Craft\InstantAnalyticsService::_gaParseCookie PHP Method

_gaParseCookie() private method

_gaParseCookie handles the parsing of the _ga cookie or setting it to a unique identifier
private _gaParseCookie ( ) : string
return string the cid
    private function _gaParseCookie()
    {
        if (isset($_COOKIE['_ga'])) {
            list($version, $domainDepth, $cid1, $cid2) = preg_split('[\\.]', $_COOKIE["_ga"], 4);
            $contents = array('version' => $version, 'domainDepth' => $domainDepth, 'cid' => $cid1 . '.' . $cid2);
            $cid = $contents['cid'];
        } else {
            if (isset($_COOKIE['_ia']) && $_COOKIE['_ia'] != '') {
                $cid = $_COOKIE['_ia'];
            } else {
                $cid = $this->_gaGenUUID();
            }
        }
        setcookie('_ia', $cid, time() + 60 * 60 * 24 * 730, "/");
        // Two years
        return $cid;
    }