Impression-level ad revenue
Impression-level ad revenue provides you with a granular calculation of how much revenue was generated by each ad impression.
ImpressionData interface
The ImpressionData interface is passed as a parameter of the onImpression
callback in each ad format hook (e.g., useBannerEvents
, useInterstitialEvents
, useRewardedEvents
).
Field | Data type | Description |
---|---|---|
revenue | number | Estimated revenue that the ad generated. |
ecpm | number | 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. |
id | string | Unique identifier generated for the impression. |
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
useRewardedEvents(
{
onImpression: (placementId, impressionData) => {
// You have to map the sdk's mediation values to adjust expected ones. eg, 'applovin_max_sdk'
const source = impressionData.mediation;
var adjustAdRevenue = new AdjustAdRevenue(source);
adjustAdRevenue.setRevenue(impressionData.revenue, "USD");
adjustAdRevenue.setAdRevenueNetwork(impressionData.adNetwork);
adjustAdRevenue.setAdRevenueUnit(impressionData.placementId);
Adjust.trackAdRevenue(adjustAdRevenue);
},
},
[]
);
AppsFlyer
useRewardedEvents(
{
onImpression: (placementId, impressionData) => {
// You have to map the impressionData.mediation value to the expected ones. eg, 'MEDIATION_NETWORK.IRONSOURCE'
const mediation = MEDIATION_NETWORK.IRONSOURCE;
const adRevenueData = {
monetizationNetwork: impressionData.adNetwork,
mediationNetwork: mediation,
currencyIso4217Code: 'USD',
revenue: impressionData.revenue,
additionalParameters: {},
};
appsFlyer.logAdRevenue(adRevenueData);
},
},
[]
);
Singular
useRewardedEvents(
{
onImpression: (placementId, impressionData) => {
// You have to map the impressionData.mediation value to the expected ones. eg, 'AppLovin'
const mediation = 'AppLovin';
const adData = {
adPlatform: mediation,
currency: "USD",
revenue: impressionData.revenue,
};
Singular.adRevenue(adData);
},
},
[]
);