Integrating ironSource with Mediation

This guide is intended for publishers who want to use the Google Mobile Ads SDK to load and display ads from ironSource through mediation. It covers how to add ironSource to an ad unit's mediation configuration, how to set up ad network optimization, and how to integrate the ironSource SDK and adapter into your Android app.

Supported formats and features

The Ad Manager mediation adapter for ironSource has the following capabilities:

Formats
Banners
Interstitials
Rewarded Video
Rewarded Video (new APIs)
Native Advanced
Features
Smart Banners
Automatic Data Collection

Requirements

  • Android SDK 4.0 (API Level 14) or later
  • Google Play services 17.2.0 or later

Step 1: Set up ironSource

Sign up and sign in to your ironSource account.

To add your application to the ironSource dashboard, click the New App button.

Enter app details

Select Mobile App, enter the Google Play URL of your app, and click Import App Info. Once your app information is displayed, click the Add App button.

If your app is not available, select App Not Live in the Application Store and provide a Temporary Name for your app. Select Android as platform and click Add App.

Take note of your new App Key, which is displayed after the app has been added. You will need this value for setting up your Ad Manager ad unit ID. Select the ad formats your app supports in the appropriate Live tabs. Then click Done.

Instance ID

Next, configure a network instance for the app you added; ironSource supports multiple network instances for rewarded video and interstitial ads.

Navigate to the Ad Units & Placements page from the left nav, select your app in the APPLICATIONS list and click the Edit button.

Select the Add Network Instance link, enter an Instance Name, and click Save.

Once the instance is created, the Instance ID is listed in the Instance Id field.

In addition to the App Key and Instance ID, you'll also need your ironSource User Name and Secret Key to set up your Ad Manager ad unit ID.

Navigate to My Account in your ironSource publisher dashboard to locate your User Name.

Then click the Reporting API tab and take note of your Secret Key.

Step 2: Configure mediation settings for your Ad Manager ad unit

Sign in to your Ad Manager account. Navigate to Delivery > Yield groups and click the New yield group button.

Enter a unique Name for your yield group, set the Status to Active, select your Ad Format, and set the Inventory type to Mobile App. Under the Targeting > Inventory section, select the Ad Unit ID to which you want to add mediation.

Next, click the Add yield partner button.

If you already have a Yield partner for ironSource, you can simply select it. Otherwise, select Create a new yield partner.

Select ironSource as the Ad network and enter a unique Name. Enable Mediation and turn on Automatic data collection, and enter the User Name and Secret Key obtained in the previous section. Click Save when done.

Once the Yield partner is selected, choose Mobile SDK mediation as the Integration type, Android as the Platform, and Active as the Status. Enter the App Key and the Instance ID obtained in the previous section and a Default CPM value.

Click Save at the bottom of the page when done.

Using rewarded video ads

In the settings for your rewarded video ad unit, provide values for the reward amount and reward type. Then, to ensure you provide the same reward to the user no matter which ad network is served, check the Override reward settings from third-party ad networks when using mediation box.

If you don't apply this setting, the ironSource adapter passes back the reward specified in the ironSource dashboard when creating the placement.

Step 3: Import the ironSource SDK and adapter

Add the following ironSource Maven repository and implementation dependency with the latest version of the ironSource SDK and adapter in the app-level build.gradle file:

repositories {
    maven {
        url 'https://dl.bintray.com/ironsource-mobile/android-sdk'
    }
}

...

dependencies {
    implementation 'com.google.android.gms:play-services-ads:18.3.0'
    implementation 'com.google.ads.mediation:ironsource:6.10.0.0'
}
...

Manual Integration

  • Download the latest version of the ironSource Android SDK and add it to your project.

  • Download the latest .aar file of the adapter from Bintray and add it to your project.

Step 4: Additional code required

Application lifecycle

Override the onPause() and onResume() methods in each of your activities to call the corresponding ironSource methods as follows:

Java

@Override
public void onResume() {
    super.onResume();
    IronSource.onResume(this);
}

@Override
public void onPause() {
    super.onPause();
    IronSource.onPause(this);
}

Kotlin

public override fun onResume() {
    super.onResume()
    IronSource.onResume(this)
}

public override fun onPause() {
    super.onPause()
    IronSource.onPause(this)
}

Proguard Rules

If you shrink, obfuscate, and optimize your app , IronSource requires additional ProGuard rules to your project. Consult IronSource's Android SDK Integration guide for more information.

Step 5: Test your implementation

To enable test ads on ironSource, run your ads integrated app and check the logs for a message that looks like this:

Copy your GAID (which is your device's Advertising ID) to your clipboard.

Navigate to the MONETIZE tab and click the Testing button. Next, click the New Test Device button.

Enter the Device Name and Advertising ID (from the previous step). Then click Save.

The newly added test device is listed under TEST DEVICES. You can activate or deactivate Test Ads in this module as required.

Optional steps

Under the Google EU User Consent Policy, you must ensure that certain disclosures are given to, and consents obtained from, users in the European Economic Area (EEA) regarding the use of device identifiers and personal data. This policy reflects the requirements of the EU ePrivacy Directive and the General Data Protection Regulation (GDPR). When seeking consent, you must identify each ad network in your mediation chain that may collect, receive, or use personal data and provide information about each network's use. Google currently is unable to pass the user's consent choice to such networks automatically.

The section below shows you how to enable or disable personalized ads for ironSource.

In SDK version 6.7.9, ironSource added a consent API. The following sample code sets consent to true on the ironSource SDK. If you choose to call this method, it is recommended that you do so prior to requesting ads via the Google Mobile Ads SDK.

import com.ironsource.mediationsdk.IronSource;
...

IronSource.setConsent(true);

See ironSource's managing consent documentation for more details.

IronSource Android Mediation Adapter Changelog

Version 6.11.0.0

  • Verified compatibility with ironSource SDK version 6.11.0.
  • Updated the minimum required Google Mobile Ads SDK version to 18.3.0.

Built and tested with:

  • Google Mobile Ads SDK version 18.3.0.
  • IronSource SDK version 6.11.0.

Version 6.10.0.0

  • Verified compatibility with ironSource SDK version 6.10.0.
  • Updated the minimum required Google Mobile Ads SDK version to 18.2.0.

Version 6.9.1.0

  • Verified compatibility with ironSource SDK version 6.9.1.

Version 6.9.0.1

  • Fixed ironSource adapter to remove it's lock on an instance ID.
  • Updated the minimum required Google Mobile Ads SDK version to 18.1.1.

Version 6.9.0.0

  • Verified compatibility with ironSource SDK version 6.9.0.
  • Updated the minimum required Google Mobile Ads SDK version to 18.1.0.

Version 6.8.4.1

  • Added support to request multiple interstitial ads.

Version 6.8.4.0

  • Verified compatibility with ironSource SDK version 6.8.4.

Version 6.8.1.2

  • Fixed an issue where loading rewarded ads always failed to load if an interstitial ad was loaded first.

Version 6.8.1.1

  • Updated adapter to support new open-beta Rewarded API.
  • Updated the minimum required Google Mobile Ads SDK version to 17.2.0.

Version 6.8.1.0

  • Verified compatibility with ironSource SDK version 6.8.1.

Version 6.7.12.0

  • Verified compatibility with ironSource SDK version 6.7.12.

Version 6.7.11.0

  • Verified compatibility with ironSource SDK version 6.7.11.

Version 6.7.10.0

  • Verified compatibility with ironSource SDK version 6.7.10.

Version 6.7.9.1.1

  • Updated the adapter to invoke the onRewardedVideoComplete() ad event.

Version 6.7.9.1.0

  • Verified compatibility with ironSource SDK version 6.7.9.1.

Version 6.7.9.0

  • Verified compatibility with ironSource SDK version 6.7.9.

Version 6.7.8.0

  • Verified compatibility with ironSource SDK version 6.7.8.

Version 6.7.7.0

  • Initialize IronSource SDK once per ad unit.
  • Added option to pass activity to IronSource SDK in onPause and onResume methods.
  • Verified compatibility with ironSource SDK version 6.7.0.

Version 6.7.5.0

  • Initial release.