Impression-Level Ad Revenue
You're able to use impression-level ad revenue data for any MMP or analytics
platform using optional callback of AdObjectDelegate
interface that provides AdRevenue
object
as an argument.
public protocol AdRevenue {
@objc var revenue: Price { get }
@objc var precision: RevenuePrecision { get }
@objc var currency: Currency { get }
}
To get the revenue data, you need to implement AdObjectDelegate
interface:
- Swift
- Objective-C
func adObject(
_ adObject: AdObject,
didPay revenue: AdRevenue,
ad: Ad
) {
let value = revenue.revenue
let currency = revenue.currency
let networkName = ad.networkName
let demandSourceName = ad.dsp
let adType = ad.adType
let bidType = ad.bidType
let adUnitId = ad.adUnitId
}
- (void)adObject:(id<BDNAdObject>)adObject didPay:(id<BDNAdRevenue>)revenue ad:(id<BDNAd>)ad {
double value = [revenue revenue];
NSString *currency = [revenue currency];
NSString *networkName = [ad networkName];
NSString *demandSourceName = [ad dsp];
AdType adType = [ad adType];
BDNAdBidType bidType = [ad bidType];
NSString *adUnitId = [ad adUnitId];
}