# 三方数据
从 v2.8.3 开始使用cocopoads方式来集成:
pod 'TAThirdParty'
从 v2.8.0 开始支持三方数据接入功能,以下是同步多个平台数据的示例代码:
[[ThinkingAnalyticsSDK sharedInstance] enableThirdPartySharing:TDThirdPartyShareTypeAPPSFLYER | TDThirdPartyShareTypeADJUST |TDThirdPartyShareTypeTRADPLUS | TDThirdPartyShareTypeTRACKING | TDThirdPartyShareTypeTOPON | TDThirdPartyShareTypeBRANCH | TDThirdPartyShareTypeIRONSOURCE];
如果需要增加额外参数,可以使用enableThirdPartySharing:customMap
,该API不支持位运算
# 一、 Appsflyer
在AppsFlyer SDK调用start方法之前调用API
[[ThinkingAnalyticsSDK sharedInstance] enableThirdPartySharing: TDThirdPartyShareTypeAPPSFLYER];
注册创角色之后(可选)
[[ThinkingAnalyticsSDK sharedInstance] login:@"account_id"];
[[ThinkingAnalyticsSDK sharedInstance] enableThirdPartySharing: TDThirdPartyShareTypeAPPSFLYER customMap:@{@"ta_data11":@"ta_value11"}];
每次调用了TE的login
方法或者identify
方法,您需要同步调用enableThirdPartySharing更新用户标识。
注意:由于AppFlyer的setAdditionalData每次调用,会覆盖设置的用户标识。您可以通过我们提供的enableThirdPartySharing
方法设置参数:
NSDictionary *dic = @{@"af_test_key1": @"test1",@"af_test_key2": @"test2"};
[AppsFlyerLib.shared setAdditionalData:dic];
因为setAdditionalData调用多次,会覆盖之前的参数,可以将参数传递给TA,TASDK内部会将参数进行拼接合并
NSDictionary *dic = @{@"af_test_key1": @"test1",@"af_test_key2": @"test2"};
[[ThinkingAnalyticsSDK sharedInstance] enableThirdPartySharing: TDThirdPartyShareTypeAPPSFLYER customMap: dic];
# 二、Adjust
在Adjust SDK初始化之前调用
[[ThinkingAnalyticsSDK sharedInstance] enableThirdPartySharing:TDThirdPartyShareTypeADJUST];
注册创角色之后(可选)
[[ThinkingAnalyticsSDK sharedInstance] login:@"account_id"];
[[ThinkingAnalyticsSDK sharedInstance] enableThirdPartySharing:TDThirdPartyShareTypeADJUST];
# 三、Branch
在Branch SDK初始化之前调用
[[ThinkingAnalyticsSDK sharedInstance] enableThirdPartySharing:TDThirdPartyShareTypeBRANCH];
注册创角色之后(可选)
[[ThinkingAnalyticsSDK sharedInstance] login:@"account_id"];
[[ThinkingAnalyticsSDK sharedInstance] enableThirdPartySharing:TDThirdPartyShareTypeBRANCH];
# 四、TopOn
在ATSDK初始化之前调用:
[[ThinkingAnalyticsSDK sharedInstance] enableThirdPartySharing:TDThirdPartyShareTypeTOPON];
多次调用TE的login
或者identify
,需要再次调用enableThirdPartySharing同步数据。
注意:由于TopOn的setCustomData
每次调用,会覆盖设置的用户标识。您可以通过我们提供的enableThirdPartySharing
方法设置参数:
NSDictionary *dic = @{@"af_test_key1": @"test1",@"af_test_key2": @"test2"};
[[ThinkingAnalyticsSDK sharedInstance] enableThirdPartySharing:TDThirdPartyShareTypeTOPON customMap: dic];
# 五、热云
在账号注册之后调用
[[ThinkingAnalyticsSDK sharedInstance] enableThirdPartySharing:TDThirdPartyShareTypeTRACKING];
# 六、Tradplus
在TradPlusSdk初始化之前调用
[[ThinkingAnalyticsSDK sharedInstance] enableThirdPartySharing:TDThirdPartyShareTypeTRADPLUS];
# 七、IronSource
在IronSourceSdk初始化之后调用
[[ThinkingAnalyticsSDK sharedInstance] enableThirdPartySharing: TDThirdPartyShareTypeIRONSOURCE];
# 八、AppLovin
在AppLovinSdk初始化之后调用
[[ThinkingAnalyticsSDK sharedInstance] enableThirdPartySharing: TAThirdPartyShareTypeAPPLOVIN];