Android: Data collection modes
Digital Analytics supports three data collection modes:
- Opt-in - This is the default. All tag data that is sent is collected.
- Anonymous opt-out - The SDK collects and has access to certain data about the user experience on the tagged site. However, the data is only presented as part of a pool of general, anonymous visitors. You cannot determine that a specific person performed an action.
- Total opt-out - No tags are captured or sent to Digital Analytics.
The data collection mode is persisted across the application background processing, application reclaim, application restarts, and application updates. If the application is removed and reinstalled, the value returns to the default (opt-in).
To change modes, explicitly invoke the setOptOut method from the application.
Opt-in code
Set data collection mode to opt-in.
Boolean success = DigitalAnalytics.setOptOut(DigitalAnalytics.OPT_IN);
Anonymous opt-in code
Set data collection mode to anonymous opt-in.
Boolean success =
DigitalAnalytics.setOptOut(DigitalAnalytics.ANONYMOUS);
Opt-out code
Set data collection mode to opt-out.
Boolean success =
DigitalAnalytics.setOptOut(DigitalAnalytics.OPT_OUT);
Get data collection code
Get the data collection mode of your application.
String mode = DigitalAnalytics.getOptOut();
Updated 10 months ago