PiwikTracker::getUrlTrackPageView PHP Method

getUrlTrackPageView() public method

Builds URL to track a page view.
See also: doTrackPageView()
public getUrlTrackPageView ( string $documentTitle = '' ) : string
$documentTitle string Page view name as it will appear in Piwik reports
return string URL to piwik.php with all parameters set to track the pageview
    public function getUrlTrackPageView($documentTitle = '')
    {
        $url = $this->getRequest($this->idSite);
        if (strlen($documentTitle) > 0) {
            $url .= '&action_name=' . urlencode($documentTitle);
        }
        return $url;
    }

Usage Example

示例#1
0
 public function test_response_ShouldSend400ResponseCode_IfInvalidRequestParameterIsGiven()
 {
     $url = $this->tracker->getUrlTrackPageView('Test');
     $url .= '&cid=' . str_pad('1', 16, '1');
     $this->assertResponseCode(200, $url);
     $this->assertResponseCode(400, $url . '1');
     // has to be 16 char, but is 17 now
 }
All Usage Examples Of PiwikTracker::getUrlTrackPageView