Opting a user out or into tracking

The following methods allow you to opt a user out of various levels of tracking and opt them back in based on your app's privacy configuration.

The Medallia Experience Orchestration Cordova SDK supports the following opt out tracking levels:

  • ALL_TRACKING — iOS only. The combination of all opt-out tracking options listed below. When opted out of all tracking, nothing will be sent to MXO.

  • CITY_COUNTRY_DETECTION — City and country information is populated in the Device Data Adapter based on the device connecting to MXO. Medallia Experience Orchestration resolves the device IP based on the connection made and maps this to the user's IP location. When opted out of city/country detection. this information will not be visible in the MXO Device Data Adapter.

  • KEYCHAIN_TID_STORAGE — iOS only. When an app is configured in User or Preview mode, the TID gets automatically generated by MXO and assigned to each customer who visits a mobile Touchpoint. The returned TID gets stored in the Keychain for each Site Key and Touchpount configuration. When opted out of Keychain TID storage, the TID will not be stored in the Keychain.

By default, all optInOptions are set to opt-in.
Note: For instructions on how to completely remove a user's data from Medallia Experience Orchestration, see Delete all data from an existing customer.
Important: When opted out, tracking stops and locally queued data is removed.

Opting a user out or into all tracking

To opt out a user from all tracking when the user does not give permission to be tracked in the client app, call the opt out method as shown below:

const optOutConfig = {
	optOut: true
}
return MedalliaMXO.setOptOutConfiguration(optOutConfig).then(() => {
	// do something after the opt out configuration has been set
})
.catch((error) => {
	// do something with the error
	console.error(error)
})
Important: When a user is opted out from all tracking, all of the other optInOptions are ignored.

Opting a user into a specific tracking

This example shows how to opt a user into a specific tracking only.

let optInOptions;
if (cordova.platformId === 'ios') {
	optInOptions = ['KEYCHAIN_TID_STORAGE', 'CITY_COUNTRY_TRACKING']
} else {
      	optInOptions = ['CITY_COUNTRY_TRACKING']
}
const optOutConfiguration = {
	optOut: false,
      	optInOptions: optInOptions
}
return MedalliaMXO.setOptOutConfiguration(optOutConfig).then(() => {
	// do something after the opt out configuration has been set
})
.catch((error) => {
	// do something with the error
	console.error(error)
})