PiwikTracker::setDebugStringAppend PHP Method

setDebugStringAppend() public method

Will append a custom string at the end of the Tracking request.
public setDebugStringAppend ( string $string )
$string string
    public function setDebugStringAppend($string)
    {
        $this->DEBUG_APPEND_URL = '&' . $string;
        return $this;
    }

Usage Example

示例#1
0
 public function test_response_ShouldContainBulkTrackingApiResponse()
 {
     $this->tracker->doTrackPageView('Test');
     $this->tracker->doTrackPageView('Test');
     // test skipping invalid site errors
     $this->tracker->setIdSite(5);
     $this->tracker->doTrackPageView('Test');
     $this->tracker->setIdSite(1);
     $this->tracker->doTrackPageView('Test');
     // test skipping invalid request parameter errors
     $this->tracker->setDebugStringAppend('cid=abc');
     $this->tracker->doTrackPageView('Test');
     $this->tracker->DEBUG_APPEND_URL = '';
     // another invalid one to further test the invalid request indices in the result
     $this->tracker->setIdSite(7);
     $this->tracker->doTrackPageView('Test');
     $response = $this->tracker->doBulkTrack();
     $this->assertEquals('{"status":"success","tracked":3,"invalid":3,"invalid_indices":[2,4,5]}', $response);
 }