Opt-out of Tracking

Prev Next

Opt-out lets a user stop the SDK from storing or sending any future tracking data. You can optionally flush already-cached requests to Mapp Intelligence one last time before opting the user out.

Methods

Method

Description

optOutAndSendCurrentData(false)

Stops tracking and discards any locally stored requests. No more data is sent.

optOutAndSendCurrentData(true)

Stops tracking and sends any locally stored requests to Mapp Intelligence one last time before opting out.

optIn()

Re-enables tracking using the current global configuration.

Example

// Opt out and discard locally stored data
@IBAction func optOutAndDiscard(_ sender: UIButton) {
    MappIntelligence.shared()?.optOutAndSendCurrentData(false)
}

// Opt out and send locally stored data first
@IBAction func optOutAndSend(_ sender: UIButton) {
    MappIntelligence.shared()?.optOutAndSendCurrentData(true)
}

// Opt back in
@IBAction func optIn(_ sender: UIButton) {
    MappIntelligence.shared()?.optIn()
}
// Opt out and discard locally stored data
[[MappIntelligence shared] optOutAndSendCurrentData:NO];

// Opt out and send locally stored data first
[[MappIntelligence shared] optOutAndSendCurrentData:YES];

// Opt back in
[[MappIntelligence shared] optIn];

When to use it

  • When the user revokes consent in your app's privacy settings.

  • When your consent management platform reports that the user opted out of analytics tracking.

Opt-out is persistent across app launches. Call optIn() to resume tracking later.

Related pages: Anonymous Tracking, Configure Global Tracking.