This guide shows you how to use the Google Mobile Ads SDK to load and display ads from ironSource using mediation, covering waterfall integrations. It covers how to add ironSource to an ad unit's mediation configuration, and how to integrate the ironSource SDK and adapter into a Unity app.
Supported integrations and ad formats
The AdMob mediation adapter for ironSource has the following capabilities:
Integration | |
---|---|
Bidding | |
Waterfall | |
Formats | |
Banner | |
Interstitial | |
Rewarded | |
Rewarded Interstitial |
Requirements
- Unity 4 or higher
- Latest Google Mobile Ads SDK
- To deploy on Android
- Android API level 19 or higher
- To deploy on iOS
- iOS deployment target of 11.0 or higher
- A working Unity project configured with Google Mobile Ads SDK. See Get Started for details.
Step 1: Set up ironSource
Sign up and sign in to your ironSource account. To add your application to the ironSource dashboard, click on the New App button.
If your app supports both Android and iOS platforms, you need to add each of them separately.
Enter App Details
Android
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 in Google Play, select App Not Live in the Application Store and provide a Temporary Name for your app. Select Android as platform and click on Add App.
Take note of the App Key listed on this page. You will need this value for setting up your Admob Ad Unit ID. Select the Ad formats your app supports by selecting the appropriate Live tabs. Then click "Done".
iOS
Select Mobile App, enter the App Store 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 in the App Store, select App Not Live in the Application Store and provide a Temporary Name for your app. Select iOS as platform and click on Add App.
Take note of the App Key listed on this page. You will need this value for setting up your Admob Ad Unit ID. Select the Ad formats your app supports by selecting 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 and Interstitials.
Navigate to the Ad Units & Placements page from the left nav, select your app in the APPLICATIONS list, and click on the Edit button.
Android
iOS
Select the Add Network Instance link, enter the Instance Name, and click on Save.
Android
iOS
Once the instance is created, the Instance Id is listed in the 'Instance Id' field.
Android
iOS
In addition to the App Key and Instance ID, you'll also need your ironSource Secret Key and Refresh Token to set up your AdMob ad unit ID.
Navigate to My Account in your ironSource publisher dashboard then click the API tab. Take note of your Secret Key and Refresh Token.
Step 2: Configure AdMob Ad Unit
To add ironSource to the mediation configuration for your AdMob ad unit(s), first sign in to your AdMob account. Then, follow the iOS or Android platform specific instructions below.
If you're deploying your Unity app to both Android and iOS, you need two AdMob ad units, one for each platform.
AdMob UI Android
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 Secret Key and Refresh Token obtained in previous section to set up ad source optimization for ironSource. Then enter an eCPM value and click Continue.
If you already have a mapping for ironSource, you can simply select it. Otherwise, click Add mapping.
Next, enter a Mapping name, the App Key and Instance ID obtained in the previous section. Then click Done.
AdMob UI iOS
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 Secret Key and Refresh Token obtained in previous section to set up ad source optimization for ironSource. Then enter an eCPM value and click Continue.
If you already have a mapping for ironSource, you can simply select it. Otherwise, click Add mapping.
Next, enter a Mapping name, the App Key and Instance ID obtained in the previous section. Then click Done.
Rewarded ads
In the settings for your rewarded ad unit, check the Apply to all networks in Mediation groups box so that you provide the same reward to the user no matter which ad network is served.
If you don't check this setting, 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
Download the latest version of Google Mobile Ads mediation plugin for ironSource
from the download link in the
Changelog and extract the
GoogleMobileAdsIronSourceMediation.unitypackage
from the zip file.
In your Unity project editor, select Assets > Import Package > Custom
Package and find the GoogleMobileAdsIronSourceMediation.unitypackage
file
you downloaded. Make sure that all the files are selected and click Import.
Then, select Assets > Play Services Resolver > Android Resolver > Force
Resolve. The Unity Play Services Resolver library will perform dependency
resolution from scratch and copy the declared dependencies into the
Assets/Plugins/Android
directory of your Unity app.
Step 4: Additional code required
Android
Proguard Rules
If you shrink, obfuscate, and optimize your app, IronSource requires additional ProGuard rules for your project.
When building your project, select Android as the Platform. Then,
open Player Settings and check User Proguard File under the
Publishing Settings tab. Unity should show where a custom
proguard-user.txt
file was created for you to modify.
Consult
IronSource's Android SDK Integration guide
for more information on what ProGuard rules are required for your project,
and add those rules to your proguard-user.txt
file.
iOS
No additional code is required for ironSource Unity iOS integration.
Step 5: Test your implementation
Android
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.
iOS
To enable test ads on ironSource, run your ads integrated app and check the logs for a message that looks like this:
This is the Advertising ID of your test device. Copy it to the 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
EU Consent and GDPR
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 Google Mobile Ads mediation plugin for ironSource version 1.0.0 includes the
IronSource.SetConsent()
method. The following sample code shows how to pass
consent information to the ironSource SDK. If you choose to call this method, it
is recommended that you do so prior to requesting ads through the Google Mobile
Ads SDK.
using GoogleMobileAds.Api.Mediation.IronSource;
// ...
IronSource.SetConsent(true);
See ironSource's documentation on Regulation Advanced Settings for more details.
Add ironSource to GDPR ad partners list
Follow the steps in GDPR settings to add ironSource Mobile to the GDPR ad partners list in the AdMob UI.
CCPA
The California Consumer Privacy Act (CCPA) requires giving California state residents the right to opt out of the "sale" of their "personal information" (as the law defines those terms), with the opt-out offered via a prominent "Do Not Sell My Personal Information" link on the "selling" party's homepage. The CCPA preparation guide offers the ability to enable restricted data processing for Google ad serving, but Google is unable to apply this setting to each ad network in your mediation chain. Therefore, you must identify each ad network in your mediation chain that may participate in the sale of personal information and follow guidance from each of those networks to ensure compliance with CCPA.
The Google Mobile Ads mediation plugin for ironSource version 2.2.4 includes the
IronSource.SetMetaData()
method. The following sample code shows how to pass
consent information to the ironSource SDK. These options must be set before you
initialize the Google Mobile Ads SDK
to ensure they get forwarded properly to the ironSource SDK.
using GoogleMobileAds.Api.Mediation.IronSource;
// ...
IronSource.SetMetaData("do_not_sell", "true");
See ironSource's documentation on Regulation Advanced Settings for both Android and iOS for more details and the values that can be provided in the method.
Error codes
If the adapter fails to receive an ad from ironSource,
publishers can check the underlying error from the ad response using
ResponseInfo
under the following classes:
Android
com.google.ads.mediation.ironsource.IronSourceAdapter
com.google.ads.mediation.ironsource.IronSourceRewardedAdapter
iOS
GADMAdapterIronSource
GADMAdapterIronSourceRewarded
Here are the codes and accompanying messages thrown by the ironSource adapter when an ad fails to load:
Android
Error code | Reason |
---|---|
101 | ironSource server parameters configured in the AdMob UI are missing/invalid. |
102 | ironSource requires an Activity context to initialize their SDK. |
103 | ironSource can only load 1 ad per ironSource instance ID. |
501-1056 | ironSource SDK Errors. See documentation for more details. |
iOS
Error code | Reason |
---|---|
101 | ironSource server parameters configured in the AdMob UI are missing/invalid. |
102 | ironSource Adapter does not support the ad format being requested. |
103 | An ironSource ad is already loaded for this network configuration. |
508-1037 | ironSource SDK Errors. See documentation for more details. |
IronSource Unity Mediation Plugin Changelog
Version 2.3.0
- Moved adapter content to
GoogleMobileAds/Mediation/IronSource/
. - Refactored adapter namespace to use
GoogleMobileAds.Mediation.IronSource
. - Supports IronSource Android adapter version 7.3.0.1.0.
- Supports IronSource iOS adapter version 7.3.0.0.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 8.1.0.
Version 2.2.7
- Supports IronSource Android adapter version 7.2.7.0.
- Supports IronSource iOS adapter version 7.2.7.0.1.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.4.1.
Version 2.2.6
- Supports IronSource Android adapter version 7.2.6.0.
- Supports IronSource iOS adapter version 7.2.6.0.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.3.1.
Version 2.2.5
- Supports IronSource Android adapter version 7.2.5.0.
- Supports IronSource iOS adapter version 7.2.5.1.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.3.0.
Version 2.2.4
- Added the
IronSource.SetMetaData(string, string)
method. - Supports IronSource Android adapter version 7.2.3.1.0.
- Supports IronSource iOS adapter version 7.2.4.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.2.0.
Version 2.2.3
- Supports IronSource Android adapter version 7.2.3.1.0.
- Supports IronSource iOS adapter version 7.2.3.1.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.1.0.
Version 2.2.2
- Supports IronSource Android adapter version 7.2.2.1.0.
- Supports IronSource iOS adapter version 7.2.2.1.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.0.2.
Version 2.2.1
- Supports IronSource Android adapter version 7.2.1.1.0.
- Supports IronSource iOS adapter version 7.2.1.2.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.0.0.
Version 2.2.0
- Supports IronSource Android adapter version 7.2.1.0.
- Supports IronSource iOS adapter version 7.2.1.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.0.0.
Version 2.1.5
- Supports IronSource Android adapter version 7.1.14.0.
- Supports IronSource iOS adapter version 7.1.14.0.
Version 2.1.4
- Supports IronSource Android adapter version 7.1.13.0.
- Supports IronSource iOS adapter version 7.1.13.0.
Version 2.1.3
- Supports IronSource Android adapter version 7.1.12.0.
- Supports IronSource iOS adapter version 7.1.12.0.
Version 2.1.2
- Supports IronSource Android adapter version 7.1.11.1.0.
- Supports IronSource iOS adapter version 7.1.11.1.0.
Version 2.1.1
- Supports IronSource Android adapter version 7.1.8.0.
- Supports IronSource iOS adapter version 7.1.8.0.
Version 2.1.0
- Supports IronSource Android adapter version 7.1.6.0.
- Supports IronSource iOS adapter version 7.1.6.1.0.
Version 2.0.3
- Supports IronSource Android adapter version 7.0.3.1.0.
- Supports IronSource iOS adapter version 7.0.3.0.
Version 2.0.2
- Supports IronSource Android adapter version 7.0.2.0.
- Supports IronSource iOS adapter version 7.0.2.0.
Version 2.0.1
- Supports IronSource Android adapter version 7.0.1.1.0.
- Supports IronSource iOS adapter version 7.0.1.0.
Version 2.0.0
- Supports IronSource Android adapter version 7.0.0.0.
- Supports IronSource iOS adapter version 7.0.0.0.
Version 1.10.0
- Supports IronSource Android adapter version 6.18.0.0.
- Supports IronSource iOS adapter version 6.18.0.0.
Version 1.9.1
- Supports IronSource Android adapter version 6.17.0.1.
- Supports IronSource iOS adapter version 6.17.0.1.0.
Version 1.9.0
- Supports IronSource Android adapter version 6.17.0.0.
- Supports IronSource iOS adapter version 6.16.3.0.
Version 1.8.2
- Supports IronSource Android adapter version 6.16.2.0.
- Supports IronSource iOS adapter version 6.16.2.0.
Version 1.8.1
- Supports IronSource Android adapter version 6.16.1.0.
- Supports IronSource iOS adapter version 6.16.1.0.
Version 1.8.0
- Supports IronSource Android adapter version 6.16.0.0.
- Supports IronSource iOS adapter version 6.16.0.0.
Version 1.7.0
- Supports IronSource Android adapter version 6.15.0.1.0.
- Supports IronSource iOS adapter version 6.15.0.1.0.
Version 1.6.0
- Supports IronSource Android adapter version 6.14.0.1.0.
- Supports IronSource iOS adapter version 6.14.0.0.
Version 1.5.0
- Supports IronSource Android adapter version 6.13.0.1.0.
- Supports IronSource iOS adapter version 6.13.1.0.0.
Version 1.4.0
- Supports IronSource Android adapter version 6.12.0.0.
- Supports IronSource iOS adapter version 6.12.0.0.
Version 1.3.2
- Supports IronSource Android adapter version 6.10.0.0.
- Supports IronSource iOS adapter version 6.8.7.0.
Version 1.3.1
- Supports IronSource Android adapter version 6.10.0.0
- Supports IronSource iOS adapter version 6.8.6.0
Version 1.3.0
- Supports IronSource Android adapter version 6.10.0.0
- Supports IronSource iOS adapter version 6.8.4.1.0
Version 1.2.0
- Supports IronSource Android adapter version 6.9.0.1
- Supports IronSource iOS adapter version 6.8.4.1.0
Version 1.1.2
- Supports IronSource Android adapter version 6.8.4.1
- Supports IronSource iOS adapter version 6.8.4.1
Version 1.1.1
- Supports IronSource Android adapter version 6.8.4.1
- Supports IronSource iOS adapter version 6.8.3.0
Version 1.1.0
- Updated the plugin to support the new open-beta Rewarded API.
- Supports IronSource Android adapter version 6.8.1.2
- Supports IronSource iOS adapter version 6.8.0.1
Version 1.0.4
- Supports IronSource Android adapter version 6.7.11.0
- Supports IronSource iOS adapter version 6.7.11.0
Version 1.0.3
- Supports IronSource Android adapter version 6.7.10.0
- Supports IronSource iOS adapter version 6.7.10.0
Version 1.0.2
- Supports IronSource Android adapter version 6.7.9.1.1
- Supports IronSource iOS adapter version 6.7.10.0
- Fixed a conflict with the Chartboost Unity mediation plugin.
Version 1.0.1
- Supports IronSource Android adapter version 6.7.9.0.
- Supports IronSource iOS adapter version 6.7.9.2.0.
Version 1.0.0
- First release!
- Supports IronSource Android adapter version 6.7.9.0.
- Supports IronSource iOS adapter version 6.7.9.1.0.