User Ad Revenue API

In this article you’ll learn how to use the ironSource User Ad Revenue API in order to retrieve statistics about your user level ad revenue.

Get your user level ad revenue report with ironSource and your mediated ad networks, including multiple breakdowns such as user ID, Device ID, ad unit, Country, Ad Network, Segment and Placement. Note that the revenue is calculated based on each user impression eCPM according to the App, Day, network, country, instance.

Before you start

  • Pulling user level statistics is done by these 2 steps:
    • API request for report URL, returns with a link to download the report
    • Download the report from the provided link
  • Each API call is per app per day and data is stored and available until 14 days backwards
  • The data for the day before yesterday is available starting today 10:00 AM UTC
  • To get the full list of all your applications that are using monetization ad units via API go to this Article 

Get Your Authentication

First, you’ll need to add an authorization header for authentication.

Authentication is based on Basic HTTP Authentication with HTTPS. The HTTP Authorization header is created based on the base64 version of username:secret key.

  • username is the login/email that is used to login to our system.
  • The secret key parameter is unique for your ironSource account. To retrieve it, click on your user profile on the top right corner of the screen, and select ‘My Account’. You will find the secret key in the Reporting API section:
    ironsource-platform-monetization-reporting-api-secret-key
  • PHP code example for generating username:secret key:
     <?php
    $crl = curl_init();
    $base64encoded = base64_encode("[username]:[secret key]");
    $header = array();
    $header[] = 'Authorization: Basic '. $base64encoded;
     $URL='https://platform.ironsrc.com/partners/userAdRevenue;
     curl_setopt($crl, CURLOPT_URL, $URL);
    curl_setopt($crl, CURLOPT_HTTPHEADER, $header);
     $response = curl_exec($crl);
     curl_close($crl);
     ?>

API request for report URL

 Note: A valid API hit returns a link to the requested file, the file will be available for download for one hour only. 

Method

GET  platform.ironsrc.com/partners/userAdRevenue

Parameters

Name Type Description Mandatory
date String YYYY-MM-DD (UTC Timezone) Yes
appKey String Application Key (as seen on our platform). Yes
reportType Integer Supporting different report types. At the moment, should always set to 1 Yes

Request Example URL

https://platform.ironsrc.com/partners/userAdRevenue?appKey=12345678&date=2018-15-05&reportType=1

Response Example URL

https://user-ad-revenue.s3.amazonaws.com/data/bi_databases/uar/tables/network/report_version%3Dv1/publisher_id%3D138101/application_id%3D100411/day%3D2018-07-13/000000.gz?AWSAccessKeyId=AKIAILCCGIXP5G2XNXBA&Expires=1532524582&Signature=1U%2FbrLmb%2F7TwXXdoHtb%2F%2FQjrmz0%3D

Download the report

Simply call the URL in order to fetch the report

Understand the report

Note: The report is generated without columns titles.

The columns titles and order is as followed:

  • Ad Unit
  • Advertising ID
  • Advertising ID Type
  • User ID
  • Segment
  • Placement
  • Ad Network
  • Impressions
  • Revenue

Fields Definition

 

Field Description Example
Ad Unit The ad unit from which the revenue was generate from
rewarded_video
Advertising ID The unique ID of the user’s device
21d0e51a-772d-4b23-9fc4-296126b4f123
Advertising ID Type The unique ID type of the user’s device
IDFA/IDFV/GAID
User ID The user ID being set by the developer 135920
Segment The segment the user is related to as defined on the platform Tier 1
Placement The placement the user is related to as defined on the platform
Home_Screen
Ad Network The network which displayed the ad to the user Admob
Impressions The number of ads displayed to the user 1000
Revenue The Revenue generated by the user (USD) 0.5

* Date & App Key aren’t included as they are unique per report (file)