Set up Google Mobile Ads Unity Plugin
Stay organized with collections
Save and categorize content based on your preferences.
Page Summary
The Google Mobile Ads Unity plugin allows Unity developers to serve Google mobile ads on Android and iOS apps using a C# interface.
Prerequisites for using the plugin include Unity Editor 2019.4 or higher and specific version requirements for Xcode, iOS, and Android API levels depending on the deployment platform.
You can import the Mobile Ads for Unity plugin using OpenUPM-CLI, OpenUPM, or by importing a .unitypackage from GitHub.
Before loading ads, you need to set your Android and iOS AdMob app IDs in the Unity editor settings and initialize the Google Mobile Ads SDK by calling MobileAds.Initialize().
AdMob offers various ad formats for Unity apps, including Banner, Interstitial, Native, Rewarded, Rewarded interstitial, and App open ads, each with distinct characteristics and use cases.
The Google Mobile Ads Unity plugin lets Unity developers serve Google mobile ads
on Android and iOS apps without having to write Java or Objective-C code. The
plugin provides a C# interface for requesting ads that is used by C# scripts in
your Unity project.
This guide is intended for publishers who want to monetize a Unity app.
Android API level is set in Project Settings > Player >
Android > Other Settings > Other Settings.
Import the Mobile Ads for Unity plugin
OpenUPM-CLI
If you have the OpenUPM CLI
installed, you can install the OpenUPM registry with the following
command:
openupmaddcom.google.ads.mobile
Remove .unitypackage plugin assets
If you are migrating from using a .unitypackage to using OpenUPM, you
must manually uninstall the assets from the old location. Remove the
following directories that were imported from the .unitypackage:
Assets/ExternalDependencyManager
Assets/GoogleMobileAds
Assets/Plugins/Android/googlemobileads-unity.aar
Assets/Plugins/Android/GoogleMobileAdsPlugin
Assets/Plugins/iOS/GADUAdNetworkExtras
Assets/Plugins/iOS/unity-plugin-library.a
OpenUPM
Open the package manager settings
by selecting the Unity menu option
Edit > Project Settings > Package Manager.
Add OpenUPM as a scoped registry to the Package Manager window:
Open the package manager menu by selecting the Unity
menu option Window > Package Manager.
Set the manager scope drop-down to select My Registries.
Select the Google Mobile Ads for Unity package from the package list
and press Install.
Remove .unitypackage plugin assets
If you are migrating from using a .unitypackage to using OpenUPM, you
must manually uninstall the assets from the old location. Remove the
following directories that were imported from the .unitypackage:
Assets/ExternalDependencyManager
Assets/GoogleMobileAds
Assets/Plugins/Android/googlemobileads-unity.aar
Assets/Plugins/Android/GoogleMobileAdsPlugin
Assets/Plugins/iOS/GADUAdNetworkExtras
Assets/Plugins/iOS/unity-plugin-library.a
Import from GitHub
Download the latest .unitypackage
release from GitHub.
Import the .unitypackage file by selecting the Unity menu option
Assets > Import package > Custom Package and importing all items.
Set your AdMob app ID
In the Unity editor, select Assets > Google Mobile Ads > Settings
from the menu.
Enter your Android and iOS
AdMob app ID
in each field.
Initialize the SDK
Before loading ads, have your app initialize Google Mobile Ads Unity Plugin by
calling MobileAds.Initialize(). This needs to be done only once, ideally at
app launch.
Here's an example of how to call MobileAds.Initialize():
MobileAds.Initialize((InitializationStatusinitstatus)=>
{if(initstatus==null){Debug.LogError("Google Mobile Ads initialization failed.");return;}Debug.Log("Google Mobile Ads initialization complete.");// Google Mobile Ads events are raised off the Unity Main thread. If you need to// access UnityEngine objects after initialization,// use MobileAdsEventExecutor.ExecuteInUpdate(). For more information, see:// https://developers.google.com/admob/unity/global-settings#raise_ad_events_on_the_unity_main_thread});
If you're using mediation, wait until the callback occurs before loading ads to
verify that all mediation adapters are initialized.
Select an ad format
Google Mobile Ads Unity Plugin is now included in your Unity app when deploying to
either the Android or iOS platform. You're now ready to implement an ad. AdMob
offers a number of different ad formats, so you can choose the one that makes
for the best user experience.
Banner
Banner ad units display rectangular ads that occupy a portion of an app's
layout. They can refresh automatically after a set period of time. This means
users view a new ad at regular intervals, even if they stay on the same
screen in your app. They're also the simplest ad format to implement.
Interstitial ad units show full-page ads in your app. Place them at natural
breaks and transitions in your app's interface, such as after level completion
in a gaming app.
Native ads are ads where you can customize the way assets such as headlines and
calls to action are presented in your apps. By styling the ad yourself, you can
create a natural, unobtrusive ad presentations that can add to a rich user
experience.
Rewarded ad units enable users to play games, take surveys, or watch videos to
earn in-app rewards, such as coins, extra lives, or points. You can set
different rewards for different ad units, and specify the reward values and
items the user received.
Rewarded interstitial is a new type of incentivized ad format that lets you
offer rewards, such as coins or extra lives, for ads that appear automatically
during natural app transitions.
Unlike rewarded ads, users aren't required to opt in to view a rewarded
interstitial.
Instead of the opt-in prompt in rewarded ads, rewarded interstitials require an
intro screen that announces the reward and gives users a chance to opt out if
they want to do so.
[[["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-06-12 UTC."],[],["The Google Mobile Ads Unity plugin enables Unity developers to integrate Google mobile ads into Android and iOS apps using C#. Key actions include: setting up prerequisites (Unity version, API levels, Xcode, CocoaPods), installing the plugin via OpenUPM or GitHub, and removing old `.unitypackage` assets. You will need to include external dependencies, and resolve Android dependencies. The next step is to enter your AdMob app ID in settings, initialize the SDK with `MobileAds.Initialize()`, then select and implement an ad format (banner, interstitial, native, rewarded, rewarded interstitial, app open).\n"]]