Ad Networks

Smaato as primary (Client Side Mediation)

Client side mediation (aka SDK mediation) enables you to mediate owned 3rd party network accounts via SDK (e.g. AdMob, MoPub, iAd, Millennial Media, or any other network via a custom SDK connector). To integrate our SDK as per the above, please integrate the respective 3rd party SDK as described below and configure your network mediation in your SPX account.

Google AdMob

We are now compatible with Google Mobile Ads v.11.8.0

Add the following lines to your AndroidManifest.xml file:

<!--GOOGLE ADMob Include the AdActivity -->
<activity android:name="com.google.android.gms.ads.AdActivity"
 android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
 android:theme="@android:style/Theme.Translucent" />

Add the following lines to your project level build.gradle file. Avoid any duplicate additions.

compile 'com.google.android.gms:play-services-ads:11.8.0'

MoPub

Add the following lines to your AndroidManifest.xml file:

<!--Mopub Activity -->
<activity android:name="com.mopub.mobileads.MoPubActivity"
    android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.MraidActivity"
    android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.common.MoPubBrowser"
    android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity"
    android:configChanges="keyboardHidden|orientation|screenSize"/>

Add the following lines to your project level build.gradle file. Avoid any duplicate additions:

repositories {
    jcenter()
    maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
    maven { url 'https://maven.google.com' }
}
// MoPub  aar dependency inclusion for Mediation
compile('com.mopub:mopub-sdk:[email protected]') {
    transitive = true
}

If you’re using Proguard in your project, add the following lines to your Proguard config file:

-dontwarn com.mopub.**
 
-keep public class * extends one.mopub.**
-keep class com.mopub.** { *; }

Millennial Media

Add the following lines to your AndroidManifest.xml file:

<activity android:name="com.millennialmedia.internal.MMActivity" />
<activity android:name="com.millennialmedia.internal.MMIntentWrapperActivity" />

Copy the latest .aar file from Millennial Media Android SDK (Reference http://docs.millennialmedia.com/android-ad-sdk/index.html)

Add the following lines to your project level build.gradle file. Avoid any duplicate additions.

compile project(':mm-ad-sdk')

If you’re using Proguard in your project, add the following lines to your Proguard config file.

keep classmembers class com.millennialmedia** {
public *;
}

­keep class com.millennialmedia**

Facebook

Add the following lines to your project-level build.gradle file. Make sure to avoid any duplicate additions.

compile 'com.facebook.android:facebook-android-sdk:4.27'
compile 'com.facebook.android:audience-network-sdk:4.27'

Next, add the following lines to your AndroidManifest.xml file:

<!--Facebook Audience Network Interstitial -->
<activity android:name="com.facebook.ads.InterstitialAdActivity"
    android:configChanges="keyboardHidden|orientation|screenSize" />
<!--Facebook Audience Network NativeAd-->
<activity android:name="com.facebook.ads.NativeAdVideoActivity"
    android:configChanges="keyboardHidden|orientation|screenSize" />

Also, if you’re using Proguard in your Project, consider adding the following lines to your Proguard config file as per your requirements:

-keep class com.facebook.ads.** { *; }
-keep class com.facebook.** { *; }

CustomMediationNetwork Adapter Ad

  • Write your custom mediation Adapter by extending MediationEventBanner class.
  • Add your custom method to get invoked through SPX portal and the signature of the method is fixed as shown in the Sample Adapter files.
  • Configure the Class name along with the package name com.smaato.soma.mediation.CustomMediationBannerAdapterSample,
    Method name and parameters in SPX portal,

Smaato as secondary

Compatible with:

  • AdMob v15.0.1
  • MoPub v5.3.0
  • Millennial Media v4.8.2

All libraries now need to be explicitly initialized. Please consult corresponding integration guides:

AdMob/DFP

Import the SDK

1. Import Soma SDK and the AdMob/DFP SDK to the project. (see Add the Smaato SDK to your project)

2. Copy & paste the desired adapter classes to your project. The SDK ZIP file contains two 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

This guide assumes the adapters are placed in the package com.smaato.soma.MediationAdapter.

3. For Admob – head over 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 publisher and ad space IDs in the form: publisher=<yourPublisherID>&adspace=<yourAdSpaceID>
  • Choose a label

4. For DFP – head over to your DFP account:

  • Create a new order and new line item, targeting the desired ad unit with this line item
  • Under that order and line item, add a new creative by clicking “Add Creatives”
  • Select “SDK mediation” to configure the SDK
  • Choose a “name” for the creative
  • Toggle the “Location data” to “Active”
  • For “Select network”, choose “Custom Event”
  • Use the “Parameter” field to transfer your Smaato publisher and adspace IDs, in the form: publisher=<yourPublisherID>&adspace=<yourAdSpaceID>
  • Choose a name in the “Label” field
  • In the “Class Name” field, enter the fully qualified class name of your adapter class (e.g. com.smaato.soma.MediationAdapter.AdMobMediationAdapter)
  • Click “Save” to save the creative
  • The Smaato SDK will now be called as specified for the targeted ad units

Integrating Unity with AdMob Mediation Adapter

Prerequisite:

  • AdMob SDK integrated in your Unity project.
  • Smaato Android SDK. Steps:This is very simple and just needs a few steps to be done. All what you need to do here, is following :
  1. Create a library project in your IDE (e.g.Eclipse or AndroidStudio)
  2. Copy paste the AdMob mediation Adapter to the package that you want to use
  3. Make all the modification needed in the mediation adapter (e.g.choose the ad dimension)
  4. Copy/Paste the generated .jar file from the /bin folder to/Assest/Plugins/Android in your unity project
  5. Run the unity project.

That’s it.

Mopub

For MoPub sdk you need to add for Rewarded Video Ads the following code to your AndroidManifest file:

<activity android:name="com.mopub.mobileads.RewardedMraidActivity" android:configChanges="keyboardHidden|orientation|screenSize" 
/>

MoPub Adapter Compatibility Matrix

Smaato SDK

Version

Mopub SDK version 4.7.0 Mopub SDK version 4.12.0 Mopub SDK version 4.13.0 MoPub SDK version 4.15 and above
Formats

Banner

Adapter

Interstitial

Adapter

Native

Adapter

Banner

Adapter

Interstitial

Adapter

Native

Adapter

Banner

Adapter

Interstitial

Adapter

Native

Adapter

Banner Adapter Interstitial Adapter Native Adapter Rewarded Video Adapter Interstitial Video Adapter
v 6.1.1 and above supported supported not supported supported supported supported supported supported supported supported supported supported supported supported
v 6.0.0 supported supported not supported supported supported supported supported supported supported supported supported supported not supported not supported
v 5.1.2 supported supported supported not supported not supported not supported not supported not supported not supported not supported not supported not supported not supported not supported
v 5.1.1 supported supported supported not supported not supported not supported not supported not supported not supported not supported not supported not supported not supported not supported

MoPub ID configuration

First, we’ll walk you through creating a MoPub ID and configuring it to work with the Smaato SDK.

  1. Login in to https://app.mopub.com, after that click on the Inventory Tab. Then click on the Add a New App button.
  2. Fill in the fields with your App info (e.g. platform, App Name, Package name, Category, etc.)
  3. When you’re done filling in the information, click the Save and View Code Integration button.
  4. You’ll be redirected to the Integration page, where your new Ad Unit ID will be generated.
  5. Copy your new Ad Unit ID and click on the All Done! button.

Next, we’ll create the custom event:

  1. Click on the Networks tab at the top of the page.
  2. Click the drop-down Add a Network menu and select Custom Native Network.
  3. Enter the name of your Custom Native Network (e.g. Smaato SDK).
  4. Then select the App Targeting area and add the class name by clicking on Set App Class.
  5. You’ll need to fill in the form with your class package:
    1. Enter the following in the Custom Event Class field: com.smaato.soma.mopubcustomevent.SomaMopubAdapter
    2. Also, put your Smaato Publisher ID and Adspace ID for the respective adspace in the Custom Event Class Data field, using JSON formatting – i.e. {"publisherId": "0","adSpaceId": "0"} (replace 0 with your IDs)
    3. Click on Save Section, and you’re good on the Mopub side of things for now.

Modified: September 24, 2019 at 8:10 pm