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 Initialization

iOS Initialization

Android Integration Setup

Please follow these instructions for adding Smaato to AdMob and DFP as a secondary ad network.

  1. First, import the Soma SDK and the AdMob/DFP SDK to the project.
  2. 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 ads
    • InterstitialAdMobMediationAdapter.java for interstitial ads
    • VideoAdMobMediationAdapter.java for video interstitial ads
  1. This guide assumes the adapters are placed in the package com.smaato.soma.MediationAdapter.

 

  1. Log in to your Admob account.
  2. For your ad unit, click on X ad source in the Mediation column.
  3. Click on New Ad Network.
  4. Click on Custom Event in the header row of the Available ad networks form.
  5. As Class Name enter the fully qualified name of your adapter class (e.g., com.smaato.soma.MediationAdapter.AdMobMediationAdapter)
  6. As Parameter enter your Smaato publisher ID and SPX Adspace ID in the form of publisher=<yourPublisherID>&adspace=<yourAdSpaceID>
  7. Choose a label.
  8. 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:

    1. Create a library project in your IDE (e.g., Eclipse or AndroidStudio)
    2. Copy and paste the AdMob Mediation Adapter to the package that you want to use
    3. Make all the needed modification in the mediation adapter (e.g., choose the ad dimension)
    4. Copy and paste the generated .jar file from the /bin folder to /Asset/Plugins/Android in your unity project
    5. 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:

  1. Click Edit mediation link on your Ad unit e.g. Top Banner on Home
  2. Click + New ad network button
  3. Click + Custom Event button
  4. Create a custom event with the following parameters:
    • Class Name:SOMAAdMobBannerReceiver
    • Label: Choose a name, e.g. Smaato Optimization
    • Parameter:publisher=yourPublisherID&adspace=yourAdSpaceID

Configure Your XCode Project

Add the SOMAAdMobBannerReceiver.hand SOMAAdMobBannerReceiver.mfiles to your project. These are included in the SDK .ZIP folder.

Modified: August 6, 2019 at 1:22 pm