<br />

This guide shows you how to use Google Mobile Ads SDK for React Native to load and display
ads from Unity Ads using
[mediation](https://developers.google.com/admob/react-native/mediation.md.txt), covering bidding and waterfall
integrations. It covers how to add
Unity Ads to an ad unit's
mediation configuration, and how to integrate the
Unity Ads SDK and adapter into a
React Native app.

## Supported integrations and ad formats

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

| Integration ||
|---|---|
| Bidding | Yes |
| Waterfall | Yes [^1^](https://developers.google.com/admob/react-native/mediation/unity.md.txt#waterfall-deprecation-footnote) |
| App Open |   |
| Banner | Yes |
| Interstitial | Yes |
| Rewarded | Yes |
| Rewarded Interstitial |   |
| Native |   |

> [!WARNING]
> ^1^**Deprecated:** Waterfall mediation support for Unity Ads ends January 31, 2026. You can no longer create or edit waterfall placements. For more details, see [In-app bidding with Google](https://docs.unity.com/en-us/grow/dashboard/bidding/google).

## 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 Unity Ads UI

[Sign up](https://login.unity.com/en/sign-up) or
[log in](https://login.unity.com/en/sign-in) to Unity Ads.

### Create a project

On the [Unity Ads dashboard](https://cloud.unity.com/home/), navigate to **Projects**
and click **New**.

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

Fill out the form and click **Create** to add your project.

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

Navigate to **Unity Ads Monetization** , then click **Get started**.

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

In the **New Project** modal, select **I will use Mediation** and **Google
Admob** for **Mediation Partner** , then click **Next**.

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

Select the option for ad settings, then click **Next**.

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

Select your placement setup, then click **Next**.

### Bidding

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

### Waterfall

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

Fill out the form, then click **Add project**.

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

Take note of the **Game ID**.

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

### Create ad units and placements

Navigate to **Unity Ads Monetization** \> **Placements** , then select your
project and click **Add ad unit**.

> [!NOTE]
> **Note:** If **Bidding** is selected for the placement setup when configuring your project, a set of bidding placements for all supported ad formats and selected platforms is created automatically.

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

Enter an **Ad unit name** , then select your **Platform** and **Ad format**.

### Android

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

### iOS

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

### Bidding

Select **Bidding** for the **Setup** . Under **Placement** , enter the
**Placement name**.

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

Take note of the **Placement ID**.

### Waterfall

Select **Waterfall** for the **Setup** . Under **Placement** , enter the
**Placement name** , **GEO Tagging** and **Target**.

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

Take note of the **Placement ID**.

Finally, click **Add ad unit** to save your ad unit and placement.

### Locate Unity Ads Reporting API key

### Bidding

This step isn't required for bidding integrations.

### Waterfall

Navigate to the **Unity Ads Monetization** \> **API management** and take note
of the **API Key** in **Monetization Stats API Access**.

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

Then, navigate to the **Unity Ads Monetization** \> **Organization Settings**
and take note of the **Organization core ID**.

![](https://developers.google.com/static/admob/images/mediation/unity/organization_core_id.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 Unity Ads, see
[setting up app-ads.txt for the first time](https://docs.unity.com/grow/en-us/ads/optimization/app-ads-txt#setting-up-app-adstxt-for-the-first-time).

### Turn on test mode

Test mode can be enabled from the
[Unity Ads dashboard](https://cloud.unity.com/home/). Navigate to
**Unity Ads Monetization** \> **Testing**.

You can force test mode for your app by clicking the edit button of each
platform, enabling **Override client test mode** and selecting
**Force test mode ON (i.e. use test ads) for all devices**.

### Android

![](https://developers.google.com/static/admob/images/mediation/unity/test-mode-Android.png)

### iOS

![](https://developers.google.com/static/admob/images/mediation/unity/test-mode-iOS.png)

Alternatively, you can enable test mode for specific devices by clicking
**Add Test Device**.

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

Enter your test device details, then click **Save**.

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

## Step 2: Set up Unity 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/unity.md.txt#step-2).

### iOS

For instructions, see step 2 in the guide for

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

### Add Unity Ads 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 **Unity Ads** to the
European and US state regulations ad partners list in the AdMob UI.


## Step 3: Import the Unity Ads SDK and adapter

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

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

1. Copy the Google Mobile Ads SDK for React Native adapter tar file from the
   `gma-sdk-react-native/adapters/unity/`
   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/unity.md.txt#prerequisites).

   ```bash
   mkdir -p local_packages
   cp EXTRACT_DIR/gma-sdk-react-native/adapters/unity/gma-mediation-unity-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-unity-0.1.0.tgz
   ```

   ### yarn

   ```bash
   yarn add ./local_packages/gma-mediation-unity-0.1.0.tgz
   ```


## Step 4: Implement privacy settings on Unity 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.

Unity Ads React Native adapter version
0.1.0
and later supports passing GDPR consent signals from consent management
platforms that integrate with IAB's Transparency and Consent Framework (TCF)
to Unity Ads SDK.
For more information, see
[Set up a TCF or non-TCF consent configuration](https://docs.unity.com/en-us/grow/ads/privacy/gdpr/tcf-and-non-tcf-consent).

### US states 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
Unity Ads

includes the

`UnityMediation.setCCPAConsent()`

method. The following sample code shows how to pass consent information to the
Unity Ads SDK. If you choose to call
this method, it is recommended that you do so prior to requesting ads through
Google Mobile Ads SDK for React Native.

```javascript
import { UnityMediation } from '@google/gma-mediation-unity';
// ...

UnityMediation.setCCPAConsent(false);
```

### Set age treatment

Unity Ads mediation plugin version 0.1.0 and later
forwards the [child-directed setting](https://developers.google.com/admob/react-native/targeting.md.txt#child-directed_setting)
and [users under the age of
consent](https://developers.google.com/admob/react-native/targeting#users_under_the_age_of_consent) setting to
Unity Ads.

To process these signals on a per-user basis,
Unity Ads requires you to enable the
**Mixed Audience** designation in the Unity Monetization dashboard. For more
information about enabling a mixed audience designation on your project,
see [Setting game-level age designations](https://docs.unity.com/en-us/grow/ads/privacy/coppa-compliance#setting-game-level-age-designations).

## Step 5: Add required code

### Android

No Additional code required for
Unity Ads Android integrations.

### iOS

### SKAdNetwork integration

Follow [Unity Ads's
documentation](https://docs.unity.com/ads/en-us/manual/ConfiguringAdNetworkIDs)
to add the SKAdNetwork identifiers to your project's `Info.plist` file.

<br />

## 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/unity.md.txt#turn-on-test-mode) in
Unity Ads UI.


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

### Verify test ads

To verify that you are receiving test ads from
Unity Ads,
enable
[single ad source testing](https://developers.google.com/admob/react-native/ad-inspector#single_ad_source_testing)
in ad inspector using the
**Unity Ads (Bidding) and Unity Ads (Waterfall)** ad source(s).

## Error codes

If the adapter fails to receive an ad from Unity 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.unity.UnityAdapter
com.google.ads.mediation.unity.UnityMediationAdapter
```

### iOS

```objective-c
GADMAdapterUnity
GADMediationAdapterUnity
```

Here are the codes and accompanying messages thrown by the UnityAds adapter when
an ad fails to load:

### Android

| Error code | Reason |
|---|---|
| 0-10 | UnityAds SDK returned an error. See [code](https://github.com/googleads/googleads-mobile-android-mediation/blob/master/ThirdPartyAdapters/unity/unity/src/main/java/com/google/ads/mediation/unity/UnityAdsAdapterUtils.java#L94-L127) for more details. |
| 101 | UnityAds server parameters configured in the Admob UI are missing/invalid. |
| 102 | UnityAds returned a placement with a NO_FILL state. |
| 103 | UnityAds returned a placement with a DISABLED state. |
| 104 | UnityAds tried to show an ad with a null context. |
| 105 | Context used to initialize, load and/or show ads from Unity Ads is not an Activity instance. |
| 106 | UnityAds tried to show an ad that's not ready to be shown. |
| 107 | UnityAds is not supported on the device. |
| 108 | UnityAds can only load 1 ad per placement at a time. |
| 109 | UnityAds finished with an ERROR state. |
| 110 | The requested ad size does not match a UnityAds supported banner size. |
| 111 | UnityAds returned an initialization error. |
| 112 | Unity Ads returned a null or empty bidding token. |
| 200-204 | UnityAds Banner a specific error. See [code](https://github.com/googleads/googleads-mobile-android-mediation/blob/b1a70fcab0e7891efacffdff523d86573e2286c7/ThirdPartyAdapters/unity/unity/src/main/java/com/google/ads/mediation/unity/UnityAdsAdapterUtils.java#L69-L84) for more details. |

### iOS

|---|---|
| 0-9 | UnityAds SDK returned an error. See Unity's [documentation](https://unityads.unity3d.com/help/ios/api-ios#unityadserror) for more details. |
| 101 | UnityAds server parameters configured in the AdMob UI are missing/invalid. |
| 102 | Device not supported by UnityAds. |
| 103 | UnityAds finished presenting with error state `kUnityAdsFinishStateError`. |
| 104 | The Unity ad object is nil after calling its initializer. |
| 105 | Failed to show Unity Ads due to ad not ready. |
| 107 | UnityAds called a placement changed callback with placement state `kUnityAdsPlacementStateDisabled`. |
| 108 | An ad was already loaded for this placement. UnityAds SDK does not support loading multiple ads for the same placement. |
| 109 | The banner ad returned by UnityAds does not match with the requested size. |
| 110 | UnityAds returned an initialization error. |
| 111 | Unsupported ad format. |
| 112 | UnityAds returned a null or empty bidding token. |

#### Version 0.1.0

- Initial release.

<!-- -->

- Supports [Unity Ads Android adapter version 4.20.1.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/unity/CHANGELOG.md#version-42010).
- Supports [Unity Ads iOS adapter version 4.20.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Unity/CHANGELOG.md#version-42000).
- Built and tested with the Google Mobile Ads React Native Plugin version 0.1.0.