Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2014-06-05 07:03:03 +0400
committermattab <matthieu.aubry@gmail.com>2014-06-05 07:03:03 +0400
commit0ed11b178860844b97b967f6cfa1ffd12ab2eaab (patch)
treecd69c0b86108f2dfe35afdb8046c6eee4e845a5a /libs/PiwikTracker
parent774431d47adb025450dcdb49e32547ad416588c3 (diff)
Fixes #5291 Adding new method clearCustomVariables()
-> please use this method to make sure your custom variables are reset Thanks for the report!
Diffstat (limited to 'libs/PiwikTracker')
-rw-r--r--libs/PiwikTracker/PiwikTracker.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/libs/PiwikTracker/PiwikTracker.php b/libs/PiwikTracker/PiwikTracker.php
index 9c2e1379a4..e9a5429b9a 100644
--- a/libs/PiwikTracker/PiwikTracker.php
+++ b/libs/PiwikTracker/PiwikTracker.php
@@ -361,6 +361,20 @@ class PiwikTracker
}
/**
+ * 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.
*/
public function setNewVisitorId()
@@ -465,8 +479,8 @@ class PiwikTracker
* 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.
*
- * Note: when you enable bulk tracking, all the properties of this object will be reset
- * after each request is sent (ie. datetimes, settings, visitor id, etc. will be initialized to "false").
+ * Note: when you enable bulk tracking, consider calling clearCustomVariables() before setting other
+ * attributes to your visitors and requests to track.
*/
public function enableBulkTracking()
{
@@ -1340,6 +1354,8 @@ class PiwikTracker
// DEBUG
$this->DEBUG_APPEND_URL;
+
+
// Reset page level custom variables after this page view
$this->pageCustomVar = false;
$this->eventCustomVar = false;