Google bidding integration guide
This guide instructs you step-by-step on how to set Google as a bidder network on Unity LevelPlay Mediation.
Google Ad Manager ads are served using the AdMob SDK.
AdMob SDK supports iOS version 10+, and will server ads for users on iOS version 11+.
Step 1. Create an AdMob Account
- To access Google’s ad inventory through Unity LevelPlay Mediation, you need to create an account with AdMob.
- 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.
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.
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
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.
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 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 |
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 into LevelPlay.
-
-
- 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.
- 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.
- Client ID and Client Secret
- 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:
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:
- In the left sidebar, select Credentials, then select the OAuth consent screen tab.Then, provide a Product Name and click Save:
- In the left sidebar, select Dashboard, and go to Enable APIs and services:
- Next, enable the AdMob API:
- Select the Credentials tab in the left sidebar. Click the Create Credentials drop-down and select OAuth client ID
- 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
- Authorized JavaScript origins:
- Click Create, and you will be presented with your Client ID and Client Secret:
- Refresh Token
- To retrieve your Refresh Token, go to the OAuth 2.0 Playground.
- 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
- Next, in Step 1: Select & Authorize APIS, enter ‘https://www.googleapis.com/auth/admob.report’ and click Authorize APIs:
- Grant your project access to your AdMob data
- 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:
- App ID
-
Configure AdMob Parameters in Unity LevelPlay
-
-
- Once you have all of these parameters, log in to your ironSource account and go to ‘Monetize‘ ➣ ‘SETUP‘ ➣ ‘SDK Networks‘.
- Select Google from the list of Manage Networks and enter the Admob Client ID, Client Secret and Refresh Token or click the Login with Google option.
Login with Google:
- Once you have all of these parameters, log in to your ironSource account and go to ‘Monetize‘ ➣ ‘SETUP‘ ➣ ‘SDK Networks‘.
- 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
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+.
As of V7.42.0 (Adapter version 4.3.3 onwards), 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.
iOS
ironSource SDK supports both Cocoapods and Manual download mechanisms.
Cocoapods
To integrate the AdMob SDK with Cocoapods, enter the following line in your podfile and you’re good to go!
pod 'IronSourceAdMobAdapter','4.3.43.1'
Manual Download
- Download the AdMob Adapter
Add the AdMob Adapter and SDK to your build. You can find the latest AdMob Adapter and SDK here.
As the AdMob Adapter does not contain the AdMob SDK. You need to add the AdMob SDK to your project as well. - Add the AdMob XCframeworks to your Project
After you download the Adapter and SDK, drop the Adapter and SDK XCframework files into your Xcode Project. - Open Target ➣ Build Settings ➣ Architectures and confirm that your Xcode Project uses Base SDK version 8.0 or greater and that it does not use armv6 architecture.
- Linker Flags:
Add two separate linker flags to Target ➣ Build Settings ➣ Linking ➣ Other Linker Flags:
–ObjC
Step 5. Update Info.plist
As of V7.42.0 (Adapter version 4.3.3 onwards), 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 iOS Adapter 4.3.11+.
Use the following syntax, to set AdMob tagForChildDirectedTreatment with the parameter YES:
[IronSource setMetaDataWithKey:@"AdMob_TFCD" value:@"true"];
Use the following syntax, to set AdMob tagForChildDirectedTreatment with the parameter NO:
[IronSource setMetaDataWithKey:@"AdMob_TFCD" value:@"false"];
To learn more about Child-directed settings Under AdMob network visit here.
here.
Users under the age of consent – GDPR
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 iOS Adapter 4.3.11+.
Use the following syntax, to set tagForUnderAgeOfConsent with YES:
[IronSource setMetaDataWithKey:@"AdMob_TFUA" value:@"true"];
Use the following syntax, to set tagForUnderAgeOfConsent with NO:
[IronSource setMetaDataWithKey:@"AdMob_TFUA" value:@"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 iOS Adapter 4.3.28+.
Use the following syntax, to set maxAdContentRating:
[IronSource setMetaDataWithKey:@"AdMob_MaxContentRating" value:@"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.
Step 7. Enable Native ads (closed beta)
Resources bundle
The resources bundle contains the Native Banner Custom views for the different banner sizes. Follow these steps to add the resources bundle to your project:
- Click on your project target
- Go to the build phases tab
- Open the Copy Bundle Resources and click on the + icon
- Choose the ISAdMobResources.bundle and click on Add
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.