提示
此功能处于测试阶段。 如有疑问或功能需求,请联系您的 CSM。
通过集成 Unity LevelPlay(ironSource),您可以在 Airbridge 面板上查看由广告生成的收入。Airbridge 支持与 Unity LevelPlay(ironSource)的 SDK 集成和 S2S 集成。
推荐的集成方式
为了更精确地监测广告绩效,建议同时设置 SDK 集成和 S2S 集成。
在设置 SDK 集成和 S2S 集成之前,请务必确认首次安装的 Airbridge SDK 版本。只有首次安装的 SDK 版本等于或高于特定版本时,才能成功完成所有集成。如果首次安装的 Airbridge SDK 版本低于该版本,集成后可能无法准确统计用户数。
Airbridge 通过 SDK 实时收集数据,并使用通过 S2S 收集的数据对其进行校正。此外,通过 SDK 收集的数据可以用于 SKAN(SKAdNetwork)。
请参考以下文档安装 ironSource SDK:
请在 ironSource SDK 中设置广告收入数据的回调,并通过该回调将广告收入数据传递给 Airbridge SDK。
IronSourceEvents.onImpressionDataReadyEvent += ImpressionDataReadyEvent;
private void ImpressionDataReadyEvent(IronSourceImpressionData impressionData)
{
if (impressionData != null)
{
AirbridgeEvent @event = new AirbridgeEvent("airbridge.adImpression");
var ironSource = new Dictionary<string, object>();
// optional fields
ironSource["auction_id"] = impressionData.auctionId;
ironSource["ad_unit"] = impressionData.adUnit;
ironSource["ad_network"] = impressionData.adNetwork;
ironSource["instance_name"] = impressionData.instanceName;
ironSource["instance_id"] = impressionData.instanceId;
ironSource["country"] = impressionData.country;
ironSource["placement"] = impressionData.placement;
ironSource["revenue"] = impressionData.revenue;
ironSource["precision"] = impressionData.precision;
ironSource["ab"] = impressionData.ab;
ironSource["segment_name"] = impressionData.segmentName;
ironSource["lifetime_revenue"] = impressionData.lifetimeRevenue;
ironSource["encrypted_cpm"] = impressionData.encryptedCPM;
var adPartners = new Dictionary<string, object>();
adPartners["ironSource"] = ironSource;
@event.SetAction(impressionData.adNetwork);
@event.SetLabel(impressionData.placement);
@event.SetValue(impressionData.revenue ?? 0);
@event.AddSemanticAttribute("adPartners", adPartners);
// ironSource has a default currency of USD
@event.AddSemanticAttribute("currency", "USD");
AirbridgeUnity.TrackEvent(@event);
}
}
import AirBridge
import IronSource
class ISImpressionDataManager: NSObject, ISImpressionDataDelegate {
func impressionDataDidSucceed(_ impressionData: ISImpressionData!) {
if let impressionData = impressionData {
var ironSource: [String: Any] = [:]
// optional fields
ironSource["auction_id"] = impressionData.auction_id
ironSource["ad_unit"] = impressionData.ad_unit
ironSource["ad_network"] = impressionData.ad_network
ironSource["instance_name"] = impressionData.instance_name
ironSource["instance_id"] = impressionData.instance_id
ironSource["country"] = impressionData.country
ironSource["placement"] = impressionData.placement
ironSource["revenue"] = impressionData.revenue
ironSource["precision"] = impressionData.precision
ironSource["ab"] = impressionData.ab
ironSource["segment_name"] = impressionData.segment_name
ironSource["lifetime_revenue"] = impressionData.lifetime_revenue
ironSource["encrypted_cpm"] = impressionData.encrypted_cpm
var adPartners: [String: Any] = [:]
adPartners["ironSource"] = ironSource
var semanticAttributes: [String: Any] = [:]
semanticAttributes["adPartners"] = adPartners
// ironSource has a default currency of USD
semanticAttributes["currency"] = "USD"
guard let event = ABInAppEvent() else { return }
event.setCategory("airbridge.adImpression")
event.setAction(impressionData.ad_network)
event.setLabel(impressionData.placement)
event.setValue(impressionData.revenue)
event.setSemantics(semanticAttributes)
event.send()
}
}
}
#import "AirBridge.h"
#import "ISImpressionDataManager.h"
@interface ISImpressionDataManager () <ISImpressionDataDelegate>
@end
@implementation ISImpressionDataManager
- (void)impressionDataDidSucceed:(ISImpressionData *)impressionData {
if (impressionData) {
NSMutableDictionary *ironSource = [NSMutableDictionary dictionary];
// optional fields
ironSource[@"auction_id"] = impressionData.auction_id;
ironSource[@"ad_unit"] = impressionData.ad_unit;
ironSource[@"ad_network"] = impressionData.ad_network;
ironSource[@"instance_name"] = impressionData.instance_name;
ironSource[@"instance_id"] = impressionData.instance_id;
ironSource[@"country"] = impressionData.country;
ironSource[@"placement"] = impressionData.placement;
ironSource[@"revenue"] = impressionData.revenue;
ironSource[@"precision"] = impressionData.precision;
ironSource[@"ab"] = impressionData.ab;
ironSource[@"segment_name"] = impressionData.segment_name;
ironSource[@"lifetime_revenue"] = impressionData.lifetime_revenue;
ironSource[@"encrypted_cpm"] = impressionData.encrypted_cpm;
NSMutableDictionary *adPartners = [NSMutableDictionary dictionary];
adPartners[@"ironSource"] = ironSource;
NSMutableDictionary *semanticAttributes = [NSMutableDictionary dictionary];
semanticAttributes[@"adPartners"] = adPartners;
// ironSource has a default currency of USD
semanticAttributes[@"currency"] = @"USD";
ABInAppEvent *event = [[ABInAppEvent alloc] init];
[event setCategory:@"airbridge.adImpression"];
[event setAction:impressionData.ad_network];
[event setLabel:impressionData.placement];
[event setValue:impressionData.revenue];
[event setSemantics:semanticAttributes];
[event send];
}
}
@end
@Override
public void onImpressionSuccess(ImpressionData impressionData) {
if (impressionData != null) {
Event event = new Event("airbridge.adImpression");
Map<String, Object> ironSource = new HashMap<>();
// optional fields
ironSource.put("auction_id", impressionData.getAuctionId());
ironSource.put("ad_unit", impressionData.getAdUnit());
ironSource.put("ad_network", impressionData.getAdNetwork());
ironSource.put("instance_name", impressionData.getInstanceName());
ironSource.put("instance_id", impressionData.getInstanceId());
ironSource.put("country", impressionData.getCountry());
ironSource.put("placement", impressionData.getPlacement());
ironSource.put("revenue", impressionData.getRevenue());
ironSource.put("precision", impressionData.getPrecision());
ironSource.put("ab", impressionData.getAb());
ironSource.put("segment_name", impressionData.getSegmentName());
ironSource.put("lifetime_revenue", impressionData.getLifetimeRevenue());
ironSource.put("encrypted_cpm", impressionData.getEncryptedCPM());
Map<String, Object> adPartners = new HashMap<>();
adPartners.put("ironSource", ironSource);
Map<String, Object> semanticAttributes = new HashMap<>();
semanticAttributes.put("adPartners", adPartners);
// ironSource has a default currency of USD
semanticAttributes.put("currency", "USD");
event.setAction(impressionData.getAdNetwork());
event.setLabel(impressionData.getPlacement());
event.setValue(impressionData.getRevenue());
event.setSemanticAttributes(semanticAttributes);
Airbridge.trackEvent(event);
}
}
override fun onImpressionSuccess(impressionData: ImpressionData?) {
if (impressionData != null) {
val event = Event("airbridge.adImpression")
val ironSource = mutableMapOf<String, Any?>()
// optional fields
ironSource["auction_id"] = impressionData.auctionId
ironSource["ad_unit"] = impressionData.adUnit
ironSource["ad_network"] = impressionData.adNetwork
ironSource["instance_name"] = impressionData.instanceName
ironSource["instance_id"] = impressionData.instanceId
ironSource["country"] = impressionData.country
ironSource["placement"] = impressionData.placement
ironSource["revenue"] = impressionData.revenue
ironSource["precision"] = impressionData.precision
ironSource["ab"] = impressionData.ab
ironSource["segment_name"] = impressionData.segmentName
ironSource["lifetime_revenue"] = impressionData.lifetimeRevenue
ironSource["encrypted_cpm"] = impressionData.encryptedCPM
val adPartners = mapOf("ironSource" to ironSource)
event.action = impressionData.adNetwork
event.label = impressionData.placement
event.value = impressionData.revenue
event.semanticAttributes = mutableMapOf(
"adPartners" to adPartners,
"currency" to "USD" // ironSource has a default currency of USD
)
Airbridge.trackEvent(event)
}
}
为了进行 S2S 集成,需要 Unity LevelPlay 的 Secret Key 和 Refresh Token。请在 Unity LevelPlay 中获取 Secret Key 和 Refresh Token 后,将其注册至 Airbridge 面板。
有关详细的集成方法,请参阅以下指南:
Was this page helpful?