Пример #1
0
 /**
  * Get the search medium.
  *
  * @return mixed
  */
 public function getMedium()
 {
     if ($this->isKnown()) {
         return $this->referer->getMedium();
     }
     return null;
 }
 /**
  * @return null|string
  */
 public function getDescription()
 {
     if ($this->isGoogleOrganic()) {
         return 'Google Orgânico';
     } elseif ($this->isGoogleAds()) {
         return 'Google Ads';
     } elseif ($this->isGoogleCampaign()) {
         return 'Google Campanha';
     } elseif ($this->isExternalSearch()) {
         return $this->parsedUrl->getMedium() . ': ' . $this->parsedUrl->getSource();
     } elseif ($this->isExternalUnknownSource()) {
         $sourceUrl = parse_url(\Yii::$app->request->referrer);
         $sourceUrl = $sourceUrl['scheme'] . '://' . $sourceUrl['host'];
         return 'Site Externo: ' . $sourceUrl;
     } else {
         return 'Acesso Direto';
     }
 }