Skip to content

Impression-level ad revenue

Impression-level ad revenue provides you with a granular calculation of how much revenue was generated by each ad impression.

The XMediator SDK provides this data on the ad's impression callback for you to use in your internal systems or any mobile measurement partner (MMP).

ImpressionData class

The ImpressionData class is passed as a parameter of the didRecordImpression callbacks on each ad format.

Field Data type Description
revenue Double Estimated revenue that the ad generated.
ecpm Double Ecpm value for the ad.
placementId String Placement id of the waterfall used to load this ad.
adNetwork String Name of the network used to render this ad.
mediation String Name of the mediation service used to mediate this ad network.
subNetworkName String Name of the sub network used to render this ad, if available.
creativeId String Id of the creative rendered, if available.
adSpace String The name of the ad space provided when presenting the ad, if available.
waterfallResult LoadResult Describes the result of the waterfall used to load this ad.

SDK-to-SDK integration samples

MMPs usually recommend an SDK-to-SDK integration over a S2S/API one, as they are able to provide less revenue matching discrepancies, more data in real time, and tools such as SKAdNetwork conversion value management based on ad revenue.

Adjust

XMediatorAds.interstitial.addDelegate(self)

// [...]

func didRecordImpression(placementId: String, data: ImpressionData) {
    if let adRevenue = ADJAdRevenue(source: ADJAdRevenueSourcePublisher) {
        adRevenue.setRevenue(data.revenue, currency: "USD")
        adRevenue.setAdRevenueNetwork(data.adNetwork)
        adRevenue.setAdRevenueUnit(data.placementId)

        Adjust.trackAdRevenue(adRevenue)
    }
}
[X3MXMediatorAds.interstitial addDelegate:self];

// [...]

- (void)didRecordImpressionWithPlacementId:(NSString * _Nonnull)placementId data:(X3MImpressionData * _Nonnull)data {
    ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourcePublisher];
    [adRevenue setRevenue:data.revenue currency:@"USD"];
    [adRevenue setAdRevenueNetwork:data.adNetwork];
    [adRevenue setAdRevenueUnit:data.placementId];

    [Adjust trackAdRevenue:adRevenue];
}

AppsFlyer

XMediatorAds.interstitial.addDelegate(self)

// [...]

func didRecordImpression(placementId: String, data: ImpressionData) {
    AppsFlyerAdRevenue.shared()
        .logAdRevenue(monetizationNetwork: data.adNetwork,
                      mediationNetwork: .custom,
                      eventRevenue: NSNumber(value: data.revenue),
                      revenueCurrency: "USD",
                      additionalParameters: nil)
}
[X3MXMediatorAds.interstitial addDelegate:self];

// [...]

- (void)didRecordImpressionWithPlacementId:(NSString * _Nonnull)placementId data:(X3MImpressionData * _Nonnull)data {
    [[AppsFlyerAdRevenue shared]
        logAdRevenueWithMonetizationNetwork:data.adNetwork
        mediationNetwork:AppsFlyerAdRevenueMediationNetworkTypeCustom
        eventRevenue:[NSNumber numberWithDouble:data.revenue]
        revenueCurrency:@"USD"
        additionalParameters:nil];
}

Singular

XMediatorAds.interstitial.addDelegate(self)

// [...]

func didRecordImpression(placementId: String, data: ImpressionData) {
    let singularData = SingularAdData(
        adPlatfrom: data.mediation,
        withCurrency: "USD",
        withRevenue: NSNumber(value: data.revenue)
    )
    singularData.setNetworkName(data.adNetwork)
    singularData.setAdUnitId(data.placementId)

    Singular.adRevenue(singularData)
}
[X3MXMediatorAds.interstitial addDelegate:self];

// [...]

- (void)didRecordImpressionWithPlacementId:(NSString * _Nonnull)placementId data:(X3MImpressionData * _Nonnull)data {
    SingularAdData* singularData = [[SingularAdData alloc]
        initWithAdPlatfrom:data.mediation
        withCurrency:@"USD"
        withRevenue:[NSNumber numberWithDouble:data.revenue]];
    [singularData setNetworkName:data.adNetwork];
    [singularData setAdUnitId:data.placementId];

    [Singular adRevenue:singularData];
}