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
path: root/libs
diff options
context:
space:
mode:
authorsgiehl <stefan@piwik.org>2014-06-07 13:37:29 +0400
committersgiehl <stefan@piwik.org>2014-06-07 13:37:29 +0400
commit5ab4f2ce3d85c45edb077d50fdd3201398082b78 (patch)
tree14158ef939023ded7df683c1c5f1c7b4cae8327d /libs
parent91c2006add54b91afef8a36f1e74fb15d7039e2b (diff)
parent36560f60239a16a96257a446cc9d87120d1bce33 (diff)
Merge branch 'master' into DeviceDetector2
Diffstat (limited to 'libs')
-rw-r--r--libs/PiwikTracker/PiwikTracker.php24
1 files changed, 22 insertions, 2 deletions
diff --git a/libs/PiwikTracker/PiwikTracker.php b/libs/PiwikTracker/PiwikTracker.php
index 95c10bf676..e00120f71c 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 = array();
+ $this->pageCustomVar = array();
+ $this->eventCustomVar = array();
+ }
+
+
+ /**
* Sets the current visitor ID to a random new one.
*/
public function setNewVisitorId()
@@ -464,6 +478,7 @@ 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.
+ *
*/
public function enableBulkTracking()
{
@@ -1182,6 +1197,9 @@ class PiwikTracker
= $url
. (!empty($this->userAgent) ? ('&ua=' . urlencode($this->userAgent)) : '')
. (!empty($this->acceptLanguage) ? ('&lang=' . urlencode($this->acceptLanguage)) : '');
+
+ // Clear custom variables so they don't get copied over to other users in the bulk request
+ $this->clearCustomVariables();
return true;
}
@@ -1337,9 +1355,11 @@ class PiwikTracker
// DEBUG
$this->DEBUG_APPEND_URL;
+
+
// Reset page level custom variables after this page view
- $this->pageCustomVar = false;
- $this->eventCustomVar = false;
+ $this->pageCustomVar = array();
+ $this->eventCustomVar = array();
// force new visit only once, user must call again setForceNewVisit()
$this->forcedNewVisit = false;