目录
此内容是否有帮助?

# 三方数据

从v2.8.0开始支持三方数据接入功能,如果接入的SDK版本大于等于2.8.2,需要引入三方数据插件:

implementation 'cn.thinkingdata.android:TAThirdParty:1.2.0'

以下是同步多个平台数据的示例代码:

instance.enableThirdPartySharing(TDThirdPartyShareType.TD_APPS_FLYER | TDThirdPartyShareType.TD_ADJUST| TDThirdPartyShareType.TD_TRAD_PLUS | TDThirdPartyShareType.TD_TRACKING| TDThirdPartyShareType.TD_TOP_ON | TDThirdPartyShareType.TD_BRANCH| TDThirdPartyShareType.TD_IRON_SOURCE);

如果需要增加额外参数,可以使用enableThirdPartySharing(int var1, Map<String, Object> var2),该API不支持位运算

# 1.Appsflyer

在AppsFlyer SDK调用start方法之前调用API:

instance.enableThirdPartySharing(TDThirdPartyShareType.TD_APPS_FLYER)

注册创角色之后(可选):

instance.login("account_id")
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_APPS_FLYER)

每次调用了TE的login方法或者identify方法,您需要同步调用enableThirdPartySharing更新用户标识。

注意:由于AppFlyer的setAdditionalData每次调用,会覆盖设置的用户标识。您可以通过我们提供的enableThirdPartySharing方法设置参数:

Map<String, Object> additionalData = new HashMap<>();
additionalData.put("af_test_key1", "test1");
additionalData.put("af_test_key2", "test2");
instance.enableThirdPartySharing(
    TDThirdPartyShareType.TD_APPS_FLYER,
    additionalData
)

# 2.Adjust

在Adjust SDK初始化之前调用:

instance.enableThirdPartySharing(TDThirdPartyShareType.TD_ADJUST)

注册创角色之后(可选):

instance.login("accoount_id")
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_ADJUST)

# 3.Branch

在Branch initialize the session之前调用:

instance.enableThirdPartySharing(TDThirdPartyShareType.TD_BRANCH)

注册创角色之后(可选):

instance.login("accoount_id")
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_BRANCH)

# 4. TopOn

在ATSDK.init之前调用:

instance.enableThirdPartySharing(TDThirdPartyShareType.TD_TOP_ON)

多次调用TE的login或者identify,需要再次调用enableThirdPartySharing同步数据。

注意:由于TopOn的initCustomMap每次调用,会覆盖设置的用户标识。您可以通过我们提供的enableThirdPartySharing方法设置参数:

Map<String, Object> customMap = new HashMap<>();
customMap.put("key1", "value1");
customMap.put("key2", "value2");
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_TOP_ON, customMap)

# 5.热云

在账号注册之后调用:

instance.enableThirdPartySharing(TDThirdPartyShareType.TD_TRACKING)

# 6.Tradplus

在TradPlusSdk.initSdk之前调用:

instance.enableThirdPartySharing(TDThirdPartyShareType.TD_TRAD_PLUS)

# 7.IronSource

在IronSourceSdk初始化之后调用:

instance.enableThirdPartySharing(TDThirdPartyShareType.TD_IRON_SOURCE)

# 8. AppLovin

  • 展示级别

在AppLovinSdk初始化之前调用:

instance.enableThirdPartySharing(TDThirdPartyShareType.TD_APPLOVIN_IMPRESSION)
  • 用户级别

如果要实现变现数据获取,您需要创建 MaxAdRevenueListener,并复写 onAdRevenuePaid() 方法,在该方法中获取变现数据并且通过TA SDK 的enableThirdPartySharing进行数据上报,最后将该监听器传递给 setRevenueListener(),示例代码如下:

void onAdRevenuePaid(final MaxAd ad){
    instance.enableThirdPartySharing(TDThirdPartyShareType.TD_APPLOVIN_USER,ad)
}