Integrate ironSource Ads with AdMob Mediation

This guide shows you how to use Google Mobile Ads SDK for React Native to load and display ads from ironSource Ads using mediation, covering waterfall integrations. It covers how to add ironSource Ads to an ad unit's mediation configuration, and how to integrate the ironSource Ads SDK and adapter into a React Native app.

Supported integrations and ad formats

The AdMob mediation adapter for ironSource Ads has the following capabilities:

Integration
Bidding
Waterfall
Formats
App Open
Banner
Interstitial
Rewarded
Rewarded Interstitial  1
Native

1 This format is only supported in waterfall integration.

Prerequisites

Before you continue, verify the following:

Step 1: Set up configurations in ironSource Ads UI

Sign up and sign in to your ironSource Ads account.

Add a new app

To add a new app, navigate to Ads > Apps and click Add app.

Fill out the form and click Add app.

Take note of the App Key, then select the ad formats your app supports and click Continue.

Android

iOS

Create an instance

Next, configure an instance for the app you added.

Navigate to Ads > Setup > Instances. Select the app and click Create instance.

Bidding

Fill out the form and select Bidding for Pricing. Click Save and close.

Android

iOS

Take note of the Instance ID.

Android

iOS

Waterfall

Fill out the form and click Save and close.

Take note of the Instance ID.

Locate your Reporting API Key

Bidding

This step isn't required for bidding integrations.

Waterfall

Click the API tab in My Account page and take note of your Secret Key and Refresh Token.

Update your app-ads.txt

Authorized Sellers for Apps app-ads.txt is an IAB Tech Lab initiative that helps ensure your app ad inventory is only sold through channels you've identified as authorized. To prevent a significant loss in ad revenue, you'll need to implement an app-ads.txt file. If you haven't done so already, set up an app-ads.txt file for your app.

To implement app-ads.txt for ironSource, see ironSource authorized resellers.

Turn on test mode

Follow the instructions in ironSource Ads's Integration testing guide on how to enable ironSource Ads test ads.

Step 2: Set up ironSource Ads demand in AdMob UI

Configure mediation settings for your ad unit

Android

For instructions, see step 2 in the guide for Android.

iOS

For instructions, see step 2 in the guide for iOS.

Add ironSource Mobile to GDPR and US state regulations ad partners list

Follow the steps in European regulations settings and US state regulations settings to add ironSource Mobile to the European and US state regulations ad partners list in the AdMob UI.

Step 3: Import the ironSource Ads SDK and adapter

In your project's root directory, install the Google Mobile Ads SDK for React Native mediation adapter for ironSource Ads. Complete the following:

  1. Copy the Google Mobile Ads SDK for React Native adapter tar file from the gma-sdk-react-native/adapters/ironsource/ directory into your project's local_packages/ directory. If you don't have the adapters folder, see Prerequisites.

    mkdir -p local_packages
    cp EXTRACT_DIR/gma-sdk-react-native/adapters/ironsource/gma-mediation-ironsource-0.1.0.tgz local_packages/
    

    Replace EXTRACT_DIR with the path to the directory where you extracted the archive.

  2. Install the adapter package using your preferred package manager:

    npm

    npm install ./local_packages/gma-mediation-ironsource-0.1.0.tgz
    

    yarn

    yarn add ./local_packages/gma-mediation-ironsource-0.1.0.tgz
    

  3. If you're building for Android, add the following repository to the build.gradle file in your project's android directory:

    repositories {
        google()
        mavenCentral()
        maven {
            url = uri("https://android-sdk.is.com/")
        }
    }
    

Step 4: Implement privacy settings on ironSource Ads SDK

To comply with the Google EU User Consent Policy, you must make certain disclosures to your users in the European Economic Area (EEA), the UK, and Switzerland, and obtain their consent for the use of cookies or other local storage where legally required, and for the collection, sharing, and use of personal data for ads personalization. This policy reflects the requirements of the EU ePrivacy Directive and the General Data Protection Regulation (GDPR). You are responsible for verifying that consent is propagated to each ad source in your mediation chain.

ironSource Ads React Native adapter version 0.1.0 and later supports passing GDPR consent signals from UMP SDK and consent management platforms that integrate with Google's Additional Consent specification to ironSource Ads SDK. For more information, see ironSource GDPR Compliance.

US state privacy laws

US states privacy laws require giving users the right to opt out of the "sale" of their "personal information" (as the law defines those terms), with the opt-out offered through a prominent "Do Not Sell My Personal Information" link on the "selling" party's homepage. The US states privacy laws compliance 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.

The Google Mobile Ads mediation plugin for ironSource Ads includes the GmaMediationIronsource().setDoNotSell method. The following sample code shows how to pass consent information to the ironSource Ads SDK. These options must be set before you initialize Google Mobile Ads SDK for React Native to ensure they get forwarded properly to the ironSource Ads SDK.

import { IronSourceMediation } from '@google/gma-mediation-ironsource';
// ...
IronSourceMediation.setDoNotSell(true);

See ironSource Ads's documentation on Regulation Advanced Settings for both Android and iOS for more details and the values that can be provided in the method.

Step 5: Add required code

Android

Proguard Rules

If you shrink, obfuscate, and optimize your app, ironSource Ads requires additional ProGuard rules for your project.

Consult ironSource Ads'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

SKAdNetwork integration

Step 6: Test your implementation

Enable test ads

Make sure you register your test device for AdMob and enable test mode in ironSource Ads UI.

Verify test ads

To verify that you are receiving test ads from ironSource Ads, enable single ad source testing in ad inspector using the ironSource Ads (Bidding) and ironSource Ads (Waterfall) ad source(s).

Error codes

If the adapter fails to receive an ad from ironSource Ads, 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 Ads adapter when an ad fails to load:

Android

Error code Reason
101 ironSource Ads server parameters configured in the AdMob UI are missing/invalid.
102 ironSource Ads requires an Activity context to initialize their SDK.
103 ironSource Ads can only load 1 ad per ironSource instance ID.
105 The requested banner ad size is not supported by ironSource Ads.
106 ironSource Ads SDK is not initialized.
107 An ad show request was made before the ad loaded successfully.
108 ironSource Ads SDK returned null or empty bidding signals.
501-1056 ironSource Ads SDK Errors. See documentation for more details.

iOS

Error code Reason
101 ironSource Ads server parameters configured in the AdMob UI are missing/invalid.
102 ironSource Ads Adapter does not support the ad format being requested.
103 An ironSource ad is already loaded for this network configuration.
104 The requested banner ad size is not supported by ironSource Ads.
105 ironSource Ads failed to show the ad.
508-1037 ironSource Ads SDK Errors. See documentation for more details.

Version 0.1.0

  • Initial release.