diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-11-13 06:13:48 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-11-13 06:13:48 +0300 |
commit | fd9478a0499d4fb851b07cf7971750d550592237 (patch) | |
tree | 58eaad2660c4fd3c51791286e7703985ff8845e6 /libs | |
parent | be899f7a6a562cc2d670e610c7bfbbf0f6f73148 (diff) |
refs #6577 Return HTTP 204 instead of GIF for JavaScript tracking.
added a new url parameter send_image=0 to disable sending an
image and instead response with a 204 code
Diffstat (limited to 'libs')
-rw-r--r-- | libs/PiwikTracker/PiwikTracker.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/PiwikTracker/PiwikTracker.php b/libs/PiwikTracker/PiwikTracker.php index 39eb82b6bd..c998e1913d 100644 --- a/libs/PiwikTracker/PiwikTracker.php +++ b/libs/PiwikTracker/PiwikTracker.php @@ -219,6 +219,8 @@ class PiwikTracker $this->doBulkRequests = false; $this->storedTrackingActions = array(); + $this->sendImageResponse = true; + $this->visitorCustomVar = $this->getCustomVariablesFromCookie(); } @@ -501,6 +503,14 @@ class PiwikTracker } /** + * If image response is disabled Piwik will respond with a HTTP 204 header instead of responding with a gif. + */ + public function disableSendImageResponse() + { + $this->sendImageResponse = false; + } + + /** * Fix-up domain */ static protected function domainFixup($domain) @@ -1524,6 +1534,7 @@ class PiwikTracker (!empty($this->city) ? '&city=' . urlencode($this->city) : '') . (!empty($this->lat) ? '&lat=' . urlencode($this->lat) : '') . (!empty($this->long) ? '&long=' . urlencode($this->long) : '') . + (!$this->sendImageResponse ? '&send_image=0' : '') . // DEBUG $this->DEBUG_APPEND_URL; |