setUserId() публичный Метод

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.
Пример #1
0
 private function trackPageview(\PiwikTracker $tracker, $userId, $url)
 {
     $tracker->setUrl('http://www.example.org' . $url);
     $tracker->setUserId($userId);
     $tracker->doTrackPageView($url);
 }
Пример #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);
 }