Get Started

This guide is intended for publishers who want to monetize a Unity app.

Integrating the Google Mobile Ads Unity plugin into an app, which you will do here, is the first step toward displaying AdMob ads and earning revenue. Once the integration is complete, you can choose an ad format (such as native or rewarded video) to get detailed implementation steps.


Download the Mobile Ads Unity plugin

The Google Mobile Ads Unity plugin enables Unity developers to easily 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. Use the links below to download the Unity package for the plugin or to take a look at its code on GitHub.


Import the Mobile Ads Unity plugin

Open your project in the Unity editor. Select Assets > Import Package > Custom Package and find the GoogleMobileAdsPlugin.unitypackage file you downloaded.

Make sure all of the files are selected and click Import.

Include the Mobile Ads SDK

The Google Mobile Ads Unity plugin is distributed with the Unity Play Services Resolver library. This library is intended for use by any Unity plugin that requires access to Android specific libraries (e.g., AARs) or iOS CocoaPods. It provides Unity plugins the ability to declare dependencies, which are then automatically resolved and copied into your Unity project.

Follow the steps listed below to ensure your project includes the Mobile Ads SDK.


In the Unity editor, select Assets > Play Services Resolver > Android Resolver > Resolve. The Unity Play Services Resolver library will copy the declared dependencies into the Assets/Plugins/Android directory of your Unity app.


No additional steps are required to include the Mobile Ads SDK into the Unity project.

  • When using Unity 5.6 and above, an xcworkspace is generated that includes the required dependency libraries. Use the generated xcworkspace instead of the standard Xcode project.
  • When using older versions of Unity, the dependencies are included inside the standard Xcode project.

Set your AdMob App ID

Follow the steps listed below to set your AdMob App ID.


Add your AdMob App ID to the AndroidManifest.xml file in the Assets/Plugins/Android/GoogleMobileAdsPlugin directory of your Unity app, using the <meta-data> tag as shown below. You can find your App ID in the AdMob UI. For android:value insert your own AdMob App ID in quotes.

        <!-- Your AdMob App ID will look similar to this
        sample ID: ca-app-pub-3940256099942544~3347511713 -->

If your app uses Ad Manager instead of AdMob, add the following <meta-data> tag to the AndroidManifest.xml file in the Assets/Plugins/Android/GoogleMobileAdsPlugin directory of your Unity app, instead of the tag shown above.



This step is currently not required for iOS apps.

Unity 4 compatibility

If you're using Unity 4, follow the additional steps listed below.


Add the highlighted activity section below to the AndroidManifest.xml file located in the Assets/Plugins/Android/GoogleMobileAdsPlugin directory of your Unity project.

<manifest xmlns:android=""
 <uses-sdk android:minSdkVersion="14"
     android:targetSdkVersion="19" />
 <activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
     <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
   <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
   <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik"
       android:value="true" />


Modify the following build settings within the Xcode project generated by Unity:

  1. Set Enable Modules (C and Objective-C) to Yes in Build Settings.
  2. Add $(inherited) to Other Linker Flags in Build Settings.

Initialize MobileAds

Before loading ads, have your app initialize the Mobile Ads SDK by calling MobileAds.Initialize() with your AdMob App ID. This needs to be done only once, ideally at app launch. You can find your app's App ID in the AdMob UI.

Here's an example of how to call Initialize() within the Start() method of a script attached to a GameObject:

using GoogleMobileAds.Api;
public class GoogleMobileAdsDemoScript : MonoBehaviour
    public void Start()
        #if UNITY_ANDROID
            string appId = "ca-app-pub-3940256099942544~3347511713";
        #elif UNITY_IPHONE
            string appId = "ca-app-pub-3940256099942544~1458002511";
            string appId = "unexpected_platform";

        // Initialize the Google Mobile Ads SDK.

Note how a different App ID is used, depending on the platform. You'll need to use an iOS App ID to initialize the Mobile Ads SDK on iOS and an Android App ID to initialize the Mobile Ads SDK on Android.

Select an ad format

The Mobile Ads SDK 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 best fits your user experience needs.

Banner ads are rectangular image or text ads that occupy a spot within an app's layout. They stay on screen while users are interacting with the app, and can refresh automatically after a certain period of time. If you're new to mobile advertising, they're a great place to start.

Implement a Banner


Interstitials are full-screen ads that cover the interface of an app until closed by the user. They're best used at natural pauses in the flow of an app's execution, such as in between levels of a game or just after completing a task.

Implement an Interstitial

Rewarded Video

Rewarded video ads are fullscreen video ads that users have the option of watching in full in exchange for in-app rewards.

Implement Rewarded Video


ご不明な点がありましたら、Google のサポートページをご覧ください。