adjust-icon

TradPlus SDK 集成

如果您想使用 TradPlus SDK 监测广告收入,可以借助 SDK 到 SDK 集成,将数据发送到 Adjust 服务器。

操作前须知

要将 Adjust SDK 集成进应用,请按集成指南中的说明操作。

示例

如需通过 Adjust 记录广告收入信息,请在OnGlobalAdImpression函数中创建一个AdjustAdRevenue实例。请参阅发送广告收入信息指南了解更多信息。

void OnGlobalAdImpression(Dictionary<string, object> adInfo)
{
var revenue = double.Parse(adInfo["ecpm"], System.Globalization.CultureInfo.InvariantCulture) / 1000;
var unitId = "";
var adType = "";
var networkName = "";
AdjustAdRevenue adRevenue = new AdjustAdRevenue(Json.Serialize(adInfo));
#if UNITY_IOS
unitId = adInfo["adunit_id"];
adType = adInfo["adType"];
networkName = adInfo["adNetworkName"];
#else
unitId = adInfo["tpAdUnitId"];
adType = adInfo["format"];
networkName = adInfo["adSourceName"];
#endif
adRevenue.SetRevenue(revenue, "USD");
adRevenue.AdRevenueUnit = unitId;
adRevenue.AdRevenuePlacement = adType;
adRevenue.AdRevenueNetwork = networkName;
Adjust.TrackAdRevenue(adRevenue);
}