setOptOut

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

By default, setOptOut(false) is set.

Syntax

await PiwikProSdk.setOptOut(shouldOptOut);

Parameters

shouldOptOut (boolean, required)

Whether the opt-out flag is set.

  • true if the flag is set
  • false if the flag isn’t set

Examples

To set the opt-out flag and not collect any data:

await PiwikProSdk.setOptOut(true);