Integrating IronSource 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 AdMob mediation adapter for IronSource has the following capabilities:

Formats
Banners
Interstitials
Rewarded Video
Native Advanced
Features
Smart Banners
Ad Network Optimization (ANO)

Requirements

  • Android SDK 4.0 (API Level 14) or later
  • Google Play services 9.2 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 AdMob 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 AdMob 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 unit

To add IronSource to the mediation configuration for your ad unit, first sign in to your AdMob account.

Next, navigate to the Mediation tab. If you have an existing mediation group you'd like to modify, click the name of that mediation group to edit it, and skip ahead to Add IronSource as an ad source.

To create a new mediation group, select Create Mediation Group.

Enter your ad format and platform, then click Continue.

Give your mediation group a name and select locations to target. Next, set the mediation group status to Enabled and click Add Ad Units.

Associate this mediation group with one or more of your existing AdMob ad units. Then click Done.

You should now see the ad units card populated with the ad units you selected as shown below:

Add IronSource as an ad source

In the Ad Sources card, select Add Ad Network. Then select IronSource.

Next, enable the Optimize feature, then enter the User Name  and Secret Key obtained in previous section to set up ANO for IronSource. Then enter an eCPM value and click Continue.

Enter the App Key and Instance ID obtained in the previous section.

Using rewarded video ads

In the settings for your rewarded video ad unit, check the Override reward settings from third-party ad networks when using AdMob mediation so that you provide the same reward to the user no matter which ad network is served.

If you don't override the reward, the IronSource adapter passes back the reward specified in the IronSource dashboard when creating the placement.

For more information on setting reward values for AdMob ad units, see Create an ad unit.

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:15.0.1'
    implementation 'com.google.ads.mediation:ironsource:6.7.9.1.0'
    implementation 'com.ironsource.sdk:mediationsdk:6.7.9.1@jar'
}

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

Modify Android manifest

Activities

Include the following Activities in your AndroidManifest.xml under the application tag:

<activity
            android:name="com.ironsource.sdk.controller.ControllerActivity"
            android:configChanges="orientation|screenSize"
            android:hardwareAccelerated="true" />
<activity
            android:name="com.ironsource.sdk.controller.InterstitialActivity"
            android:configChanges="orientation|screenSize"
            android:hardwareAccelerated="true"
            android:theme="@android:style/Theme.Translucent" />
<activity
            android:name="com.ironsource.sdk.controller.OpenUrlActivity"
            android:configChanges="orientation|screenSize"
            android:hardwareAccelerated="true"
            android:theme="@android:style/Theme.Translucent" />

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)
}

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.

Send feedback about...

Google Mobile Ads SDK for Android
Google Mobile Ads SDK for Android
Need help? Visit our support page.