Third-party data
If the version of the data collection SDK is lower than 3.0.0, use plugin version 1.3.0. If the version of the data collection SDK is 3.0.0 or later, use a plugin version later than 2.0.0
implementation 'cn.thinkingdata.android:TAThirdParty:2.0.2'
The following sample code syncs data from multiple platforms:
- Java
- Kotlin
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.APPS_FLYER | TDThirdPartyType.ADJUST);
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.APPS_FLYER or TDThirdPartyType.ADJUST)
To add extra parameters, you can use
enableThirdPartySharing(int var1, Map<String, Object> var2). This API doesn't support bitwise operations
If the SDK version is <=1.20 and you use ProGuard, add the following to the configuration file to prevent the feature from failing:
-dontwarn cn.thinkingdata.thirdparty.**
-keep class cn.thinkingdata.thirdparty.** { *; }
-keep class cn.thinkingdata.module.routes.** { *; }
1. Appsflyer
Call the API before the AppsFlyer SDK calls the start method:
- Java
- Kotlin
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.APPS_FLYER);
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.APPS_FLYER)
After the user registers or creates a character (optional):
- Java
- Kotlin
TDAnalytics.login("account_id")
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.APPS_FLYER);
TDAnalytics.login("account_id")
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.APPS_FLYER)
Each time you call the AE login or identify method, you also need to call enableThirdPartySharing to update the user identifier.
Note: Each call to AppsFlyer's setAdditionalData overwrites the user identifier that was set. You can set parameters through the enableThirdPartySharing method that we provide:
- Java
- Kotlin
Map<String, Object> additionalData = new HashMap<>();
additionalData.put("af_test_key1", "test1");
additionalData.put("af_test_key2", "test2");
TDAnalytics.enableThirdPartySharing(
TDThirdPartyType.APPS_FLYER,
additionalData
)
val additionalData: MutableMap<String, Any> = HashMap()
additionalData["af_test_key1"] = "test1"
additionalData["af_test_key2"] = "test2"
TDAnalytics.enableThirdPartySharing(
TDThirdPartyType.APPS_FLYER,
additionalData
)
2. Adjust
Call this before the Adjust SDK is initialized:
- Java
- Kotlin
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.ADJUST);
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.ADJUST)
After the user registers or creates a character (optional):
- Java
- Kotlin
TDAnalytics.login("accoount_id")
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.ADJUST);
TDAnalytics.login("accoount_id")
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.ADJUST)
3. Branch
Call this before Branch initializes the session:
- Java
- Kotlin
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.BRANCH);
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.BRANCH)
After the user registers or creates a character (optional):
- Java
- Kotlin
TDAnalytics.login("accoount_id")
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.BRANCH);
TDAnalytics.login("accoount_id")
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.BRANCH)
4. TopOn
Call this before ATSDK.init:
- Java
- Kotlin
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.TOP_ON);
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.TOP_ON)
If you call the AE login or identify multiple times, call enableThirdPartySharing again to sync the data.
Note: Each call to TopOn's initCustomMap overwrites the user identifier that was set. You can set parameters through the enableThirdPartySharing method that we provide:
- Java
- Kotlin
Map<String, Object> customMap = new HashMap<>();
customMap.put("key1", "value1");
customMap.put("key2", "value2");
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.TOP_ON, customMap);
val customMap: MutableMap<String, Any> = HashMap()
customMap["key1"] = "value1"
customMap["key2"] = "value2"
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.TOP_ON, customMap)
5. Tradplus
Call this before TradPlusSdk.initSdk:
- Java
- Kotlin
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.TRAD_PLUS);
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.TRAD_PLUS)
6. IronSource
Call this after IronSourceSdk is initialized:
- Java
- Kotlin
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.IRON_SOURCE);
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.IRON_SOURCE)
7. AppLovin
- Impression level
Call this before AppLovinSdk is initialized:
- Java
- Kotlin
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.APPLOVIN_IMPRESSION);
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.APPLOVIN_IMPRESSION)
- User level
To get monetization data, create a MaxAdRevenueListener and override the onAdRevenuePaid() method. In this method, get the monetization data and report it through enableThirdPartySharing of the AE SDK. Finally, pass the listener to setRevenueListener(). The sample code is as follows:
void onAdRevenuePaid(final MaxAd ad){
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.APPLOVIN_USER,ad);
}

