optOut

The optOut property controls whether tracking is disabled for the entire app. When optOut is true, the SDK doesn't collect tracking data.

By default, optOut is false, which means tracking is enabled. The value is persisted across app restarts and upgrades.

Syntax

PiwikTracker.sharedInstance()?.optOut = isOptOut
[PiwikTracker sharedInstance].optOut = isOptOut;

Parameters

  • optOut (boolean, required)
    Determines whether the user is opted out of tracking.

  • true : The user is opted out and tracking is disabled.

  • false : The user is opted in and tracking is enabled.

Examples

To set the opt-out flag and stop collecting data:

PiwikTracker.sharedInstance()?.optOut = true
[PiwikTracker sharedInstance].optOut = YES;

Related methods


Did this page help you?