PiwikTracker::doTrackPageView PHP Method

doTrackPageView() public method

Tracks a page view
public doTrackPageView ( string $documentTitle ) : mixed
$documentTitle string Page title as it will appear in the Actions > Page titles report
return mixed Response string or true if using bulk requests.
    public function doTrackPageView($documentTitle)
    {
        $url = $this->getUrlTrackPageView($documentTitle);
        return $this->sendRequest($url);
    }

Usage Example

 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');
     $response = $this->tracker->doBulkTrack();
     $this->assertEquals('{"status":"success","tracked":2,"invalid":1}', $response);
 }
All Usage Examples Of PiwikTracker::doTrackPageView