AdMob Mediation Integration Guide for SDK 6.4 and Below

This guide will instruct you step-by-step on how to set Admob live as an Ad Network on Unity LevelPlay. The integration process is completed in a few simple steps:

  1. Create an AdMob Account
    1. Sign Up
    2. Sign in
  2. Create an Application and Ad Zone in AdMob
  3. Activate AdMob in Your ironSource Network Setup Module
  4. Add the AdMob Adapter to Your Build

Before You Start

  • Make sure you have correctly integrated ironSource’s Interstitial in your application.
  • Admob Rewarded Video is supported from Unity Plugin 6.5+.

Step 1. Create an AdMob Account

  1. To access AdMob’s ad inventory through Unity LevelPlay, you must create an account with AdMob. You can do so here.
    Note: Note: AdMob requires you to have a valid AdSense and AdWords account. If you don’t have either of these accounts, you can create them during the sign-up process and connect them to your Google account.
    Supersonic Mediation with AM Signup

Step 2. Create an Application and Ad Zone in Admob

Next, you must add your app and set up Ad Zones in your Admob account.

  1. Add Your App

    1. Log into your Admob account. On your dashboard, click the ‘+Monetize New App” button. You can also navigate to ‘Monetize‘ in the top menu where you will see the same button.ironsource-admob-mediation-new -app
    2. You will be redirected to the below page where you can either search for your app, add your app manually or simply select an existing app to monetize.
      ironsource-admob-mediation-add-app
      Note: Note: You will need a unique Admob application per platform (iOS + Android), just the same as in your ironSource account.
    3. Select Interstitial  for your ad unit format and enter the relevant details.
      1. For Interstitial:
        Ad Type: You can leave all three boxes checked as we support text, image and video interstitials.
        Ad unit name: we recommend naming intuitively so it will be easy to recognize as the ad unit you’ll be serving Admob interstitials through Unity LevelPlay.
        ironsource-admob-mediation-interstitial 
      2. Click ‘Save‘.
        Note: Note: You will then see your Ad Unit ID. We recommend saving this piece of information for later on.AdMob 5
    4. You can skip step 3 (Set Up Firebase Analytics) and 4 (View implementation instructions) and proceed to click ‘Done‘. Again, you will see your App ID and Ad Unit ID before you exit and we recommend saving these for later use.
      ironsource-admob-mediation-3

Step 3. Activate AdMob in Your ironSource Network Setup Module

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

App ID The unique ID assigned to your app on Admob’s dashboard.
Ad Unit ID  This is the unique identifier of your Application in Admob’s system.
API Key This is a unique identifier for your Admob account, which allows Unity LevelPlay to import performance data from your Admob account to use in reporting & optimization.
Client ID This is the unique identifier that specifies the relationship between your account and the ad unit.
Client Secret This is the unique identifier that specifies the relationship between your account and the ad unit.
Refresh Token  This is the refresh token the client application already received.

Once you obtain this information, you must configure Admob’s Parameters in your ironSource Account. By adding the above information correctly, you will be able to take full advantage of Admob’s ad inventory and reporting data on Unity LevelPlay.

  1. App ID
    To retrieve your App ID, go to Settings in the upper right corner of your dashboard and select ‘App Management‘ from the dropdown.  You will then see a table of all your apps with their corresponding IDs in the App ID column of the table.
    ironsource-dashboard-admob-app-management
  2. Ad Unit ID
    1. To retrieve your Ad Unit ID, go to ‘Monetize‘. You’ll see a table with a summary of the ad units of the latest app you chose to work with.
    2. In the ad unit column, you’ll see the name of the ad unit and the ad unit ID.ironsource-admob-mediation-4
  3. API KEY
    1. To retrieve your API KEY, you must first create a designated project for your app on the Google Cloud Console. If this is your first time creating a project, you will be asked to agree to the Terms of Service. Provide a name for the project and click ‘Create‘. It may take a few minutes to set set up your new project.
      ironSource platform Create Project in Admob
    2. You will be redirected to the console’s dashboard, where you should select “Use Google APIs’:
      Admob ironSource Dashboard
    3. Next, go to ‘Credentials‘ in the left sidebar.
      ironsource-platform-admob-api-key-credentials
    4. Select ‘Create credentials‘ and click on ‘API Key‘ in the drop-down.
      ironsource-platform-select-api-key
    5. This will automatically create an API Key for you and present it:
      ironsource-platform-api-key
    6. If you need to retrieve it later on, you will find the API Key under API Keys in the Credentials section:
      ironsource-platform-api-key-dashboard
  4. Client ID & Client Secret
    1. To retrieve your Client ID & Client Secret, go to Google’s API Manager.
    2. In the API Project drop-down at the upper-right of the page, select ‘Create a project’ or select the project you already created for this app:
      Supersonic Mediation AM API Project
      In the case you are creating a new project for this purpose,  provide a Project name in the dialog box that appears and click ‘Create’.
      ironSource Admob Project Name
    3. In the left sidebar, select ‘Credentials’, then select the ‘OAuth consent screen’ tab. On this page, provide a Product Name. Click Save:
      Supersonic Mediation AM Project Name
    4. Under Advertising APIs, go to ‘AdSense Management API‘:
      Admob Advertising API
    5. Next, ‘Enable‘ the AdSense API:
      Supersonic AM Enable API
    6. Select the Credentials tab in the left sidebar. Click the ‘Create Credentials’ drop-down and select ‘OAuth client ID’:Supersonic Mediation AM 14
    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 
        Credentials for Mediation AM ironSource
    8. Click ‘Create‘ and you will be presented with your ‘Client ID‘ and ‘Client Secret‘:
      Supersonic Mediation AM Client ID Secret
  5. 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, select ‘https://www.googleapis.com/auth/adsense.readonly’ and click ‘Authorize APIs‘:
      Admob 21
    4. Grant your project access to your AdSense data:
      ironSource Admob Credentials
    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’s Parameters into ironSource Account

  • Once you have all of these parameters, log in to your ironSource account and go to ‘Monetize‘ ➣ ‘Mediation‘ ➣ ‘SDK Networks‘.
    ironsource-admob-mediation-ironsource-dashboard
  • Select Admob from the list of Available Ad Networks and enter the Admob ‘API Key‘, ‘Client ID‘, ‘Client Secret‘ and ‘Refresh Token‘. If you’d like to activate this network in specific countries, you can select these from the dropdown.
    ironsource-admob-mediation-ironsource-dashboard
  • Click ‘Save‘. Admob will then be enabled in the Available Ad Networks table.
    ironsource-admob-mediation-ironsource-dashboard-3
  • Next, select the app on which you’d like to run Unity LevelPlay‘s mediation with Admob.
    ironsource-admob-mediation-ironsource-dashboard
  • Select Admob from the Setup list of Ad Networks and click on the tool Define icon. Insert the App ID and Ad Unit ID‘  under Interstitial Settings.
    ironsource-platform-define-setup-adm
    ironsource-mediation-dashboard-admob-app-settings
  • Set status to Active and click ‘Save’. You will then see Admob as Active for Mediation on your Setup Dashboard.
  • New! 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 Plugin (Android Integration):

  1. Download the Admob Unity Package:
    Import the SupersonicAdmobAdapter_[version].unitypackage to your Unity project. You can find the latest Admob Unity Package here.
  2. Add the Admob files to your Unity project:
    1. To add the adapter, simply double click on the SupersonicAdmobAdapter_[version].unitypackage and add all files to your Unity project.
      Note: Note: If you are upgrading from a previous version, please remove Admob.x.x.x.jar from Assets/Plugins/Android/Supersonic/libs.
  3. Update AndroidManifest.xml:
    Manifest Permissions:
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

    Manifest Activities:
    Add the following activities inside the <application> tag on your manifestAdditions:

  4. <activity android:name="com.google.android.gms.ads.AdActivity"
    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" />

Unity Plugin (iOS Integration):

  1. Download the Admob Unity Package:
    Import the SupersonicAdmobAdapter_[version].unitypackage to your Unity project. You can find the latest Admob Unity Package here.
  2. Add the Admob files to your Unity project:
    To add the adapter, simply double click on the SupersonicAdmobAdapter_[version].unitypackage and add all files to your Unity project.
    Note: Note: If you are upgrading from a previous version, please remove Admob.x.x.x.framework from Assets/Plugins/iOS.
    Our Unity Plugin adds the necessary frameworks automatically to your Xcode project.

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 add additional Ad networks, follow the integration guides on our Supported Ad Networks list.