- 1 Minute to read
- Print
- DarkLight
Opt-out of Tracking
- 1 Minute to read
- Print
- DarkLight
In certain cases, you may need to fully exclude users from tracking. The Mapp SDK provides an opt-out mechanism to achieve this. When a user opts out, all cached tracking data will be deleted (if sendCurrentData
is set to false), requests will be canceled, the WorkManager will terminate, and no further tracking requests will be processed.
Opt-out Options
Here are the different ways you can implement the opt-out functionality:
Complete Opt-out Without Sending Cached Data
This option deletes all cached data without sending it to the servers:
Webtrekk.getInstance().optOut(value = true, sendCurrentData = false)
Complete Opt-out With Cached Data Sent to Servers
This option sends the cached data to the servers before opting out:
Webtrekk.getInstance().optOut(value = true, sendCurrentData = true)
Disable Opt-out Option
To disable the opt-out and re-enable tracking:
Webtrekk.getInstance().optOut(value = false)
Check if Opt-out is Active
To verify whether the opt-out option is currently enabled:
Webtrekk.getInstance().hasOptOut() // Returns true if opt out is active