Google bidding integration guide

This guide instructs you step-by-step on how to set Google as a bidder network on Unity LevelPlay Mediation.

For the Google bidder, the auto-setup tool is available to use once you complete step 1 below. The auto-setup tool will create an app and bidder placement and retrieve placement details from AdMob—so you don’t need to switch between the LevelPlay and AdMob platforms. Alternatively, you can complete the whole setup manually.

Before you start Make sure you have correctly integrated ironSource SDK interstitial, rewarded video or banner mediation in your application.

Google bidding is supported starting from ironSourcr SDK version 7.2.7+.

As of AdMob SDK 7.69.0+, AdMob are using XCFramework. If you are using CocoaPods for your AdMob integration, make sure you have CocoaPods Version 1.9.0+.

AdMob Supports Android Operating Systems Version 4.1 (API level 16) and up. The required Gradle Build Tool is 3.5.4.
You can learn about the support for AndroidX here.

AdMob SDK supports iOS version 10+, and will server ads for users on iOS version 11+.


Step 1. Create an AdMob Account

  1. To access Google’s ad inventory through Unity LevelPlay Mediation, you need to create an account with AdMob.
  2. It’s recommended to adjust the time zone of your AdMob account to UTC to align with the Unity LevelPlay platform. This will ensure accurate reporting. Learn more.

Important! Once you have completed step 1, you can skip to step 3 and use the auto bidder setup tool to get up and running with Google bidding on Unity LevelPlay. If you’d rather continue with a manual setup, continue with step 2.

Step 2. Create an application and ad unit in AdMob

Next, you must add your app to your AdMob account.

Add Your App

  • Log into your AdMob account. On your dashboard, click Apps then Add app
  • A modal will appear where you can either search for your app, add your app manually or simply select an existing app to monetize.
    add-your-app
    Note: You’ll need a unique AdMob application per platform (iOS + Android), just like your ironSource account.
  • Select interstitial, rewarded video, or banners as your ad unit format and enter the relevant details.
  • Interstitial
    • Ad unit name: Name the ad unit intuitively so it will be easy to recognize as the ad unit you’ll be serving
    • Partner bidding: Check the box to indicate that you are using bidding on another mediation platform
  • Rewarded Video
    • Ad unit name: Name the ad unit intuitively so it will be easy to recognize as the ad unit you’ll be serving
    • Partner bidding: Check the box to indicate that you are using bidding on another mediation platform
  •  Banners
    • Ad unit name: Name the ad unit intuitively so it will be easy to recognize as the ad unit you’ll be serving
    • Partner bidding: Check the box to indicate that you are using bidding on another mediation platform

    Step 3. Activate Google in your LevelPlay network setup module

    There are two ways that you can get Meta Audience Network setup on LevelPlay:

    • Auto-setup – Login with your Google account to automatically create new application and bidding placements and pull all the necessary configurations settings from Google AdMob platform
    • Manual – Go between the LevelPlay and Google AdMob platforms to retrieve and enter the necessary information.

    Auto-setup

    • Log into your LevelPlay account and go to the LevelPlay side nav bar ➣ SetupSDK Networks
    • Click on Manage Networks

    • Select Google AdMob from the list of available ad networks
    • Click Login with Google and log in with your approved Google accountt
    • If you’re already logged in, click reset login (A new log-in is required)

    • Once you’re logged in, toggle on Google auto-setup bidder

    • On the SDK Networks page, ​​Select the app where you’d like to run interstitial, rewarded video, or banner ads from Google Then click the Setup button in the Google row.

    • Click the Add Bidder button to automatically create new apps and bidding placements on the AdMob platform, and import the Ad Unit ID. If there is an App ID already attached to the app, you will be able to use the auto-setup tool if there is at least 1 placement without the Ad unit ID parameter value. In this case, a new bidding placement will be created.

    Sign in to your Google account when setting up Google bidding on the LevelPlay SDK Networks Setup page, and the necessary parameters to run AdMob interstitials, rewarded video, banners, and native ads will automatically be retrieved. 

    Click Save to approve and accept all configurations. If you close the module without saving, the assets will be created on the AdMob platform without importing the data onto the LevelPlay platform.

    Important! The status of Google bidder instances will be the same as the status of the ironSource Ads bidder, by ad unit. For example, if you’re not using the ironSource Ads bidder for rewarded videos, it will not be automatically activated for the Google network. To activate the Google bidding instance for rewarded videos, click on the Google row and toggle on the ad unit.

    Manual Setup

      • Log into your LevelPlay account and go to the LevelPlay side nav bar ➣ SetupSDK Networks
      • Click on Manage Networks

      • Select Google AdMob from the list of available ad networks

      There are a few pieces of data from your AdMob account that need to be inserted into your LevelPlay Network Setup Module in order for AdMob to work correctly with the ironSource SDK:

      App ID
      The unique ID assigned to your app on Admob’s dashboard.
      Ad Unit ID
      The unique ID assigned to your app’s ad unit on Admob’s dashboard.
      Client ID
      This is the unique identifier that specifies the relationship between your account and the ad unit.
      Client Secret
      The secret key that pairs with the Client ID
      Refresh Token
      This is the refresh token the client application already received.


      Once you obtain this information, you must configure AdMob’s Parameters into LevelPlay.

          1. App ID
            To retrieve your App ID, go to ‘Apps’ tab on the left side bar on Admob’s platform and click on ‘App Settings’ .  You will then see the application’s settings, as well as the App ID.
            app-id
          2. Ad Unit ID
            To retrieve your Ad Unit ID, go to ‘Apps’ tab on the left side bar on Admob’s platform and click on ‘Ad Units’. You will then see the application’s ad units, as well as the Ad Unit ID.
            ad-unit-id
          3. Client ID  and Client Secret
            1. To retrieve your Client ID & Client Secret, go to Google’s API Manager.
            2. Click on the API Project drop-down at the upper-left of the page, select ‘Create a project’ or select the project you already created for this app:1admob
              In the case you are creating a new project for this purpose,  provide a Project name, Billing account, and Location in the dialog box that appears and click Create:
            3. In the left sidebar, select Credentials, then select the OAuth consent screen tab.Then, provide a Product Name and click Save:admob-2
            4. In the left sidebar, select Dashboard, and go to Enable APIs and services:
            5. Next, enable the AdMob API:
            6. Select the Credentials tab in the left sidebar. Click the Create Credentials drop-down and select OAuth client ID3admob
            7. Select Web application, and provide a name for your app. In the fields below, you must enter https://developers.google.com/oauthplayground for at least one Authorized redirect URI. For example:
              • Authorized JavaScript origins: https://YOUR_NAMESPACE (Optional)
              • Authorized redirect URI: https://developers.google.com/oauthplayground admob-6
            8. Click Create, and you will be presented with your Client ID and Client Secret:
              Supersonic Mediation AM Client ID Secret
          4. Refresh Token
            1. To retrieve your Refresh Token, go to the OAuth 2.0 Playground.
            2. Click the settings icon in the upper right corner. Uncheck the box labeled Force approval prompt and check Use your own OAuth credentials. Input your Client ID and Client Secret
              Admob 18
            3. Next, in Step 1: Select & Authorize APIS, enter ‘https://www.googleapis.com/auth/admob.report’ and click Authorize APIs:
            4. Grant your project access to your AdMob data
            5. You should then receive the Authorization Code from Step 1 and will be able to click the Exchange authorization code for tokens button. Then you will get a Refresh token as well as an Access Token:
              Admob 22

      Configure AdMob Parameters in your ironSource Account

      • Once you have all of these parameters, log in to your ironSource account and go to ‘Monetize‘ ➣ ‘SETUP‘ ➣ ‘SDK Networks‘.
      • Select Google AdMob from the list of Manage Networks and enter the Admob Client ID, Client Secret and Refresh Token or click the Login with Google option.
      • Next, select the app on which you’d like to run Unity LevelPlay’s Mediation with Google bidding.
      • Select Google from the setup list of Ad Networks and click on the tool Define icon. Then insert the App ID and Ad Unit ID  under Interstitial, Rewarded Video or Banner Settings.
      • Verify your integration with the Reporting API; this column will check your integration through the Reporting API and return three possible responses: Verified, Failed and No Response. Double check your integration and the information you entered above; then click ‘Retry‘ until you see ‘Verified’.

      Step 4. Add the Admob adapter to your build

      Unity Integration Manager (Recommended)

      Once you’ve completed SDK integration, you can download AdMob Adapter, using the Unity Integration Manager.

      In your Unity Development platform, go to ironSource > Integration Manager.

      If you already have the latest version of the adapters, the action button will be changed to “Updated”, and will be disabled.

      Android (Manual Resolve)

      To apply your changes, make sure you use the “Resolve” process. This will download all relevant artifacts, according to your choices. For detailed information see instructions here

      Add AdMob App ID

      Android
      Add your AdMob App ID to the app’s AndroidManifest as a child of the <application></application> tag:

      <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID"
                 android:value="[ADMOB_APP_ID]"/>
      

      Replace the “[ADMOB_APP_ID]” with the APP ID value you retrieved in step 3.
      Not doing so results in crashes originated with AdMob’s SDK. For more information please refer to AdMob’s guide.

      iOS
      Add your AdMob App ID to the app’s plist as described here.
      Alternatively, you can make this change programmatically

      <key>GADApplicationIdentifier</key>
      <string>[APP_ID]</string>

      Replace the “GADApplicationIdentifier” value with the APP ID value you retrieve in step 3.

      Android Plugin Manual Integration

      1. Download the Admob Adapter for Android:
        Download AdMob adapter and AdMob SDK (AAR) from here.
      2. Add the Admob files to your Unity project:
        Import the files into Assets/Plugins/Android/.
      3. Add your AdMob App ID to the app’s AndroidManifest as a child of the <application></application> tag:
        <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID"
                   android:value="[ADMOB_APP_ID]"/>
        

        Replace the “[ADMOB_APP_ID]” with the APP ID value you retrieved in step 3.
        Not doing so results in crashes originated with AdMob’s SDK. For more information please refer to AdMob’s guide.

      iOS Plugin Manual Integration

      1. Download the AdMob iOS Adapter:
        Download AdMob adapter and  AdMob SDK from here.
      2. Add the AdMob adapter to your Unity project:
        Import AdMob adapter file into Assets/Plugins/iOS.
      3. Add the SDK to your Xcode project:
        As Unity3D do not support XCFrameworks, please ad the SDK XCFrameworks directly to your Xcode project.
      4. Add your AdMob App ID to the app’s plist as described here.
        Alternatively, you can make this change programmatically
        <key>GADApplicationIdentifier</key>
        <string>[APP_ID]</string>

        Replace the “GADApplicationIdentifier” value with the APP ID value you retrieve in step 3.

      Step 5. Update Info.plist (For iOS)

      As of AdMob SDK V7.42.0 for iOS (Adapter version 4.3.3 + iOS / Unity ), AdMob’s SDK requires publishers to add their AdMob App ID to the app’s plist as described here.
      Alternatively, you can make this change programmatically

      <key>GADApplicationIdentifier</key>
      <string>[APP_ID]</string>

      Replace the “GADApplicationIdentifier” value with the APP ID value you retrieve in step 3.
      Not doing so results in crashes originated with AdMob’s SDK. For more information please refer to AdMob’s guide.

      Step 6. Additional Steps

      Child-directed setting – COPPA

      Unity LevelPlay mediation lets publishers communicate AdMob Child-directed settings directly to the AdMob network.
      This feature is enabled using ironSource SDK 6.14.0+, AdMob Unity Adapter 4.3.12+.

      Use the following syntax, to set AdMob setTagForChildDirectedTreatment with the parameter “True”:

       IronSource.Agent.setMetaData("AdMob_TFCD","true");

      Use the following syntax, to set AdMob setTagForChildDirectedTreatment with the parameter “False”:

       IronSource.Agent.setMetaData("AdMob_TFCD","false");

      To learn more about Child-directed settings Under AdMob network visit here.
      here.

      Unity LevelPlay mediation lets publishers communicate with AdMob network, a Tag For Users under the Age of Consent in Europe (TFUA) request.
      This feature is enabled using ironSource SDK 6.14.0+, AdMob Unity Adapter 4.3.12+.

      Use the following syntax, to set setTagForUnderAgeOfConsent with “True”:

       IronSource.Agent.setMetaData("AdMob_TFUA","true");

      Use the following syntax, to set setTagForUnderAgeOfConsent with “False”:

       IronSource.Agent.setMetaData("AdMob_TFUA","false");

      To learn more about Child-directed settings Under AdMob network visit here.
      here.

      Ad Content filtering

      Unity LevelPlay mediation lets publishers communicate with AdMob network,  maximum ad content rating for all ad requests.
      This feature is enabled using ironSource SDK 7.12.0+, AdMob Android Adapter 4.3.23+.

      Use the following syntax, to set maxAdContentRating:

      IronSource.Agent.setMetaData("AdMob_MaxContentRating","MAX_AD_CONTENT_RATING_G");

      The possible values for this property are based on digital content label classification as defined by Google:

      • MAX_AD_CONTENT_RATING_G
      • MAX_AD_CONTENT_RATING_PG
      • MAX_AD_CONTENT_RATING_T
      • MAX_AD_CONTENT_RATING_MA

      To learn more about Ad Content Rating property Under AdMob network visit here.

      Content URL mapping support

      Unity LevelPlay supports Google’s content mapping for apps, and allows you to share URLs using “Google_Content_Mapping” settings. This feature is enabled using ironSource SDK 7.7.0+, AdMob Adapter 4.3.58+. Learn more about Google’s content mapping here.

      To pass a single-content URL, use the following syntax:

      IronSource.Agent.setMetaData("Google_Content_Mapping","https://www.example.com");

      To support multiple urls, use the same key and share up to 4 URLs:

      IronSource.Agent.setMetaData("Google_Content_Mapping",["https://www.expamle1.com","https://www.example2.com"]);

      Note:

      Verify Your Ad Network Integration

      The ironSource SDK provides an easy way to verify that your mediation integration was completed successfully. To verify your ironSource and additional Ad Networks’ integration, follow this document.

      Done!
      You are now all set to deliver Admob Ads within your application!


      What’s Next?

      To leverage additional mediation ad networks, integrate the adapters and follow our integration guides.