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

Fixes #5291 Adding new method clearCustomVariables()

-> please use this method to make sure your custom variables are reset

 Thanks for the report!
parent 774431d4
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -360,6 +360,20 @@ class PiwikTracker ...@@ -360,6 +360,20 @@ class PiwikTracker
return $cookieDecoded[$id]; return $cookieDecoded[$id];
} }
/**
* Clears any Custom Variable that may be have been set.
*
* This can be useful when you have enabled bulk requests,
* and you wish to clear Custom Variables of 'visit' scope.
*/
public function clearCustomVariables()
{
$this->visitorCustomVar = false;
$this->pageCustomVar = false;
$this->eventCustomVar = false;
}
/** /**
* Sets the current visitor ID to a random new one. * Sets the current visitor ID to a random new one.
*/ */
...@@ -465,8 +479,8 @@ class PiwikTracker ...@@ -465,8 +479,8 @@ class PiwikTracker
* Enables the bulk request feature. When used, each tracking action is stored until the * Enables the bulk request feature. When used, each tracking action is stored until the
* doBulkTrack method is called. This method will send all tracking data at once. * doBulkTrack method is called. This method will send all tracking data at once.
* *
* Note: when you enable bulk tracking, all the properties of this object will be reset * Note: when you enable bulk tracking, consider calling clearCustomVariables() before setting other
* after each request is sent (ie. datetimes, settings, visitor id, etc. will be initialized to "false"). * attributes to your visitors and requests to track.
*/ */
public function enableBulkTracking() public function enableBulkTracking()
{ {
...@@ -1340,6 +1354,8 @@ class PiwikTracker ...@@ -1340,6 +1354,8 @@ class PiwikTracker
// DEBUG // DEBUG
$this->DEBUG_APPEND_URL; $this->DEBUG_APPEND_URL;
// Reset page level custom variables after this page view // Reset page level custom variables after this page view
$this->pageCustomVar = false; $this->pageCustomVar = false;
$this->eventCustomVar = false; $this->eventCustomVar = false;
......
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