Skip to content
Extraits de code Groupes Projets
Valider 283e0499 rédigé par mattab's avatar mattab
Parcourir les fichiers

URL query string parameters to remove from URL are now stored in config file

parent c928ff49
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -623,6 +623,10 @@ window_look_back_for_visitor = 0 ...@@ -623,6 +623,10 @@ window_look_back_for_visitor = 0
; visitors that stay on the website and view only one page will be considered as time on site of 0 second ; visitors that stay on the website and view only one page will be considered as time on site of 0 second
default_time_one_page_visit = 0 default_time_one_page_visit = 0
; Comma separated list of URL query string variable names that will be removed from your tracked URLs
; By default, Piwik will remove the most common parameters which are known to change often (eg. session ID parameters)
url_query_parameter_to_exclude_from_url = "gclid,fb_xd_fragment,fb_comment_id,phpsessid,jsessionid,sessionid,aspsessionid,doing_wp_cron,sid"
; if set to 1, Piwik attempts a "best guess" at the visitor's country of ; if set to 1, Piwik attempts a "best guess" at the visitor's country of
; origin when the preferred language tag omits region information. ; origin when the preferred language tag omits region information.
; The mapping is defined in core/DataFiles/LanguageToCountry.php, ; The mapping is defined in core/DataFiles/LanguageToCountry.php,
......
...@@ -28,10 +28,6 @@ class PageUrl ...@@ -28,10 +28,6 @@ class PageUrl
'https://' => 2 'https://' => 2
); );
protected static $queryParametersToExclude = array('gclid', 'fb_xd_fragment', 'fb_comment_id',
'phpsessid', 'jsessionid', 'sessionid', 'aspsessionid',
'doing_wp_cron', 'sid');
/** /**
* Given the Input URL, will exclude all query parameters set for this site * Given the Input URL, will exclude all query parameters set for this site
* *
...@@ -87,7 +83,7 @@ class PageUrl ...@@ -87,7 +83,7 @@ class PageUrl
$excludedParameters = self::getExcludedParametersFromWebsite($website); $excludedParameters = self::getExcludedParametersFromWebsite($website);
$parametersToExclude = array_merge($excludedParameters, $parametersToExclude = array_merge($excludedParameters,
self::$queryParametersToExclude, self::getUrlParameterNamesToExcludeFromUrl(),
$campaignTrackingParameters); $campaignTrackingParameters);
/** /**
...@@ -106,6 +102,19 @@ class PageUrl ...@@ -106,6 +102,19 @@ class PageUrl
return $parametersToExclude; return $parametersToExclude;
} }
/**
* Returns the list of URL query parameters that should be removed from the tracked URL query string.
*
* @return array
*/
protected static function getUrlParameterNamesToExcludeFromUrl()
{
$paramsToExclude = Config::getInstance()->Tracker['url_query_parameter_to_exclude_from_url'];
$paramsToExclude = explode(",", $paramsToExclude);
$paramsToExclude = array_map('trim', $paramsToExclude);
return $paramsToExclude;
}
/** /**
* Returns true if URL fragments should be removed for a specific site, * Returns true if URL fragments should be removed for a specific site,
* false if otherwise. * false if otherwise.
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter