setUserId() public method

A User ID can be a username, UUID or an email address, or any number or string that uniquely identifies a user or client.
public setUserId ( string $userId )
$userId string Any user ID string (eg. email address, ID, username). Must be non empty. Set to false to de-assign a user id previously set.
 private function trackPageview(\PiwikTracker $tracker, $userId, $url)
 {
     $tracker->setUrl('http://www.example.org' . $url);
     $tracker->setUserId($userId);
     $tracker->doTrackPageView($url);
 }
Beispiel #2
0
 private function trackPageview(\PiwikTracker $tracker, $userId, $url = null)
 {
     if (null !== $url) {
         $tracker->setUrl('http://www.example.org' . $url);
     }
     $tracker->setUserId($userId);
     $title = $url ?: 'test';
     $tracker->doTrackPageView($title);
 }