optOut

The optOut() method sets the opt-out flag for the entire app. Once the opt-out flag is set, no data is collected.

By default, optOut(false) is set.

Syntax

await FlutterPiwikPro.sharedInstance.optOut(shouldOptOut);

Parameters

shouldOptOut (boolean, required)

Sets whether the user is opted out of data collection.

  • true: The user is opted out, and no data is collected.
  • false: The user isn’t opted out, and data is collected.

Examples

To opt the user out and stop collecting data:

await FlutterPiwikPro.sharedInstance.optOut(true);