예제 #1
0
 /**
  * @return \UnitedPrototype\GoogleAnalytics\Internals\ParameterHolder
  */
 protected function buildParameters()
 {
     $p = new ParameterHolder();
     $p->utmac = $this->tracker->getAccountId();
     $p->utmhn = $this->tracker->getDomainName();
     $p->utmt = $this->getType();
     $p->utmn = Util::generate32bitRandom();
     $p->aip = $this->tracker->getConfig()->getAnonymizeIpAddresses() ? 1 : null;
     // The IP parameter does sadly seem to be ignored by GA, so we
     // shouldn't set it as of today but keep it here for later reference
     // $p->utmip = $this->visitor->getIpAddress();
     $p->utmhid = $this->session->getSessionId();
     $p->utms = $this->session->getTrackCount();
     $p = $this->buildVisitorParameters($p);
     $p = $this->buildCustomVariablesParameter($p);
     $p = $this->buildCampaignParameters($p);
     $p = $this->buildCookieParameters($p);
     return $p;
 }
예제 #2
0
 /**
  * @return \UnitedPrototype\GoogleAnalytics\Internals\ParameterHolder
  */
 protected function buildParameters()
 {
     $p = new ParameterHolder();
     $p->utmac = $this->tracker->getAccountId();
     $p->utmhn = $this->tracker->getDomainName();
     $p->utmt = $this->getType();
     $p->utmn = Util::generate32bitRandom();
     // The "utmip" parameter is only relevant if a mobile analytics
     // ID (MO-123456-7) was given,
     // see http://code.google.com/p/php-ga/issues/detail?id=9
     $p->utmip = $this->visitor->getIpAddress();
     $p->aip = $this->tracker->getConfig()->getAnonymizeIpAddresses() ? 1 : null;
     if ($p->aip) {
         // Anonymize last IP block
         $p->utmip = substr($p->utmip, 0, strrpos($p->utmip, '.')) . '.0';
     }
     $p->utmhid = $this->session->getSessionId();
     $p->utms = $this->session->getTrackCount();
     $p = $this->buildVisitorParameters($p);
     $p = $this->buildCustomVariablesParameter($p);
     $p = $this->buildCampaignParameters($p);
     $p = $this->buildCookieParameters($p);
     return $p;
 }