Admob Configuration

How to Integrate Google AdMob in your App

Introduction

AdMob is a multi platform mobile ad network that allows you to monetize your android app. By integrating AdMob you can start earning right away. It is very useful particularly when you are publishing a free app and want to earn some money from it.

Integrating AdMob is such an easy task that it takes not more than 5mins. In this article we’ll build a simple app with two screen to show the different types of ads that AdMob supports.

Creating Ad Units

NOTE : AdMob admin interface changes quite often. The below steps to create Ad Unit IDs might differ time to time.

Want to know more?? Follow this link - https://developers.google.com/admob/android/quick-start

1. Sign into your AdMob account.

2. Create a new App by giving the package name of the app you want to integrate AdMob. Once the App is created, you can find the APP ID on the dashboard which looks like ca-app-pub-XXXXXXXXX~XXXXXXXXX.

3. Select the newly created App and click on ADD AD UNIT button to create a new ad unit.

4. Select the ad format and give the ad unit a name.

5. Once the ad unit is created, you can notice the Ad unit ID on the dashboard. An example of ad unit id look like ca-app-pub-066XXXXXXX/XXXXXXXXXXX

After creating banner ad unit and interstitial ad unit you have to place you adUnit id in string.xml file.

Go to the app > project > Others > GlobalConstant.swift > ADAPPKEY

Replace ADAPPKEY = " Replace ad unit id"

Go to the app > project > Others > GlobalConstant.swift >ADBOTTOMBANNER

Replace ADBOTTOMBANNER = " Replace bottom id"

Go to the app > project > Others > GlobalConstant.swift >ADFULLBANNER

Replace ADFULLBANNER = " Replace interstial id"

Last updated