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 OnImpression callbacks on each ad format.
Field | Data type | Description |
---|---|---|
Revenue | decimal | Estimated revenue that the ad generated. |
Ecpm | decimal | Ecpm value for the ad. |
PlacementId | string | Placement id of the waterfall used to load this ad. |
NetworkName | string | Name of the network used to render this ad. |
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.OnImpression += HandleOnImpression;
// [...]
private void HandleOnImpression(string placementId, ImpressionData impressionData)
{
var adRevenue = new AdjustAdRevenue(AdjustConfig.AdjustAdRevenueSourcePublisher);
adRevenue.setRevenue((double)impressionData.Revenue, "USD");
adRevenue.setAdRevenueNetwork(impressionData.NetworkName);
adRevenue.setAdRevenueUnit(impressionData.PlacementId);
Adjust.trackAdRevenue(adRevenue);
}
AppsFlyer
XMediatorAds.Interstitial.OnImpression += HandleOnImpression;
// [...]
private void HandleOnImpression(string placementId, ImpressionData impressionData)
{
Dictionary<string, string> eventValues = new Dictionary<string, string>();
eventValues.Add(AFInAppEvents.CURRENCY, "USD");
eventValues.Add(AFInAppEvents.REVENUE, impressionData.Revenue.ToString());
AppsFlyer.sendEvent("af_ad_revenue", eventValues);
}
Singular
XMediatorAds.Interstitial.OnImpression += HandleOnImpression;
// [...]
private void HandleOnImpression(string placementId, ImpressionData impressionData)
{
SingularAdData data = new SingularAdData("XMediator", "USD", (double)impressionData.Revenue);
data.WithAdUnitId(impressionData.PlacementId).
WithNetworkName(impressionData.NetworkName);
Singular.AdRevenue(data);
}