Ad revenue API
ironSource App Analytics provides analysis of the application revenue from ads. The analysis is performed based on the impression data available via the relevant callback from your ad mediation.
Analyzing the ad revenue within the application rely on two phases:
- Impression level revenue callback registration
- Ad revenue API
* ironSource App Analytics only supports the ironSource impression data
Impression level revenue callback registration
Prior to the App Analytics SDK initialization, register to your mediation callback for receiving ad impression level data
ironSource Impression level revenue
The API for registration to the ironSource impression level revenue callback can be found here
Ad revenue API
Use this API to pass the impression data of the ads viewed by the user, to allow the ad revenue analysis. This will include the relevant ad unit type, the revenue and other information. Add this API to your mediation ad revenue callback function
Pass all impression data as received to the App Analytics SDK, without any update
// The Ad revenue API
IronSourceAnalytics.updateImpressionData(ISAnalyticsMediationName mediationName, string json);
Parameters
- ISAnalyticsMediationName mediationName – The type of mediation that is the source of the impression data.
- Currently, the only enumeration value is IRONSOURCE.
- string json – The impression data JSON as string. Should be passed as a whole
Note:
All parameters are mandatory
Example of Ad revenue update API
// Example of Ad revenue usage. Registration pre-init to the relevant mediation callback and pass the ad revenue data to analytics API
IronSourceEvents.onImpressionDataAdReadyEvent += ImpressionDataAdReadyEventIronSourceAnalytics;
// ironSource mediation Ad revenue callback registration and passing the data to analytics
private void ImpressionDataAdReadyEventIronSourceAnalytics(IronSourceImpressionData impressionData)
{
IronSourceAnalytics.updateImpressionData(ISAnalyticsMediationName.IRONSOURCE, impressionData.allData);
}
// init the ironSource App Analytics SDK