- 1 Minute to read
- Print
- DarkLight
Opt-Out of Tracking
- 1 Minute to read
- Print
- DarkLight
It is possible for users to opt-in or out of tracking. Calling the methods below will prevent the SDK from storing or sending any future user activity to Mapp Intelligence. You can also send a final request with currently stored requests to Mapp Intelligence before the user is opted-out of tracking completely.
Methods
Method | Description |
---|---|
MappIntelligence.shared()?.optOutAndSendCurrentData(false) | Stops tracking without sending any tracking data to Mapp Intelligence. |
MappIntelligence.shared()?.optOutAndSendCurrentData(true) | Stops tracking and sends the currently saved tracking data to Mapp Intelligence. |
MappIntelligence.shared()?.optIn() | Starts tracking as configured in the Global Configuration. |
// Opt-out and delete currently saved tracking data
MappIntelligence.shared()?.optOutAndSendCurrentData(false)
// Opt-out and send currently saved tracking data to trackserver
MappIntelligence.shared()?.optOutAndSendCurrentData(true)
// Opt-in
MappIntelligence.shared()?.optIn()
Example iOS
// Enable opt-out and delete currently stored tracking data without sending.
@IBAction func optOutFull(_ sender: UIButton) {
MappIntelligence.shared()?.optOutAndSendCurrentData(false)
}
// Enable opt-out and send currently stored tracking data to Mapp Intelligence
@IBAction func optOutSend(_ sender: Any) {
MappIntelligence.shared()?.optOutAndSendCurrentData(true)
}
// opt-in / start tracking
@IBAction func OptIn(_ sender: UIButton) {
MappIntelligence.shared()?.optIn()
}
// Enable opt-out and delete currently stored tracking data without sending.
[[MappIntelligence shared] optOutAndSendCurrentData:NO];
// Enable opt-out and send currently stored tracking data to Mapp Intelligence
[[MappIntelligence shared] optOutAndSendCurrentData:YES];
// Disable opt-out / start tracking
[[MappIntelligence shared] optIn];