알립니다
이 기능은 베타 서비스입니다. 개선 의견과 문의사항은 에어브릿지 CSM을 통해 전달해 주세요. 담당 CSM이 없는 경우 문의하기를 통해 전달해 주세요. 정식 서비스에서 발전한 기능으로 보답하겠습니다.
에어브릿지와 TradPlus를 연동해 광고로 발생한 수익과 관련한 데이터를 에어브릿지 대시보드에서 확인할 수 있습니다. 에어브릿지는 TradPlus와의 SDK 연동을 지원합니다.
아래 링크에 따라 TradPlus SDK를 설치해 주세요.
TradPlus에서 발생한 광고 수익 데이터를 에어브릿지로 전송합니다. 먼저 TradPlus SDK에 광고 수익 데이터 콜백을 설정합니다. 해당 콜백을 활용해 광고 수익 데이터를 에어브릿지 SDK로 전송합니다.
TradplusAds.Instance().AddGlobalAdImpression(OnGlobalAdImpression);
// ...
void OnGlobalAdImpression(Dictionary<string, object> adInfo)
{
string adPlatform = "TradPlus";
var adNetwork = "";
var adUnit = "";
var adFormat = "";
#if UNITY_IOS
adNetwork = adInfo["adNetworkName"] as string;
adUnit = adInfo["adunit_id"] as string;
adFormat = adInfo["adType"] as string;
#else
adNetwork = adInfo["adSourceName"] as string;
adUnit = adInfo["tpAdUnitId"] as string;
adFormat = adInfo["format"] as string;
#endif
var currency = "USD";
var revenue = double.Parse(adInfo["ecpm"] as string, System.Globalization.CultureInfo.InvariantCulture) / 1000;
AirbridgeEvent @event = new AirbridgeEvent("airbridge.adImpression");
var tradPlus = new Dictionary<string, object>();
tradPlus["ad_platform"] = adPlatform;
tradPlus["ad_network"] = adNetwork;
tradPlus["ad_unit"] = adUnit;
tradPlus["ad_format"] = adFormat;
tradPlus["value"] = revenue;
var adPartners = new Dictionary<string, object>();
adPartners["tradPlus"] = tradPlus;
@event.SetAction(adUnit);
@event.SetLabel(adFormat);
@event.SetValue(revenue);
@event.AddSemanticAttribute("adPartners", adPartners);
@event.AddSemanticAttribute("currency", currency);
AirbridgeUnity.TrackEvent(@event);
}
let adPlatform = "TradPlus"
guard let adNetwork = adInfo["adNetworkName"] as? String else { return }
guard let adUnit = adInfo["adunit_id"] as? String else { return }
guard let adFormat = adInfo["adType"] as? String else { return }
guard let currency = "USD"
guard let ecpm = adInfo["ecpm"] as? String else { return }
let revenue = NSNumber(value: (Float(ecpm) ?? 0) / 1000.0)
let event = ABInAppEvent()
event?.setCategory("airbridge.adImpression")
event?.setAction(adNetwork)
event?.setLabel(adFormat)
event?.setValue(revenue)
event?.setSemantics([
"adPartners": [
"tradPlus": [
"ad_platform": adPlatform,
"ad_network": adNetwork,
"ad_unit": adUnit,
"ad_format": adFormat,
"value": revenue
]
],
"currency": currency
])
event?.send()
- (void)tradPlusAdImpression:(NSDictionary *)adInfo
{
NSString* adPlatform = @"TradPlus";
NSString* adNetwork = adInfo[@"adNetworkName"];
NSString* adUnit = adInfo[@"adunit_id"];
NSString* adFormat = adInfo[@"adType"];
NSString* currency = @"USD";
NSNumber *revenue = [NSNumber numberWithFloat: [adInfo[@"ecpm"] floatValue]/1000.0];
ABInAppEvent* event = [[ABInAppEvent alloc] init];
[event setCategory:@"airbridge.adImpression"];
[event setAction:adNetwork];
[event setLabel:adFormat];
[event setValue:revenue];
[event setSemantics:@{
@"adPartners": @{
@"tradPlus": @{
@"ad_platform": adPlatform,
@"ad_network": adNetwork,
@"ad_unit": adUnit,
@"ad_format": adFormat,
@"value": revenue
}
},
@"currency": currency
}];
[event send];
}
TradPlusSdk.setGlobalImpressionListener { tpAdInfo ->
if (tpAdInfo != null) {
val adPlatform = "TradPlus"
val adNetwork = tpAdInfo.adSourceName
val adUnit = tpAdInfo.tpAdUnitId
val adFormat = tpAdInfo.format
val currency = "USD"
val revenue = tpAdInfo.ecpm.toDouble() / 1000
val event = Event("airbridge.adImpression")
val tradPlus = mutableMapOf<String, Any?>()
tradPlus["ad_platform"] = adPlatform
tradPlus["ad_network"] = adNetwork
tradPlus["ad_unit"] = adUnit
tradPlus["ad_format"] = adFormat
tradPlus["value"] = revenue
val adPartners = mapOf("tradPlus" to tradPlus)
event.action = adNetwork
event.label = adFormat
event.value = revenue
event.semanticAttributes = mutableMapOf(
"adPartners" to adPartners,
"currency" to currency
)
trackEvent(event)
}
}
TradPlusSdk.setGlobalImpressionListener(new GlobalImpressionManager.GlobalImpressionListener() {
@Override
public void onImpressionSuccess(TPAdInfo tpAdInfo) {
if (tpAdInfo != null) {
String adPlatform = "TradPlus";
String adNetwork = tpAdInfo.adSourceName;
String adUnit = tpAdInfo.tpAdUnitId;
String adFormat = tpAdInfo.format;
String currency = "USD";
double revenue = Double.parseDouble(tpAdInfo.ecpm) / 1000;
Event event = new Event("airbridge.adImpression");
Map<String, Object> tradPlus = new HashMap<>();
tradPlus.put("ad_platform", adPlatform);
tradPlus.put("ad_network", adNetwork);
tradPlus.put("ad_unit", adUnit);
tradPlus.put("ad_format", adFormat);
tradPlus.put("value", revenue);
Map<String, Object> adPartners = new HashMap<>();
adPartners.put("tradPlus", tradPlus);
Map<String, Object> semanticAttributes = new HashMap<>();
semanticAttributes.put("adPartners", adPartners);
semanticAttributes.put("currency", currency);
event.setAction(adNetwork);
event.setLabel(adFormat);
event.setValue(revenue);
event.setSemanticAttributes(semanticAttributes);
Airbridge.trackEvent(event);
}
}
});
도움이 되었나요?
TradplusAds.Instance().AddGlobalAdImpression(OnGlobalAdImpression);
// ...
void OnGlobalAdImpression(Dictionary<string, object> adInfo)
{
string adPlatform = "TradPlus";
var adNetwork = "";
var adUnit = "";
var adFormat = "";
#if UNITY_IOS
adNetwork = adInfo["adNetworkName"] as string;
adUnit = adInfo["adunit_id"] as string;
adFormat = adInfo["adType"] as string;
#else
adNetwork = adInfo["adSourceName"] as string;
adUnit = adInfo["tpAdUnitId"] as string;
adFormat = adInfo["format"] as string;
#endif
var currency = "USD";
var revenue = double.Parse(adInfo["ecpm"] as string, System.Globalization.CultureInfo.InvariantCulture) / 1000;
AirbridgeEvent @event = new AirbridgeEvent("airbridge.adImpression");
var tradPlus = new Dictionary<string, object>();
tradPlus["ad_platform"] = adPlatform;
tradPlus["ad_network"] = adNetwork;
tradPlus["ad_unit"] = adUnit;
tradPlus["ad_format"] = adFormat;
tradPlus["value"] = revenue;
var adPartners = new Dictionary<string, object>();
adPartners["tradPlus"] = tradPlus;
@event.SetAction(adUnit);
@event.SetLabel(adFormat);
@event.SetValue(revenue);
@event.AddSemanticAttribute("adPartners", adPartners);
@event.AddSemanticAttribute("currency", currency);
AirbridgeUnity.TrackEvent(@event);
}
- (void)tradPlusAdImpression:(NSDictionary *)adInfo
{
NSString* adPlatform = @"TradPlus";
NSString* adNetwork = adInfo[@"adNetworkName"];
NSString* adUnit = adInfo[@"adunit_id"];
NSString* adFormat = adInfo[@"adType"];
NSString* currency = @"USD";
NSNumber *revenue = [NSNumber numberWithFloat: [adInfo[@"ecpm"] floatValue]/1000.0];
ABInAppEvent* event = [[ABInAppEvent alloc] init];
[event setCategory:@"airbridge.adImpression"];
[event setAction:adNetwork];
[event setLabel:adFormat];
[event setValue:revenue];
[event setSemantics:@{
@"adPartners": @{
@"tradPlus": @{
@"ad_platform": adPlatform,
@"ad_network": adNetwork,
@"ad_unit": adUnit,
@"ad_format": adFormat,
@"value": revenue
}
},
@"currency": currency
}];
[event send];
}
TradPlusSdk.setGlobalImpressionListener { tpAdInfo ->
if (tpAdInfo != null) {
val adPlatform = "TradPlus"
val adNetwork = tpAdInfo.adSourceName
val adUnit = tpAdInfo.tpAdUnitId
val adFormat = tpAdInfo.format
val currency = "USD"
val revenue = tpAdInfo.ecpm.toDouble() / 1000
val event = Event("airbridge.adImpression")
val tradPlus = mutableMapOf<String, Any?>()
tradPlus["ad_platform"] = adPlatform
tradPlus["ad_network"] = adNetwork
tradPlus["ad_unit"] = adUnit
tradPlus["ad_format"] = adFormat
tradPlus["value"] = revenue
val adPartners = mapOf("tradPlus" to tradPlus)
event.action = adNetwork
event.label = adFormat
event.value = revenue
event.semanticAttributes = mutableMapOf(
"adPartners" to adPartners,
"currency" to currency
)
trackEvent(event)
}
}
TradPlusSdk.setGlobalImpressionListener(new GlobalImpressionManager.GlobalImpressionListener() {
@Override
public void onImpressionSuccess(TPAdInfo tpAdInfo) {
if (tpAdInfo != null) {
String adPlatform = "TradPlus";
String adNetwork = tpAdInfo.adSourceName;
String adUnit = tpAdInfo.tpAdUnitId;
String adFormat = tpAdInfo.format;
String currency = "USD";
double revenue = Double.parseDouble(tpAdInfo.ecpm) / 1000;
Event event = new Event("airbridge.adImpression");
Map<String, Object> tradPlus = new HashMap<>();
tradPlus.put("ad_platform", adPlatform);
tradPlus.put("ad_network", adNetwork);
tradPlus.put("ad_unit", adUnit);
tradPlus.put("ad_format", adFormat);
tradPlus.put("value", revenue);
Map<String, Object> adPartners = new HashMap<>();
adPartners.put("tradPlus", tradPlus);
Map<String, Object> semanticAttributes = new HashMap<>();
semanticAttributes.put("adPartners", adPartners);
semanticAttributes.put("currency", currency);
event.setAction(adNetwork);
event.setLabel(adFormat);
event.setValue(revenue);
event.setSemanticAttributes(semanticAttributes);
Airbridge.trackEvent(event);
}
}
});