/** * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/v4/Tracker.as#585 * @return string */ protected function generateDomainHash() { $hash = 1; if ($this->tracker->getAllowHash()) { $hash = Util::generateHash($this->tracker->getDomainName()); } return $hash; }
/** * Will extract information for the "trackCount" and "startTime" * properties from the given "__utmb" cookie value. * * @see Internals\ParameterHolder::$__utmb * @see Internals\Request\Request::buildCookieParameters() * @param string $value * @return $this */ public function fromUtmb($value) { $parts = explode('.', $value); if (count($parts) != 4) { Tracker::_raiseError('The given "__utmb" cookie value is invalid.', __METHOD__); return $this; } $this->setTrackCount($parts[1]); $this->setStartTime(new DateTime('@' . $parts[3])); // Allow chaining return $this; }
/** * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/campaign/CampaignTracker.as#153 */ public function validate() { // NOTE: gaforflash states that id and gClickId must also be specified, // but that doesn't seem to be correct if (!$this->source) { Tracker::_raiseError('Campaigns need to have at least the "source" attribute defined.', __METHOD__); } }
/** * @see generateUniqueId * @param int $value */ public function setUniqueId($value) { if ($value < 0 || $value > 0x7fffffff) { Tracker::_raiseError('Visitor unique ID has to be a 32-bit integer between 0 and ' . 0x7fffffff . '.', __METHOD__); } $this->uniqueId = (int) $value; }
/** * @param int $scope */ public function setScope($scope) { if (!in_array($scope, array(self::SCOPE_PAGE, self::SCOPE_SESSION, self::SCOPE_VISITOR))) { Tracker::_raiseError('Custom Variable scope has to be one of the CustomVariable::SCOPE_* constant values.', __METHOD__); } $this->scope = (int) $scope; }