Example #1
0
 /**
  * We have previously tried to detect the campaign variables in the URL
  * so at this stage, if the referer host is the current host,
  * or if the referer host is any of the registered URL for this website,
  * it is considered a direct entry
  * @return bool
  */
 protected function detectRefererDirectEntry()
 {
     if (!empty($this->refererHost)) {
         // is the referer host the current host?
         if (isset($this->currentUrlParse['host'])) {
             $currentHost = mb_strtolower($this->currentUrlParse['host'], 'UTF-8');
             if ($currentHost == mb_strtolower($this->refererHost, 'UTF-8')) {
                 $this->typeRefererAnalyzed = Piwik_Common::REFERER_TYPE_DIRECT_ENTRY;
                 return true;
             }
         }
         if (Piwik_Tracker_Visit::isHostKnownAliasHost($this->refererHost, $this->idsite)) {
             $this->typeRefererAnalyzed = Piwik_Common::REFERER_TYPE_DIRECT_ENTRY;
             return true;
         }
     }
     return false;
 }