Digital Analytics supports three data collection modes:

  • Opt-in – This is the default. All tag data that is sent is collected.
  • Anonymous out-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.

Sample data collection modes
Opt-in
Anonymous opt-in
Opt-out
Get data collection

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();

Join The Discussion

Your email address will not be published. Required fields are marked *