userID

The userID property stores a unique identifier for the signed-in user, such as an ID from your CRM or authentication system. When isAnonymizationEnabled is false and the value isn't empty, the SDK includes the user ID in analytics tracking.

Syntax

PiwikTracker.sharedInstance()?.userID = "userId"
[PiwikTracker sharedInstance].userID = @"userId";

Parameters

  • userID (string, optional)

A unique identifier for the user. Use a non-empty string when the user is known. The SDK doesn't send a user ID if the property is nil or empty. Set this property as soon as the tracker starts so early events are attributed correctly.

Examples

PiwikTracker.sharedInstance()?.userID = "ABC123"
[PiwikTracker sharedInstance].userID = @"ABC123";

Notes

  • The user ID isn't sent when isAnonymizationEnabled is true.
  • For more on the user ID, see this article.

Related methods


Did this page help you?