setAnonymizationState

The setAnonymizationState() method sets whether a user as anonymous. By default, the setAnonymizationState(true) is enabled. This means that each visitor is anonymous by default.

When anonymization is enabled:

  • The visitor's IP address isn't collected.
  • Location data is limited to the visitor's country.
  • The user ID isn't collected.
  • The device ID isn't collected.
  • A new visitor ID is generated each time the application starts.

Syntax

await FlutterPiwikPro.sharedInstance.setAnonymizationState(shouldAnonymize);

Parameters

shouldAnonymize (boolean, required)

Whether a user is anonymous or non-anonymous. True: anonymous. False: non-anonymous.

Examples

To set a visitor as non-anonymous:

await FlutterPiwikPro.sharedInstance.setAnonymizationState(true);