Mediation Impression Level Revenue Data API
Use the Mediation Impression Level Revenue Data (ILRD) API to access impression stats based on the performance of one of your games. Download a CSV file to view data for a specific platform that the game is on (iOS or Android), per app, per day.
Note: Impression event data is not included on the Mediation Reporting page.
The Mediation Impression Level Revenue Data API uses rate limiting to control server request/response load. Requests are limited on a per-app basis to:
- 1 request per second
- 50 requests per 30 minutes
The Mediation Impression Level Revenue Data API requires an API key that is associated with your Unity developer account. To access your API Key, go to the Unity Dashboard and then create a service account with the Mediation Reporting API Viewer role. For more information on how to manage service accounts, see the Unity Admin API Authentication documentation.
After you have created a key, you can authenticate with the API. For more information, see the Unity Services API documentation.
The following image displays an example of where you can find the Mediation Reporting API Viewer role, which you must enable on your service account to use the Mediation Impression Level Revenue Data API.
Data availability range
The following data availability range limits apply to impression event data reporting when using the Mediation Impression Level Revenue Data API:
No more than 180 days prior to the current date
Prior or equal to 2 days before the current date
Note: Data reporting for a specified date is available two days later at UTC 00:00:00 (Coordinated Universal Time).
Report data can be updated up to 31 days after the event date to account for retroactive ad network data updates.
The Mediation Impression Level Revenue Data API includes fields that you can use to specify which dimensions and metrics should be included in the report. If nothing is specified, or if no valid dimensions or metrics are supplied, then the report uses default dimensions and metrics.
To make a request, use the following format:
The API request uses the following fields:
|app_id||The ID of a platform version of a project.|
|api_key||The Unity Mediation reporting API key.||See Authentication.|
|date||The day of the report.||ISO-8601|
|organization_id||The ID of the organization|
|return_fields||A list of requested fields. If this is left blank, then the default fields are returned.||See Return fields.|
The Mediation Impression Level Revenue Data API response is a URL to a CSV file. Access to this CSV file is unauthenticated and expires after 10 minutes.
The API response returns the following fields:
|status||The response status code.||See the status codes documentation.|
|url||A URL to the CSV file.|
Note: The API can take up to approximately 30 seconds to respond.
The following table lists the impression event data that you can retrieve in the CSV file that is generated by using the Mediation Impression Level Revenue Data API.
|ad_source_instance_id||The ID of the ad network’s Ad Unit, Placement, or Zone.||Default|
|ad_source_name||The name of the ad network that is serving the impression (for example, the ad network ID).||Optional|
The Ad Unit format of the Ad Unit that is serving the impression:
|ad_unit_id||The ID of the Ad Unit that is serving the impression.||Default|
|ad_unit_name||The name of the Ad Unit that is serving the impression.||Default|
|app_id||The ID of a platform version of a project.||Default|
|app_name||The project name.||Optional|
The ISO-2 country code for the device location when the load request occurred.
See the ISO documentation on ISO 3166-1 alpha-2 codes.
|impression_clicked||If the user clicked the impression.||Optional|
|impression_id||The unique impression ID.||Default|
The single impression estimated revenue for an impression event.
For example, a CPM of 2.55 returns a value of 0.00255 for that impression.
Note: Meta revenue data is not available.
|line_item_id||The line item ID for the impression event.||Default|
|line_item_name||The line item name for the impression event.||Optional|
|mediation_network||This is always “Unity”.||Optional|
|os_version||The project operating system: “ios, android”||Optional|
|revenue_currency||The currency denomination of the impression event.||Optional|
The accuracy of the revenue:
|timestamp||The timestamp of the impression event (ISO format).||Default|
As an alternative solution, Unity Mediation also supports a client-side connection that generates reports based on impression revenue data from users. Publishers can pass this event data to mobile measurement partners (MMPs) or connect to their own first-party systems to help with user acquisition efforts.
For more information on how to implement listeners into your code to pass along impression revenue data, see the Unity Mediation documentation on Android impression events and iOS impression events.
The following table lists the error messages that might occur when you use the Mediation Impression Level Revenue Data API.
|Status code||Error message||Description|
query parameters are invalid: (detailed error description)
error generating report: (detailed error description)
|There is something wrong with the parameters passed in the request.|
There is no data available.
|500||There is an internal error.|
For additional assistance with using the Mediation Impression Level Revenue Data API, contact Unity Support.