* @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) */ namespace UnitedPrototype\GoogleAnalytics\Internals\Request; use UnitedPrototype\GoogleAnalytics\SocialInteraction; class SocialinteractionRequest extends PageviewRequest { /** * @var \UnitedPrototype\GoogleAnalytics\SocialInteraction */ protected $socialInteraction; /** * @return string */ protected function getType() { return Request::TYPE_SOCIAL; } /** * @return \UnitedPrototype\GoogleAnalytics\Internals\ParameterHolder */ protected function buildParameters() { $p = parent::buildParameters(); $p->utmsn = $this->socialInteraction->getNetwork(); $p->utmsa = $this->socialInteraction->getAction(); $p->utmsid = $this->socialInteraction->getTarget(); if($p->utmsid === null) { // Default to page path like ga.js, // see http://code.google.com/apis/analytics/docs/tracking/gaTrackingSocial.html#settingUp $p->utmsid = $this->page->getPath(); } return $p; } /** * @return \UnitedPrototype\GoogleAnalytics\SocialInteraction */ public function getSocialInteraction() { return $this->socialInteraction; } /** * @param \UnitedPrototype\GoogleAnalytics\SocialInteraction $socialInteraction */ public function setSocialInteraction(SocialInteraction $socialInteraction) { $this->socialInteraction = $socialInteraction; } } ?>