public function getClientId()
    {
        $clientId = $this->getOption('client_id');
        if ($clientId) {
            return $clientId;
        }

        // collect user specific data
        if (isset($_COOKIE['_ga'])) {
            $gaCookie = explode('.', $_COOKIE['_ga']);
            if (isset($gaCookie[2])) {
                // check if uuid
                if ($this->checkUuid($gaCookie[2])) {
                    // uuid set in cookie
                    return $gaCookie[2];
                } elseif (isset($gaCookie[2]) && isset($gaCookie[3])) {
                    // google old client id
                    return $gaCookie[2] . '.' . $gaCookie[3];
                }
            }
        }

        // nothing found - fallback
        $generateClientId = $this->getOption('client_create_random_id');
        if ($generateClientId) {
            return $this->generateUuid();
        }

        return $this->getOption('client_fallback_id');
    }