当前位置: 首页>>代码示例>>PHP>>正文


PHP UrlHelper::extractSearchEngineInformationFromUrl方法代码示例

本文整理汇总了PHP中Piwik\UrlHelper::extractSearchEngineInformationFromUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP UrlHelper::extractSearchEngineInformationFromUrl方法的具体用法?PHP UrlHelper::extractSearchEngineInformationFromUrl怎么用?PHP UrlHelper::extractSearchEngineInformationFromUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik\UrlHelper的用法示例。


在下文中一共展示了UrlHelper::extractSearchEngineInformationFromUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testExtractSearchEngineInformationFromUrl

 /**
  * @dataProvider getSearchEngineUrls
  * @group Core
  */
 public function testExtractSearchEngineInformationFromUrl($url, $engine, $keywords)
 {
     $this->includeDataFilesForSearchEngineTest();
     $returnedValue = UrlHelper::extractSearchEngineInformationFromUrl($url);
     $exptectedValue = false;
     if (!empty($engine)) {
         $exptectedValue = array('name' => $engine, 'keywords' => $keywords);
     }
     $this->assertEquals($exptectedValue, $returnedValue);
 }
开发者ID:ahdinosaur,项目名称:analytics.dinosaur.is,代码行数:14,代码来源:UrlHelperTest.php

示例2: detectCampaignKeywordFromReferrerUrl

 protected function detectCampaignKeywordFromReferrerUrl()
 {
     if (!empty($this->nameReferrerAnalyzed) && !empty($this->keywordReferrerAnalyzed)) {
         // keyword is already set, we skip
         return true;
     }
     // Set the Campaign keyword to the keyword found in the Referrer URL if any
     if (!empty($this->nameReferrerAnalyzed)) {
         $referrerUrlInfo = UrlHelper::extractSearchEngineInformationFromUrl($this->referrerUrl);
         if (!empty($referrerUrlInfo['keywords'])) {
             $this->keywordReferrerAnalyzed = $referrerUrlInfo['keywords'];
         }
     }
     // Set the keyword, to the hostname found, in a Adsense Referrer URL '&url=' parameter
     if (empty($this->keywordReferrerAnalyzed) && !empty($this->referrerUrlParse['query']) && !empty($this->referrerHost) && (strpos($this->referrerHost, 'googleads') !== false || strpos($this->referrerHost, 'doubleclick') !== false)) {
         // This parameter sometimes is found & contains the page with the adsense ad bringing visitor to our site
         $value = $this->getParameterValueFromReferrerUrl('url');
         if (!empty($value)) {
             $parsedAdsenseReferrerUrl = parse_url($value);
             if (!empty($parsedAdsenseReferrerUrl['host'])) {
                 if (empty($this->nameReferrerAnalyzed)) {
                     $type = $this->getParameterValueFromReferrerUrl('ad_type');
                     $type = $type ? " ({$type})" : '';
                     $this->nameReferrerAnalyzed = self::LABEL_ADWORDS_NAME . $type;
                     $this->typeReferrerAnalyzed = Common::REFERRER_TYPE_CAMPAIGN;
                 }
                 $this->keywordReferrerAnalyzed = self::LABEL_PREFIX_ADWORDS_KEYWORD . $parsedAdsenseReferrerUrl['host'];
             }
         }
     }
 }
开发者ID:nuxwin,项目名称:piwik,代码行数:31,代码来源:Base.php


注:本文中的Piwik\UrlHelper::extractSearchEngineInformationFromUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。