--- title: "Opt-out of Tracking" slug: "mapp-intelligence-ios-sdk-v5-opt-out-tracking" updated: 2026-04-30T12:19:42Z published: 2026-04-30T12:19:42Z canonical: "docs.mapp.com/mapp-intelligence-ios-sdk-v5-opt-out-tracking" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # Opt-out of Tracking 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. Before you start, complete the [Quickstart](/v1/docs/mapp-intelligence-ios-sdk-v5-quickstart) so the SDK is initialized. --- ## 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](/v1/docs/mapp-intelligence-ios-sdk-v5-configure-global-tracking). | --- ## Example **Swift** ```swift // 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() } ``` **Objective-C** ```objectivec // 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. > [!NOTE] > Opt-out is persistent across app launches. Call `optIn()` to resume tracking later. --- ## Related - [Quickstart](/v1/docs/mapp-intelligence-ios-sdk-v5-quickstart) - [Anonymous Tracking](/v1/docs/mapp-intelligence-ios-sdk-v5-anonymous-tracking) - [Configure Global Tracking](/v1/docs/mapp-intelligence-ios-sdk-v5-configure-global-tracking)