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:
Diffstat (limited to 'libs/PiwikTracker/PiwikTracker.php')
-rw-r--r--libs/PiwikTracker/PiwikTracker.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/libs/PiwikTracker/PiwikTracker.php b/libs/PiwikTracker/PiwikTracker.php
index ba790c77b0..a62feb7a8b 100644
--- a/libs/PiwikTracker/PiwikTracker.php
+++ b/libs/PiwikTracker/PiwikTracker.php
@@ -627,15 +627,16 @@ class PiwikTracker
*/
public function doBulkTrack()
{
- if (empty($this->token_auth)) {
- throw new Exception("Token auth is required for bulk tracking.");
- }
-
if (empty($this->storedTrackingActions)) {
throw new Exception("Error: you must call the function doTrackPageView or doTrackGoal from this class, before calling this method doBulkTrack()");
}
- $data = array('requests' => $this->storedTrackingActions, 'token_auth' => $this->token_auth);
+ $data = array('requests' => $this->storedTrackingActions);
+
+ // token_auth is not required by default, except if bulk_requests_require_authentication=1
+ if(!empty($this->token_auth)) {
+ $data['token_auth'] = $this->token_auth;
+ }
$postData = json_encode($data);
$response = $this->sendRequest($this->getBaseUrl(), 'POST', $postData, $force = true);