[ Web Proxy ]
URL:
Viewing: https://developers.google.com/admob/android/mediation/unity [Back]  [Original]

Integrate Unity Ads with mediation  |  Android  |  Google for Developers Skip to main content
Send feedback

Integrate Unity Ads with mediation Stay organized with collections Save and categorize content based on your preferences.

outlined_flag
Select platform: Android iOS Unity Flutter Android (Legacy)

This guide shows you how to use Google Mobile Ads SDK (Legacy) to load and display ads from Unity Ads using AdMob Mediation, 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 an Android app.

Supported integrations and ad formats

The mediation adapter for Unity Ads has the following capabilities:

Integration
Bidding
Waterfall  1
Formats
Banner
Interstitial
Rewarded
Native
1Deprecated: 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.

Prerequisites

Before you continue, verify the following:

Step 1: Set up configurations in Unity Ads UI

Sign up or log in to Unity Ads.

Create a project

On the Unity Ads dashboard, navigate to Projects and click New.

new_project.png [new_project.png]

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

new_project_form.png [new_project_form.png]

Navigate to Unity Ads Monetization, then click Get started.

new_project_get_started.png [new_project_get_started.png]

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

new_project_mediation_partner.png [new_project_mediation_partner.png]

Select the option for ad settings, then click Next.

new_project_project_info.png [new_project_project_info.png]

Select your placement setup, then click Next.

Bidding

new_project_setup_bidding.png [new_project_setup_bidding.png]

Waterfall

new_project_setup_waterfall.png [new_project_setup_waterfall.png]

Fill out the form, then click Add project.

store_id.png [store_id.png]

Take note of the Game ID.

game_id.png [game_id.png]

Create ad units and placements

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

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.

project_add_ad_unit.png [project_add_ad_unit.png]

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

project_ad_unit_Android.png [project_ad_unit_Android.png]

Bidding

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

add_placement_bidding.png [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.

add_placement_waterfall.png [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.

api_key.png [api_key.png]

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

organization_core_id.png [organization_core_id.png]

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 Unity Ads, see setting up app-ads.txt for the first time.

Turn on test mode

Test mode can be enabled from the Unity Ads dashboard. Navigate to Unity Ads Monetization > Testing.

You can force test mode for your app by clicking the edit button beside Google Play Store , enabling Override client test mode and selecting Force test mode ON (i.e. use test ads) for all devices.

test-mode-Android.png [test-mode-Android.png]

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

test_add_device.png [test_add_device.png]

Enter your test device details, then click Save.

test_devices.png [test_devices.png]

Step 2: Set up Unity Ads demand in AdMob UI

Configure mediation settings for your ad unit

You need to add Unity Ads 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 Unity Ads as an ad source.

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

admob-mediation-group-create.png [admob-mediation-group-create.png]

Enter your ad format and platform, then click Continue.

admob-mediation-group-new-Android.png [admob-mediation-group-new-Android.png]

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

admob-mediation-group-details-Android.png [admob-mediation-group-details-Android.png]

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

admob-ad-units-select-Android.png [admob-ad-units-select-Android.png]

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

admob-ad-units-card-Android.png [admob-ad-units-card-Android.png]

Add Unity Ads as an ad source

Bidding


In the Ad Sources section, find the Bidding card and select Add ad source. Then select Unity Ads .

Click How to sign a partnership agreement and set up a bidding partnership with Unity Ads.

bidding-agreement-1.png [bidding-agreement-1.png]

Click Acknowledge & agree, then click Continue.

bidding-agreement-2.png [bidding-agreement-2.png]

If you already have a mapping for Unity Ads, you can select it. Otherwise, click Add mapping.

bidding-add-mapping-1-Android.png [bidding-add-mapping-1-Android.png]

Next, enter the Game ID and Placement ID obtained in the previous section. Then click Done.

Important: The Game ID must be associated with the targeted app as in the Unity Ads UI.

bidding-add-mapping-2-Android.png [bidding-add-mapping-2-Android.png]

Waterfall


Under the Waterfall card in the Ad Sources section, select Add Ad Source.

Select Unity Ads and enable the Optimize switch. Enter the API Key and Organization core ID obtained in the previous section to set up ad source optimization for Unity Ads. Then enter an eCPM value for Unity Ads and click Continue.

admob-add-ad-network.png [admob-add-ad-network.png]

Note: You only need to set up ad source optimization once per network.
If you already have a mapping for Unity Ads, you can select it. Otherwise, click Add mapping.

waterfall-add-mapping-1-Android.png [waterfall-add-mapping-1-Android.png]

Next, enter the Game ID and Placement ID obtained in the previous section. Then click Done.
Important: The Game ID must be associated with the targeted app as in the Unity Ads UI.
waterfall-add-mapping-2-Android.png [waterfall-add-mapping-2-Android.png]
Note: Ad source optimization takes a few days to gather enough data to accurately calculate eCPM for a mediation network. In the meantime, the ad source optimization status is PENDING, so you must manually set an eCPM value for the network. Once the eCPM can be calculated, the ad source automatically starts updating the eCPM on your behalf.

Add Unity Ads to GDPR and US state regulations ad partners list

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 for details.

Follow the steps in European regulations settings and US state regulations settings 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: Failure to integrate the compatible Unity Ads and Google Mobile Ads SDK (Legacy) versions might lead to build issues.

In your app-level gradle file, add the following implementation dependencies:

Kotlin

dependencies {
    implementation("com.google.android.gms:play-services-ads:25.4.0")
    implementation("com.unity3d.ads:unity-ads:4.19.0")
    implementation("com.google.ads.mediation:unity:4.19.0.1")
}

Groovy

dependencies {
    implementation 'com.google.android.gms:play-services-ads:25.4.0'
    implementation 'com.unity3d.ads:unity-ads:4.19.0'
    implementation 'com.google.ads.mediation:unity:4.19.0.1'
}

Manual integration

  1. Download the latest Unity Ads SDK (unity-ads.aar) from their GitHub repository and add it to your project.

  2. Navigate to the Unity Ads adapter artifacts on Google's Maven Repository. Select the latest version, download the Unity Ads adapter's .aar file, and add it to your project.

Step 4: Implement privacy settings on Unity Ads SDK

To comply with 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 consent is propagated to each ad source in your mediation chain. Google is unable to pass the user's consent choice to such networks automatically.

In SDK version 2.0.0, Unity Ads added an API to support privacy settings. The following sample code shows how to pass this consent information to the Unity Ads SDK. Should you choose to pass consent information to the Unity Ads SDK manually, it is recommended that this code is called prior to requesting ads through the Google Mobile Ads SDK (Legacy).

Java

MetaData gdprMetaData = new MetaData(this);
gdprMetaData.set("gdpr.consent", true);
gdprMetaData.commit();

Kotlin

val gdprMetaData = MetaData(this)
gdprMetaData["gdpr.consent"] = true
gdprMetaData.commit()

See Unity Ads' GDPR Compliance for more details and the values that can be provided in each method.

US states 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.

In SDK version 2.0.0, Unity Ads added an API to support privacy settings. The following sample code shows how to pass this consent information to the Unity Ads SDK. Should you choose to pass consent information to the Unity Ads SDK manually, it is recommended that this code is called prior to requesting ads through Google Mobile Ads SDK (Legacy).

Java

MetaData ccpaMetaData = new MetaData(this);
ccpaMetaData.set("privacy.consent", true);
ccpaMetaData.commit();

Kotlin

val ccpaMetaData = MetaData(this)
ccpaMetaData["privacy.consent"] = true
ccpaMetaData.commit()

See Unity Ads' Consumer privacy act compliance for more details and the values that can be provided in each method.

Set age treatment

Unity Ads mediation adapter version 4.16.6.0 and later forwards the child-directed setting and 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.

Step 5: Add required code

Load ad with Activity context

Pass Activity context when loading Banner, Interstitial and Native ad formats. Without activity context, ad load will fail.

Step 6: Test your implementation

Enable test ads

Make sure you register your test device for AdMob and enable test mode in Unity Ads UI. 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 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.getAdapterResponses() under the following classes:

com.google.ads.mediation.unity.UnityAdapter
com.google.ads.mediation.unity.UnityMediationAdapter

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

Error code Reason
0-10 UnityAds SDK returned an error. See code 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 specific error. See code for more details.

Unity Ads Android Mediation Adapter Changelog

Version 4.20.0.0 (In progress)

Version 4.19.0.1

Built and tested with:

Version 4.19.0.0

Built and tested with:

Version 4.18.1.0

Built and tested with:

Version 4.18.0.0

Built and tested with:

Version 4.17.0.0

Built and tested with:

Version 4.16.6.0

Built and tested with:

Version 4.16.5.0

Built and tested with:

Version 4.16.4.0

Built and tested with:

Version 4.16.3.0

Built and tested with:

Version 4.16.2.0

Built and tested with:

Version 4.16.1.0

Built and tested with:

Version 4.16.0.1

Built and tested with:

Version 4.16.0.0

Built and tested with:

Version 4.15.1.0

Built and tested with:

Version 4.15.0.0

Built and tested with:

Version 4.14.2.0

Built and tested with:

Version 4.14.1.0

Built and tested with:

Version 4.14.0.0

Built and tested with:

Version 4.13.2.0

Built and tested with:

Version 4.13.1.0

Built and tested with:

Version 4.13.0.0

Built and tested with:

Version 4.12.5.1

Built and tested with:

Version 4.12.5.0

Built and tested with:

Version 4.12.4.0

Built and tested with:

Version 4.12.3.0

Built and tested with:

Version 4.12.2.0

Built and tested with:

Version 4.12.1.0

Built and tested with:

Version 4.12.0.0

Built and tested with:

Version 4.11.3.0

Built and tested with:

Version 4.11.2.0

Built and tested with:

Version 4.10.0.0

Built and tested with:

Version 4.9.3.0

Built and tested with:

Version 4.9.2.0

Built and tested with:

Version 4.9.1.0

Built and tested with:

Version 4.8.0.0

Built and tested with:

Version 4.7.1.0

Built and tested with:

Version 4.7.0.0

Built and tested with:

Version 4.6.1.1

Built and tested with:

Version 4.6.1.0

Built and tested with:

Version 4.6.0.0

Built and tested with:

Version 4.5.0.0

Built and tested with:

Version 4.4.1.0

Built and tested with:

Version 4.4.0.0

Built and tested with:

Version 4.3.0.0

Built and tested with:

Version 4.2.1.1

Built and tested with:

Version 4.2.1.0

Built and tested with:

Version 4.1.0.0

Built and tested with:

Version 4.0.1.0

Built and tested with:

Version 4.0.0.0

Built and tested with:

Version 3.7.5.0

Built and tested with:

Version 3.7.4.0

Built and tested with:

Version 3.7.2.0

Built and tested with:

Version 3.7.1.0

Built and tested with:

Version 3.6.2.0

Built and tested with:

Version 3.6.0.0

Built and tested with:

Version 3.5.1.1

Built and tested with:

Version 3.5.1.0

Built and tested with:

Version 3.5.0.0

Built and tested with:

Version 3.4.8.0

Built and tested with:

Version 3.4.6.1

Built and tested with:

Version 3.4.6.0

Built and tested with:

Version 3.4.2.3

Built and tested with:

Version 3.4.2.2

Built and tested with:

Version 3.4.2.1

Built and tested with:

Version 3.4.2.0

Built and tested with:

Version 3.4.0.0

Built and tested with:

Version 3.3.0.0

Built and tested with:

Version 3.2.0.1

Version 3.2.0.0

Version 3.1.0.0

Version 3.0.1.0

Version 3.0.0.2

Version 3.0.0.1

Version 3.0.0.0

Version 2.3.0.0

Version 2.2.1.1

Version 2.2.1.0

Version 2.2.0.0

Version 2.1.2.0

Version 2.1.1.0

Version 2.1.0.0

Version 2.0.8.0

Version 2.0.7.0

Version 2.0.6.0

Version 2.0.5.0

Version 2.0.4.0

Version 2.0.2.0

Version 1.0.0

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-18 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-18 UTC."],[],["This guide details integrating Unity Ads with the Google Mobile Ads SDK for Android. Key actions include configuring both Unity Ads and AdMob dashboards by creating projects, ad units, placements, and mapping. Developers must import the Unity Ads SDK and adapter via Android Studio or manually. Privacy settings for EU and US state laws should be implemented. Test ads should be enabled during development and disabled before release. The changelog outlines version updates, bug fixes, and compatibility with various SDK versions. Bidding and waterfall ad formats are supported.\n"]]

Web Proxy Viewer  |  New URL  |  Original Page