Introduction
The purpose of this article is to guide publishers who want to use the Fyber FairBid SDK to load and display ads from AdMob via FairBid mediation.
This is a six-step process:
- Create or login to your AdMob Account
- Create an application and AdZone within AdMob
- Activate AdMob in your Fyber Setup
- Retrieve the parameters from the AdMob
- Insert the AdMob parameters into the Fyber Console
- Add the AdMob SDK to your integration
Supported Formats
AdMob currently supports the following ad formats:
- Banner
- Interstitial
- Rewarded (with Google Play Services version 9.0.2+ integrated in your app)
Refer to AdMob to learn about any additional formats they may now support.
Step 1: Create or Login to your AdMob Account
To access AdMob’s ad inventory through Fyber‘s Mediation platform, create or login to your AdMob account. For details on creating an account, click here.
You must have a valid AdSense Management and AdWords account to work with AdMob. You can create them during the sign-up process and connect them to your Google account, if you do not already have them.
Step 2: Creating an Application and AdZone in AdMob
- Sign in to the AdMob account you created, here.
- Click Apps on the dashboard
- Either search for your app, add your app manually or select an existing app to monetize
Adding a New App
Follow the steps below to begin the process of adding a new app.
- Click on Add App
- You are asked if your app has already been published in the Google Play or App Store
If you answer Yes
- Enter the App Name, Developer Name or App ID
- Click Search to find your app and follow the instructions on screen.
If you answer No the following window opens.
-
Enter a name for the new app
-
Select the Platform for your app
-
Click Add
You app has now been added to the selected platform.
Linking your App
You must link your app with Google Play Store.
- Go to App Settings >> App Info
- Click the Edit icon
- Click Link Your App with Google Play
- Search for your app in the search window and click Select
Note
The action cannot be undone, so make sure you link the correct app.
- Click Link App
You app has now been linked to Google Play.
The next step is to add Ad Units to your app.
- From the AdMob homepage click Apps and select your app.
- In the App Overview window, click Add Ad Unit.
- Select the Ad Format you want
Banner
- On the Create Ad Unit window, under Banner, click Select.
- Enter a name for the Ad Unit
- Click Advanced Settings and enter the details, as required
- Click Create Ad Unit
Interstitial
- On the Create Ad Unit window, under Interstitial, click Select.
-
Enter a name for the Ad Unit
-
Click Advanced Settings and enter the details, as required
Ad Type: Leave the two boxes checked as Fyber supports text, image, video and rich media in interstitials. -
Click Create Ad Unit
Rewarded
- On the Create Ad Unit window, under Rewarded, click Select.
-
Enter a name for the Ad Unit
Ad unit name: Fyber recommends naming the ad unit so it can be easily recognized as the ad unit you are serving AdMob Banners through the FairBid Mediation platform. -
Click Advanced Settings and enter the details, as required
-
Click Create Ad Unit
-
Your App ID and Ad Unit ID are displayed, it is recommended to save these for use later in the process.
- Click Done.
Step 3: Activate AdMob in your Fyber Network Setup Module
Sign in to your Google account when setting up AdMob on the FairBid SDK Networks Setup.
With AdMob, the Account Credentials (Account ID, Refresh Token and Client ID) are retrieved automatically and remain the same for all of your apps using AdMob as a mediated network.
Important
You must ensure that any Adblockers are deactivated to use this feature.
You can either login with your Google account or enter the credentials manually.
Logging-In with Google
- Click Sign in with Google
- The Sign in with Google window opens.
- Select the account details with which you want to login and confirm access rights.
Your account details are displayed in the AdMob Account Credentials.
Click the uncover icon to view the Account ID and Refresh Token that is valid for all of your apps.
If you want to switch the option and enter the credentials manually, click Revoke Access and enter the credentials manually into the relevant fields.
If you enter an email which is not recognised in the system, you receive the following error:
Important
If you make changes to the credentials, the changes affect all of the apps using AdMob.
Step 4: Retrieve the Parameters from the AdMob
There are a several parameters from your AdMob account you must insert into the Fyber Console. Once you obtain this information, configure AdMob’s Parameters in your Fyber Account. By adding the above information correctly, you can take full advantage of AdMob’s ad inventory and reporting data on the Fyber FairBid Mediation platform.
Set out below are explanations of how to obtain these parameters.
The parameters required depend on whether you are configuring the network at the App Level or Placement Level in the Fyber Console.
AdMob Parameter | Description | Fyber App / Placement |
---|---|---|
Account ID | The identifier of the account associated with the Ad Unit. | Both |
Client ID | This is the unique identifier detailing the relationship between your account and the ad unit. | Both |
Client Secret | A unique identifier detailing the relationship between your account and the ad unit. | Both |
Refresh Token | The refresh token the client application already received. | Both |
Alternatively, watch and listen to the video below to find out how to obtain the required parameters:
Retrieving the Account ID/Unit ID
To retrieve your Account ID/Ad Unit ID:
- Go to the Apps tab on the left side bar on AdMob’s platform
- Click Ad Units
The application’s ad units and Ad Unit ID are displayed.
Retrieving the Client ID and Client Secret
Follow these steps to obtain the Client ID and Client Secret.
Enabling AdMob API
Follow these steps to enable the AdMob API.
- Go to the Google APIs Library
- In the search field enter AdMob API and click AdMob API.
- Click Enable to use the AdMob API.
The AdMob API is now enabled.
Retrieving the Refresh Token
To retrieve the Refresh Token:
- Go to OAuth 2.0 Playground, here.
- On the top left-hand corner, click Step 1 Select & Authorize APIs.
- Enter the following two URLs in the Input your own Scopes field (separated by a space)
- Click Authorize APIs.
- Move to Step 2.
- Click Exchange authorization code for tokens.
Your Refresh Token and Access Token are displayed. These are used for access to OAuth protected resources.
Now that you have obtained the required parameters, you can complete the configuration of AdMob in your Fyber Account.
Step 5: Insert the AdMob Parameters into the Fyber Console
To enter the parameters obtained from AdMob and insert them into the Fyber Console, follow these steps.
- Sign-in to your Fyber account.
- Select your app from the App Management window.
- On the App Management page, click Mediated Networks.
- Select AdMob from the list.
The AdMob Mediation window opens:
- Enter the parameters you obtained earlier, together with your Bundle ID and App ID.
- The Bundle ID is taken from the App itself (not the AdMob dashboard).
- The App ID can be found in the app's Play Store URL after 'id'. For example, in https://play.google.com/store/apps/details?id=com.company.appname the identifier would be com.company.appname
- For each ad format, enter the Instance Name and your Ad Unit ID.
Instance name should be distinguishable in case you have multiple AdMob Instances.
Note
If you are configuring the mediated network at app level, fewer credentials may be required.
- Click Save
- To complete the set up, you must associate the network instance that you just created to the relevant Placement set up on the Fyber dashboard. For a detailed guide click here.
Step 6: Adding the AdMob SDK to your Integration
To add the AdMob SDK go to the Supported Networks page and follow the guide while selecting the Configuration for AdMob.
Important
As of V17.0.0 (Adapter version 4.3.1 onwards), for Android implementations, AdMob’s SDK requires publishers to add their AdMob App ID to the app’s AndroidManifest as a child of the tag:
Simply replace the “[ADMOB_APP_ID]” with the APP ID value you obtain here.
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="[ADMOB_APP_ID]"/>
Info.plist
In your app's Info.plist file,
- add a GADApplicationIdentifier key with a string value of your AdMob app ID.
You can find your App ID in the AdMob UI. For more information, click here.
- add a GADIsAdManagerApp key with a boolean value set to YES.
<key>GADIsAdManagerApp</key>
<true/>
For more information, click here
Note
This is specific to iOS configurations.
AdMob Reporting API
The AdMob Reporting API allows you to obtain information about your AdMob account.