---
code: unreal_sdk_thirdparty
name: "三方数据"
wikiToken: XsYtwhJSXizJEVkaEuJcAyy8nUd
parentWikiToken: SpNbwbJcEi1MnPkeumQcK3M8nNg
updateTime: 1745309720000
sourceUrl: https://docs-v2.thinkingdata.cn/?version=v5.0&lan=zh-CN&code=unreal_sdk_thirdparty
---
# 三方数据

从v1.5.0开始支持三方数据接入功能，以下是同步多个平台数据的示例代码:

```
TArray<FString> EventTypeList;
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeAPPSFLYER"));
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeIRONSOURCE"));
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeADJUST"));
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeBRANCH"));
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTOPON"));
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTRACKING"));
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTRADPLUS"));
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
```

如果需要增加自定义参数，可以使用EnableThirdPartySharingWithCustomProperties：

```
TArray<FString> EventTypeList;
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeAPPSFLYER"));
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeIRONSOURCE"));
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeADJUST"));
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeBRANCH"));
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTOPON"));
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTRACKING"));
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTRADPLUS"));

TSharedPtr<FJsonObject> m_DataJsonObject = MakeShareable(new FJsonObject);
m_DataJsonObject->SetStringField(TEXT("thirdkey1"), TEXT("thirdvalue1"));
m_DataJsonObject->SetStringField(TEXT("thirdkey2"), TEXT("thirdvalue2"));
UTDAnalytics::EnableThirdPartySharingWithCustomProperties(EventTypeList, m_DataJsonObject, AppID);
```

### 1.Appsflyer

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

```
TArray<FString> EventTypeList;
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeAPPSFLYER"));
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
```

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

```
UTDAnalytics::Login("account_id", AppID);
TArray<FString> EventTypeList;
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeAPPSFLYER"));
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
```

如果调用了 AE 的Login方法（会修改account_id）或者Identify方法（会修改distinct_id），需要再次调用EnableThirdPartySharing同步数据。

注意：如果您也需要调用AppsFlyer SDK的setAdditionalData方法，可以通过EnableThirdPartySharingWithCustomProperties将参数传递给 TE，AE SDK内部会将参数进行拼接合并。

```
TArray<FString> EventTypeList;
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeAPPSFLYER"));
TSharedPtr<FJsonObject> m_DataJsonObject = MakeShareable(new FJsonObject);
m_DataJsonObject->SetStringField(TEXT("thirdkey1"), TEXT("thirdvalue1"));
m_DataJsonObject->SetStringField(TEXT("thirdkey2"), TEXT("thirdvalue2"));
UTDAnalytics::EnableThirdPartySharingWithCustomProperties(EventTypeList, m_DataJsonObject, AppID);
```

### 2.Adjust

在Adjust SDK初始化之前调用。 

```
TArray<FString> EventTypeList;
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeADJUST"));
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
```

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

```
UTDAnalytics::Login("account_id", AppID);
TArray<FString> EventTypeList;
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeADJUST"));
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
```

### 3.Branch

在Branch initialize the session之前调用。 

```
TArray<FString> EventTypeList;
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeBRANCH"));
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
```

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

```
UTDAnalytics::Login("account_id", AppID);
TArray<FString> EventTypeList;
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeBRANCH"));
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
```

### 4.TopOn

在ATSDK.*init之前调用。*

```
TArray<FString> EventTypeList;
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTOPON"));
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
```

注意：如果您也需要调用ATSDK的initCustomMap方法，可以通过EnableThirdPartySharingWithCustomProperties将参数传递给 TE，AE SDK内部会将参数进行拼接合并。

```
TArray<FString> EventTypeList;
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTOPON"));
TSharedPtr<FJsonObject> m_DataJsonObject = MakeShareable(new FJsonObject);
m_DataJsonObject->SetStringField(TEXT("thirdkey1"), TEXT("thirdvalue1"));
m_DataJsonObject->SetStringField(TEXT("thirdkey2"), TEXT("thirdvalue2"));
UTDAnalytics::EnableThirdPartySharingWithCustomProperties(EventTypeList, m_DataJsonObject, AppID);
```

### 5.Tradplus

在TradPlusSdk.*initSdk之前调用。*

```
TArray<FString> EventTypeList;
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTRADPLUS"));
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
```

### 6.IronSource

在IronSourceSdk初始化之后调用。

```
TArray<FString> EventTypeList;
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeIRONSOURCE"));
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
```
