AdMob | Android & iOS
Here you will find how to mediate Smaato through the Google Mobile Ads (AdMob) SDK for both Android and iOS platforms.
Initializing
All libraries need to be explicitly initialized. Please consult the corresponding AdMob integration guides.
Android InitializationiOS Initialization
Android Integration Setup
Please follow these instructions for adding Smaato to AdMob and DFP as a secondary ad network.
- First, import the Soma SDK and the AdMob/DFP SDK to the project.
- Then, copy/paste the desired adapter classes to your project. The SDK ZIP file contains three adapters for AdMob/DFP under the “Mediation Adapter” directory:
-
AdMobMediationAdapter.java
for banner adsInterstitialAdMobMediationAdapter.java
for interstitial adsVideoAdMobMediationAdapter.java
for video interstitial ads
- This guide assumes the adapters are placed in the package
com.smaato.soma.MediationAdapter
.
- Log in to your Admob account.
- For your ad unit, click on X ad source in the Mediation column.
- Click on New Ad Network.
- Click on Custom Event in the header row of the Available ad networks form.
- As Class Name enter the fully qualified name of your adapter class (e.g.,
com.smaato.soma.MediationAdapter.AdMobMediationAdapter
) - As Parameter enter your Smaato publisher ID and SPX Adspace ID in the form of
publisher=<yourPublisherID>&adspace=<yourAdSpaceID>
- Choose a label.
- Click Save.
Integrating Unity With the AdMob Mediation Adapter
Prerequisites:
- The AdMob SDK is integrated into your Unity project
- Access to the Smaato Android SDK
This requires just a few steps. All you need to do is following:
-
- Create a library project in your IDE (e.g., Eclipse or AndroidStudio)
- Copy and paste the AdMob Mediation Adapter to the package that you want to use
- Make all the needed modification in the mediation adapter (e.g., choose the ad dimension)
- Copy and paste the generated .jar file from the /bin folder to /Asset/Plugins/Android in your unity project
- Run the Unity project.
iOS Mediation Setup
Getting Started
We also provision for usage through an AdMob or DFP account via custom events. Follow the respective instructions below.
For Admob:
Add a Custom Event and Handler in the AdMob Dashboard:
- Click Edit mediation link on your Ad unit e.g. Top Banner on Home
- Click + New ad network button
- Click + Custom Event button
- Create a custom event with the following parameters:
- Class Name:
SOMAAdMobBannerReceiver
- Label: Choose a name, e.g. Smaato Optimization
- Parameter:
publisher=yourPublisherID&adspace=yourAdSpaceID
- Class Name:
Configure Your XCode Project
Add the SOMAAdMobBannerReceiver.h
and SOMAAdMobBannerReceiver.m
files to your project. These are included in the SDK .ZIP folder.
Last Modified: February 20, 2020 at 3:26 pm
© 2005-2020 Smaato, Inc. All Rights Reserved. Smaato® is a registered trademark of Smaato, Inc.