getCampaignParameters() public static method

Returns the list of Campaign parameter names that will be read to classify a visit as coming from a Campaign
public static getCampaignParameters ( ) : array
return array array( 0 => array( ... ) // campaign names parameters 1 => array( ... ) // campaign keyword parameters );
Ejemplo n.º 1
0
 /**
  * Returns the array of parameters names that must be excluded from the Query String in all tracked URLs
  * @static
  * @param $idSite
  * @return array
  */
 public static function getQueryParametersToExclude($idSite)
 {
     $campaignTrackingParameters = Common::getCampaignParameters();
     $campaignTrackingParameters = array_merge($campaignTrackingParameters[0], $campaignTrackingParameters[1]);
     $website = Cache::getCacheWebsiteAttributes($idSite);
     $excludedParameters = self::getExcludedParametersFromWebsite($website);
     if (!empty($excludedParameters)) {
         Common::printDebug('Excluding parameters "' . implode(',', $excludedParameters) . '" from URL');
     }
     $parametersToExclude = array_merge($excludedParameters, self::$queryParametersToExclude, $campaignTrackingParameters);
     $parametersToExclude = array_map('strtolower', $parametersToExclude);
     return $parametersToExclude;
 }
Ejemplo n.º 2
0
 /**
  * Returns the array of parameters names that must be excluded from the Query String in all tracked URLs
  * @static
  * @param $idSite
  * @return array
  */
 public static function getQueryParametersToExclude($idSite)
 {
     $campaignTrackingParameters = Common::getCampaignParameters();
     $campaignTrackingParameters = array_merge($campaignTrackingParameters[0], $campaignTrackingParameters[1]);
     $website = Cache::getCacheWebsiteAttributes($idSite);
     $excludedParameters = self::getExcludedParametersFromWebsite($website);
     $parametersToExclude = array_merge($excludedParameters, self::$queryParametersToExclude, $campaignTrackingParameters);
     /**
      * Triggered before setting the action url in Piwik\Tracker\Action so plugins can register
      * parameters to be excluded from the tracking URL (e.g. campaign parameters).
      *
      * @param array &$parametersToExclude An array of parameters to exclude from the tracking url.
      */
     Piwik::postEvent('Tracker.PageUrl.getQueryParametersToExclude', array(&$parametersToExclude));
     if (!empty($parametersToExclude)) {
         Common::printDebug('Excluding parameters "' . implode(',', $parametersToExclude) . '" from URL');
     }
     $parametersToExclude = array_map('strtolower', $parametersToExclude);
     return $parametersToExclude;
 }
Ejemplo n.º 3
0
 protected function detectReferrerCampaignFromLandingUrl()
 {
     if (!isset($this->currentUrlParse['query']) && !isset($this->currentUrlParse['fragment'])) {
         return false;
     }
     $campaignParameters = Common::getCampaignParameters();
     $this->campaignNames = $campaignParameters[0];
     $this->campaignKeywords = $campaignParameters[1];
     $found = false;
     // 1) Detect campaign from query string
     if (isset($this->currentUrlParse['query'])) {
         $found = $this->detectCampaignFromString($this->currentUrlParse['query']);
     }
     // 2) Detect from fragment #hash
     if (!$found && isset($this->currentUrlParse['fragment'])) {
         $this->detectCampaignFromString($this->currentUrlParse['fragment']);
     }
 }