For our clients that integrate our CMP SDK along with one of the following 3rd-party SDKs, we’ve composed this document where you’ll find individual guides that will demonstrate how consents collected using our CMP SDK are passed to these SDKs. Our CMP is fully compatible with TCF v2.2, and it collects DMA consent data and stores it in SharedPreferences
. Some of the SDKs below can fetch this data automatically, and some require some code. Please check below the individual use cases.
On some SDKs from providers like AppsFlyer, AdJust and branch you’ll need to either (a) invoke our updateThirdPartyConsent()
method, which will automatically pass the collected consents to these SDKs via introspection/reflection, or (b) use their own methods and properties to do it manually. In case you’re using our CMP SDK to automatically handle the pass of the consent data, here’s an example of implementation:
import net.consentmanager.cm_sdk_android_v3.CMPManager
import net.consentmanager.cm_sdk_android_v3.CMPManagerDelegate
import net.consentmanager.cm_sdk_android_v3.ConsentLayerUIConfig
import net.consentmanager.cm_sdk_android_v3.UrlConfig
public class AppsflyerBasicApp extends Application {
@Override
public void onCreate() {
super.onCreate()
// Initialize your third-party SDK. Replace the code below by your respective third-party init code
// according to the instructions along this document
String yourClientToken = "YOUR-CLIENT-TOKEN"
YourThirdPartySdk yourThirdPartySdk = YourThirdPartySdk.getInstance()
yourThirdPartySdk.init(yourClientToken)
// Initializing our CMP SDK
val urlConfig = UrlConfig(
id = "YOUR_CODE_ID_HERE",
domain = "delivery.consentmanager.net",
language = "EN",
appName = "CMDemoAppKotlin"
)
cmpManager = CMPManager.getInstance(
context = this,
urlConfig = urlConfig,
webViewConfig = webViewConfig,
delegate = this
)
cmpManager.setActivity(this)
// Here our CMP SDK will automatically display the consent layer if there is no consent
// or the consent is expired. The didReceiveConsent() callback below will be triggered
// once user consent is collected, which happens right after the users accepts/rejects
// and all IAB TCF data is persisted to the SharedPreferences area
checkAndOpen()
}
override fun didReceiveConsent(consent: String, jsonObject: Map<String, Any>) {
Log.d("CMP DemoApp", "Consent Layer successfully received consent message.")
// Here we'll automatically handle the passing of the consent from our
// CMP SDK to the 3P SDK
cmpManager.updateThirdPartyConsent()
}
}
For further information, proceed to the respective third-party instructions below.
This SDK searches for TCF string stored inside the SharedPreferences
area of the device, providing automatic flow of the consents collected on the device via our CMP SDK to AppsFlyer events. In order to pass consent data to AppsFlyer, please follow the instructions below:
AppsFlyerLib.getInstance().init(<YOUR_DEV_KEY>, null, this);
AppsFlyerLib.enableTCFDataCollection(true);
SharedPreferences
. There are different ways of doing this with our CMP SDK. In the example on the overview, we’re using the didReceiveConsent()
callback to achieve this. start()
method. In the latter case, replace the line inside our didReceiveMessage
callback by the the line below: AppsFlyerLib.getInstance().start(this);
This SDK does not retrieve consent data stored inside the SharedPreferences
area of the device, so you have two ways of achieving this feat: (a) automatic, which will be completely handled by our CMP SDK; and (b) manual, where you’ll use both SDKs features to achieve this. Please follow the instructions below:
SharedPreferences
. There are different ways of doing this with our CMP SDK. In the example below, we’re using the didReceiveConsent()
callback to illustrate. updateThirdPartyConsent()
method from our CMP SDK, which will automatically pass the data to AdJust’s SDK via introspection/reflection or replace it by the code below:override fun didReceiveConsent(consent: String, jsonObject: Map<String, Any>) {
Log.d("CMP DemoApp", "Consent Layer successfully received consent message.")
// Retrieve Google Consent Mode data...
val consentData = cmpManager.getGoogleConsentModeStatus();
// ... and parse it to pass to AdJust SDK
val adStorageConsent = consentSettings["ad_storage"] == "granted" ? "1" : "0"
val adPersonalizationConsent = consentSettings["ad_personalization"] == "granted" ? "1" : "0"
val adjustThirdPartySharing = AdjustThirdPartySharing(true)
adjustThirdPartySharing.addGranularOption("google_dma", "eea", "1");
adjustThirdPartySharing.addGranularOption("google_dma", "ad_personalization", adPersonalizationConsent);
adjustThirdPartySharing.addGranularOption("google_dma", "ad_user_data", adStorageConsent);
Adjust.trackThirdPartySharing(adjustThirdPartySharing)
}
This SDK does not retrieve consent data stored inside the SharedPreferences
area of the device, so you have two ways of achieving this feat: (a) automatic, which will be completely handled by our CMP SDK; and (b) manual, where you’ll use both SDKs features to achieve this.
SharedPreferences
. There are different ways of doing this with our CMP SDK. In the example below, we’re using the didReceiveConsent()
callback to illustrate. updateThirdPartyConsent()
method from our CMP SDK, which will automatically pass the data to AdJust’s SDK via introspection/reflection or replace it by the code below: override fun didReceiveConsent(consent: String, jsonObject: Map<String, Any>) {
Log.d("CMP DemoApp", "Consent Layer successfully received consent message.")
// Retrieve Google Consent Mode data...
val consentData = cmpManager.getGoogleConsentModeStatus();
// ... and parse it to pass to AdJust SDK
val adStorageConsent = consentSettings["ad_storage"] == "granted"
val adPersonalizationConsent = consentSettings["ad_personalization"] == "granted"
// Example for an EEA resident
Branch.getInstance().setDMAParamsForEEA(true,adPersonalizationConsent,adStorageConsent)
// Example for an non-EEA resident
Branch.getInstance().setDMAParamsForEEA(false,adPersonalizationConsent,adStorageConsent)
// For further information, check:
// https://help.branch.io/developers-hub/docs/ios-advanced-features#user-data
}
This SDK searches for TCF string stored inside the SharedPreferences
area of the device, providing automatic flow of the consents collected on the device via our CMP SDK to AppsFlyer events. In order to pass consent data to AppsFlyer, please follow the instructions below:
SharedPreferences
. There are different ways of doing this with our CMP SDK. In the example on the overview, we’re using the didReceiveConsent()
callback to achieve this. startWithAppGuid()
method. In the latter case, replace the line inside our didReceiveMessage
callback by the the line below: Tracker.getInstance().startWithAppGuid(applicationContext, "YOUR_ANDROID_APP_GUID")
This SDK searches for TCF string stored inside the SharedPreferences
area of the device, providing automatic flow of the consents collected on the device via our CMP SDK to AppsFlyer events. In order to pass consent data to AppsFlyer, please follow the instructions below:
SharedPreferences
. There are different ways of doing this with our CMP SDK. In the example on the overview, we’re using the didReceiveConsent()
callback to achieve this. trackingOptIn()
method. In the latter case, replace the line inside our didReceiveMessage
callback by the the line below: Singular.trackingOptIn();
This SDK searches for TCF string stored inside the SharedPreferences
area of the device, providing automatic flow of the consents collected on the device via our CMP SDK to AppsFlyer events. In order to pass consent data to AppsFlyer, please follow the instructions below:
SharedPreferences
. There are different ways of doing this with our CMP SDK. In the example on the overview, we’re using the didReceiveConsent()
callback to achieve this. startTracking()
method. In the latter case, replace the line inside our didReceiveMessage
callback by the the line below: Airbridge.startTracking()
This SDK searches for TCF string stored inside the SharedPreferences
area of the device, providing automatic flow of the consents collected on the device via our CMP SDK to AppsFlyer events. In order to pass consent data to AppsFlyer, please follow the instructions below:
SharedPreferences
. There are different ways of doing this with our CMP SDK. In the example on the overview, we’re using the didReceiveConsent()
callback to achieve this. optIn()/optOut()
methods.