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
tracker.isOptOut = isOptOutgetTracker().setOptOut(isOptOut);Parameters
isOptOut (boolean, required)
Whether the opt-out flag is set.
trueif the flag is setfalseif the flag isn’t set
Examples
To set the opt-out flag and not collect any data:
tracker.isOptOut = truegetTracker().setOptOut(true);Notes
- When opt-out is enabled, the SDK dispatches any pending events in the queue before stopping data collection.
- The setting is persisted across app restarts.
Updated 14 days ago