Tracking Opt-Out
 

OPTIONAL

By default, SDK tracks certain device identifiers like GAID, Android-id, activity names, etc. If required you can choose to opt-out of this tracking by using the TrackingOptOutConfig object.
Refer to the API reference of TrackingOptOutConfig for more details on the available opt-outs.

Use the configureTrackingOptOut() to pass on the configuration to the SDK.

Kotlin Java
        val trackingOptOut = mutableSetOf<Class<*>>()
        trackingOptOut.add(SplashActivity::class.java)

        val trackingOptOutConfig = TrackingOptOutConfig(
            isGaidTrackingEnabled = true,
            isAndroidIdTrackingEnabled = true,
            isCarrierTrackingEnabled = true,
            isDeviceAttributeTrackingEnabled = true,
            trackingOptOut
        )

        val moengage = MoEngage.Builder(application, appId)
            .configureTrackingOptOut(trackingOptOutConfig)
            .build()

        MoEngage.initialise(moengage)

For SDK version below 11.x.xx

If you are using the SDK version below 11.x.xx use the below APIs for opt-outs in the MoEngage.Builder

Java
//Opt-out GAID tracking
optOutGAIDCollection()
//Opt-out Android Id tracking
optOutAndroidIdCollection()
//Opt-out Carrier name tracking
optOutAndroidIdCollection()
//Opt-out device attribute tracking
optOutDeviceAttributeCollection()
Was this article helpful?
0 out of 0 found this helpful