Skip to content
Extraits de code Groupes Projets
Valider b74fbbb4 rédigé par Matthieu Aubry's avatar Matthieu Aubry
Parcourir les fichiers

Merge pull request #9986 from piwik/url_query_params_to_config

URL query string parameters to remove from URL are now stored in config file
parents 495d4f5b 5f52b389
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.
......
Subproject commit e1cfad8171d23f65b0cd9b10738b9f5a2925e4c7 Subproject commit 68d6ca28f78ae9856c0b3b94f5e7c67cb84f9706
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