<br />

This guide shows you how to use Google Mobile Ads SDK for React Native to load and display
ads from ironSource Ads using
[mediation](https://developers.google.com/admob/react-native/mediation.md.txt), 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 | Yes |
| Waterfall | Yes |
| App Open |   |
| Banner | Yes |
| Interstitial | Yes |
| Rewarded | Yes |
| Rewarded Interstitial | Yes [^1^](https://developers.google.com/admob/react-native/mediation/ironsource.md.txt#waterfall-format-footnote) |
| Native |   |

^1^ This format is only
supported in waterfall integration.

## Prerequisites

Before you continue, verify the following:

- Latest Google Mobile Ads SDK for React Native version.
- React Native framework version 0.85.0 or later.
- To deploy on Android
  - Android API level 24 or later.
- To deploy on iOS
  - iOS deployment target of 13.0 or later.
- A working React Native project configured with Google Mobile Ads SDK for React Native. See [Set up Google Mobile Ads SDK for React Native](https://developers.google.com/admob/react-native/quick-start.md.txt) for details.
  - Make sure you have downloaded and extracted the `adapters` folder from the [`gma-sdk-react-native`](https://drive.google.com/corp/drive/folders/1s5j2kx0yyYxLsdLNyBrhNJvkzmaUgOwD) folder. If you don't have the `adapters` folder, follow steps one, two, and three in [Install Google Mobile Ads SDK for React Native](https://developers.google.com/admob/react-native/quick-start.md.txt#install).
- [Set up AdMob Mediation](https://developers.google.com/admob/react-native/mediation.md.txt).

## Step 1: Set up configurations in ironSource Ads UI

[Sign up](https://platform.ironsrc.com/partners/identity/signup) and
[sign in](https://platform.ironsrc.com/partners/identity/login) to your ironSource Ads
account.

### Add a new app

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

![](https://developers.google.com/static/admob/images/mediation/ironsource/dashboard.png)

Fill out the form and click **Add app**.

![](https://developers.google.com/static/admob/images/mediation/ironsource/enter_app_details.png)

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

### Android

![](https://developers.google.com/static/admob/images/mediation/ironsource/select-ad-format-Android.png)

### iOS

![](https://developers.google.com/static/admob/images/mediation/ironsource/select-ad-format-iOS.png)

### Create an instance

Next, configure an instance for the app you added.

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

![](https://developers.google.com/static/admob/images/mediation/ironsource/ad_units.png)

### Bidding

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

### Android

![](https://developers.google.com/static/admob/images/mediation/ironsource/bidding-ad-units-form-Android.png)

### iOS

![](https://developers.google.com/static/admob/images/mediation/ironsource/bidding-instance-id-iOS.png)

> [!NOTE]
> **Note:** ironSource Ads limits the number of instances you can create. If you receive an error saying you are not able to create more instances, [contact the ironSource Ads support
> team](https://developers.is.com/submit-a-request/) for assistance.

> [!IMPORTANT]
> **Key Point:** If you want to support rewarded interstitial ads, select the **Rewarded Video** format, and use that **Instance ID** when adding ironSource Ads as an ad source in [step 2](https://developers.google.com/admob/react-native/mediation/ironsource.md.txt#step-2). Additionally, you will need to contact the ironSource Ads support team at [`Mobile-is-support@ironsrc.com`](mailto:Mobile-is-support@ironsrc.com) to set up your instance for rewarded interstitial support.

Take note of the **Instance ID**.

### Android

![](https://developers.google.com/static/admob/images/mediation/ironsource/bidding-instance-id-Android.png)

### iOS

![](https://developers.google.com/static/admob/images/mediation/ironsource/bidding-instance-id-iOS.png)

### Waterfall

Fill out the form and click **Save and close**.

![](https://developers.google.com/static/admob/images/mediation/ironsource/ad_units_form.png)

> [!NOTE]
> **Note:** ironSource Ads limits the number of instances you can create. If you receive an error saying you are not able to create more instances, [contact the ironSource Ads support
> team](https://developers.is.com/submit-a-request/) for assistance.

> [!IMPORTANT]
> **Key Point:** If you want to support rewarded interstitial ads, select the **Rewarded Video** format, and use that **Instance ID** when adding ironSource Ads as an ad source in [step 2](https://developers.google.com/admob/react-native/mediation/ironsource.md.txt#step-2). Additionally, you will need to contact the ironSource Ads support team at [`Mobile-is-support@ironsrc.com`](mailto:Mobile-is-support@ironsrc.com) to set up your instance for rewarded interstitial support.

Take note of the **Instance ID**.

![](https://developers.google.com/static/admob/images/mediation/ironsource/instance_id.png)

### Locate your Reporting API Key

### Bidding

This step isn't required for bidding integrations.

### Waterfall

> [!NOTE]
> **Note:** Only users with **Contributor** or **Administrator** permissions can access the API Keys.

Click the **API** tab in
[My Account page](https://platform.ironsrc.com/partners/account/apiDetails)
and take note of your **Secret Key** and **Refresh Token**.

![](https://developers.google.com/static/admob/images/mediation/ironsource/secret_key.png)

### Update your app-ads.txt


[Authorized Sellers for Apps app-ads.txt](https://iabtechlab.com/wp-content/uploads/2019/03/app-ads.txt-v1.0-final-.pdf) 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](https://support.google.com/admob/answer/9363762).

To implement `app-ads.txt` for ironSource, see
[ironSource authorized resellers](https://developers.is.com/ironsource-mobile/general/app-ads-txt/#step-5).

### Turn on test mode

Follow the instructions in ironSource Ads's
[Integration testing](https://https://developers.is.com/ironsource-mobile/android/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](https://developers.google.com/admob/android/mediation/ironsource.md.txt#step-2).

### iOS

For instructions, see step 2 in the guide for

[iOS](https://developers.google.com/admob/ios/mediation/ironsource.md.txt#step-2).

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

> [!IMPORTANT]
> **Important:** Verify that you have **Account Management** permission to complete the configuration for EU Consent and GDPR, US State regulations, and User Messaging Platform. See [Manage user access to your
> account](https://support.google.com/admob/answer/2784628) for details.

Follow the steps in

[European regulations settings](https://support.google.com/admob/answer/10113004#adding_ad_partners_to_published_gdpr_messages)

and

[US state regulations settings](https://support.google.com/admob/answer/14125907)


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

> [!NOTE]
> **Note:** Failure to integrate the compatible ironSource Ads and Google Mobile Ads SDK for React Native SDK versions might lead to build issues.

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](https://developers.google.com/admob/react-native/mediation/ironsource.md.txt#prerequisites).

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

   Replace <var class="readonly" translate="no">EXTRACT_DIR</var> with the path to the
   directory where you extracted the archive.
2. Install the adapter package using your preferred package manager:

   ### npm

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

   ### yarn

   ```bash
   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:

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

## Step 4: Implement privacy settings on ironSource Ads SDK

### EU Consent and GDPR


To [comply with
the Google EU User Consent Policy](https://www.google.com/about/company/consentstaging.html), 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](https://developers.google.com/admob/react-native/privacy.md.txt)
and consent management platforms that integrate with

[Google's Additional Consent specification](https://support.google.com/admob/answer/9681920)

to ironSource Ads SDK.
For more information, see
[ironSource GDPR Compliance](https://docs.unity.com/en-us/grow/is-ads/legal-resources/ironsource-gdpr-compliance).

### US state privacy laws


[US states privacy laws](https://support.google.com/admob/answer/9561022)
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](https://developers.google.com/admob/react-native/privacy/us-states) offers the ability to enable
[restricted data processing](https://privacy.google.com/businesses/rdp/)
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](https://developers.google.com/admob/react-native/quick-start.md.txt#initialize_the_sdk)
to ensure they get forwarded properly to the
ironSource Ads SDK.

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

See [ironSource Ads's documentation on
Regulation Advanced Settings](https://developers.is.com/ironsource-mobile/android/regulation-advanced-settings/#step-2)
for both
[Android](https://developers.is.com/ironsource-mobile/android/regulation-advanced-settings/#step-2)
and
[iOS](https://developers.is.com/ironsource-mobile/ios/regulation-advanced-settings/#step-2)
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](https://developer.android.com/studio/build/shrink-code),
ironSource Ads requires additional
ProGuard rules for your project.


Consult [ironSource Ads's Android SDK
Integration
guide](https://developers.is.com/ironsource-mobile/android/android-sdk/#for-proguard-users-only)
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](https://developers.google.com/admob/react-native/test-ads.md.txt#enable_test_devices)
for

AdMob and [enable test mode](https://developers.google.com/admob/react-native/mediation/ironsource.md.txt#turn-on-test-mode) in
ironSource Ads UI.


> [!IMPORTANT]
> **Important:** Disable test mode for AdMob and ironSource Ads before releasing your app.

### Verify test ads

To verify that you are receiving test ads from
ironSource Ads,
enable
[single ad source testing](https://developers.google.com/admob/react-native/ad-inspector#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`](https://developers.google.com/admob/react-native/response-info.md.txt) under the
following classes:

### Android

```java
com.google.ads.mediation.ironsource.IronSourceAdapter
com.google.ads.mediation.ironsource.IronSourceRewardedAdapter
```

### iOS

```objective-c
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](https://developers.is.com/ironsource-mobile/android/advanced-settings/#step-6) 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](https://developers.is.com/ironsource-mobile-ios/sdk-integration/supersonic-sdk-error-codes/) for more details. |

#### Version 0.1.0

- Initial release.

<!-- -->

- Supports [ironSource Android adapter version 9.6.0.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/ironsource/CHANGELOG.md#version-9601).
- Supports [ironSource iOS adapter version 9.5.0.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/IronSource/CHANGELOG.md#version-95000).