AdMob

In this part, we will instruct you step-by-step on how to set AdMob as an Ad Network on the AdTiming Mediation platform.

Before You Start

  • Make sure you have correctly integrated AdTiming's Native, Interstitial, Rewarded Video or Banner Ads in your application.
  • To serve AdMob's Rewarded Video, you must have Google Play Services version 9.0.2+ integrated in your app.

Important! The ADAPTERS for ad networks are modularized, which means that you need to download Not Only the SDK of mediation networks  you choose to work with But Also the adapters for those networks. Be sure to follow the Guide below to mediation AdMob‘s Ads.

Step 1. Create an AdMob Account

To access AdMob's ad inventory through AdTiming's Mediation platform, you must create an account with AdMob. You can do so here.

Please Note: 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.

Step 2. Create an Application and Ad Unit in AdMob

Next, you must add your app and set up Ad Unit in your AdMob account.

1. Add Your App

  • Log into your AdMob account. On your dashboard, click the 'Apps' button.
  • A modal will appear where you can either search for your app, add your app manually or simply select an existing app to monetize.

admob_android_1.png

 

Please Note: You will need a unique AdMob application per platform (iOS + Android).

 

2. Add Ad Units

  • Select a specific app and click on 'Ad units' -> Click on 'ADD AD UNIT'.
  • Select Banner, Interstitial, Rewarded Video or Native as your ad unit format and enter the relevant details.

admob_android_2.png

 

  • When you complete all these options, click 'Done' and you will get your App ID and Ad Unit ID.

admob_android_3.png

Step 3. Retrieve AdMob Parameters

Serving Admob’s ads through the AdTiming Mediation platform has never been this easy. Sign in to your Google account when setting up AdMob on the AdTiming Mediation Setting and we’ll retrieve all the necessary parameters to run AdMob’s Interstitials, Rewarded Video and Banners for you.

1. App ID

App ID is the unique ID assigned to your app on AdMob’s dashboard. 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. 

admob_android_4.png

 

2. Ad Unit ID

Ad Unit ID is the unique ID assigned to your app’s ad unit on AdMob’s dashboard. 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.

admob_android_5.png

 

3. Client ID & Client Secret

Client ID and Client Secret is a unique identifier for your AdMob account, which allows AdTiming Mediation Platform to import performance data from your AdMob account to use in reporting data.

  • To retrieve your Client ID & Client Secret, go to Google’s API Manager.
  • 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:

admob_android_6.png

          In case you are creating a new project for this purpose,  provide a Project name in the dialog box that appears and click 'Create'.

    admob_android_7.png

  • In the left sidebar, select 'Credentials', then select the 'OAuth consent screen' tab. On this page, provide a Product Name. Click Save:

admob_android_8.png

 

  • In the left sidebar, select 'Dashboard', and go to 'ENABLE APIS AND SERVICES':

admob_android_9.jpeg

 

  • Next, 'Enable' the AdSense API

admob_android_10.png

 

  • Select the Credentials tab in the left sidebar. Click the 'Create Credentials' drop-down and select 'OAuth client ID'

admob_android_11.png       

 

  • Select Web application, and provide a name for your app. In the fields below, you must enter Authorized redirect URI. You can find it on the AdMob Instance Setting page.

           admob_android_12.png

 

  • Click 'Create' and you will be presented with your 'Client ID' and 'Client Secret':

         admob_android_13.png

 

Step 4. Configure AdMob’s Parameters into AdTiming Account

  • Log in to your AdTiming account and go to 'Placement' -> 'Instances' -> 'Add Instance' 
  • Select AdMob from the list of Available Ad Networks and start editing.
  • Click 'New Account'.

___52___.jpg
 

  • Insert the App ID and Account Name and Currency, then you can select  'Sign in with Google' or 'Manual', click  'Save' after filling in all fields.

___53.jpg 

Step 5. Add the AdMob SDK&Adapter to Your Build

Android

1.  Add the AdMob SDK

  • Add the following in your project-level build.gradle file.
...
 allprojects {
   repositories {
       ...

       jcenter()
       maven {
           url "https://maven.google.com"
       }
    }
 }
  • Add the following in your application-level build.gradle file.
dependencies {
    ...
    implementation 'com.google.android.gms:play-services-ads:19.1.0'
 }

 

2. Add the AdMob Adapter

    AdTiming supports both Gradle dependencies and Manual download mechanisms.

       Gradle dependencies

  • Add the following in your project-level build.gradle file.
...
 allprojects {
   repositories {
        ...

        jcenter()
        maven {
            url "https://dl.adtiming.com/android-sdk"
        }
   }
 }
  • Add the following in your application-level build.gradle file.
implementation 'com.adtiming.adapters:admob:3.4.0@aar'

       Manual download

  • Download the AdMob Adapter from here.
  • Add the AdMob Adapter to Your Project
    Add the AdmobAdapter-x.x.x.aar to the libs folder in your Android Project.

mceclip0__1_.png

  • Make sure you add the following to your Gradle build file under the dependencies section:
implementation (name:'AdmobAdapter-x.x.x', ext:'aar')

 

3. Update Android Manifest.xml

  • Configure Android Manifest.xml
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="admob_app_id" />

 

4. For Proguard Users Only
If you are using ProGuard with the AdMob adapter, you must add the following code to your ProGuard configuration (Android Studio: proguard-rules.pro or Eclipse: proguard-project.txt):

-keep public class com.google.android.gms.** {
 public *;
}
-keep public class com.google.ads.** {
 public *;
}

 

5. Tips for using AdMob Mediation Solutions 

  • If you use instances with AdTiming mediation, please remove the AdMob code from your project.
  • If you use Instances with AdMob for waterfall management, please make sure only one initialization method was called for a specific user.
if(useAdtiming){
     AdtAds.init(this, adtimingKey, new Callback() {
             @Override
             public void onSuccess() {

          }

          @Override
          public void onError(String message) {

          }
     });
   }else{
      MobileAds.initialize(context, admobKey);
   }

 

iOS

AdTiming supports both Cocoapods and Manualdownload mechanisms.

Cocoapods

To Integrate the AdMob SDK with Cocoapods, enter the following line in your podfile and you are good to go!

pod 'Google-Mobile-Ads-SDK'
Copy

Manual Download

1. Download the AdMob framework

  • you can find the lastest AdMob SDK here.

2. Add the AdMob frameworks to your Project

Update Info.plist

If you have added AdMob SDK in your project, you need to update your application Info.plist file, add string value your AdMob application ID GADApplicationIdentifier key. You can find your app ID in the AdMob interface.

adadmob111.png

Please Note: Be sure to use your actual AdMob app ID instead of the ID listed above .

Importrant! This step is required since the Google Mobile Ads SDK version 7.42.0. Failure to add this Info.plist entry will result in a crash with the following message: "The Google Mobile Ads SDK was initialized incorrectly."

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

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.