isAnonymizationEnabled
The isAnonymizationEnabled() method enables or disables user anonymization.
If a user is marked as anonymous, the SDK doesn't collect the user's IP address or user ID. Location data is limited to the country level. For anonymous users, the SDK generates a new visitor ID each time the application starts.
By default, isAnonymizationEnabled is set to true. This means users are anonymous by default.
Syntax
PiwikTracker.sharedInstance()?.isAnonymizationEnabled = isAnonymous[PiwikTracker sharedInstance].isAnonymizationEnabled = isAnonymous;Parameters
-
isAnonymizationEnabled (boolean, required)
Determines whether a user is anonymous or non-anonymous. -
true- The user is anonymous. -
false- The user is not anonymous.
Examples
To mark a user as non-anonymous:
PiwikTracker.sharedInstance()?.isAnonymizationEnabled = false[PiwikTracker sharedInstance].isAnonymizationEnabled = NO;Notes
- Data Activation methods identify the user by the visitor ID. To keep the same profile across app launches, disable anonymization.
- The value isn't stored between app launches and is
trueeach time the app starts. Set it each time the tracker starts.
Related methods
Updated 2 days ago
Did this page help you?