BETA - Integrating AdMob Mediation + Vungle SDK v 6.4.10 (Android)

Use this guide to add Vungle Android SDK into your app, using AdMob as your main advertising mediation layer.

AdMob Android adapter v6.4.10 is compatible with Vungle Android SDK v6.4.10 and is tested with Google SDK v17.2.0

Download AdMob Android Adapter v6.4.10 and Include Vungle SDK and adapter(.aar) in your project by making following changes in the app-level build.gradle

buildscript {
  repositories {
    mavenCentral() // or jcenter()
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
  }
}

dependencies { 
  // Vungle SDK
  implementation(name: 'VungleAdapter', 'ext': 'aar')  // Vungle Adapter for AdMob
  implementation 'vungle-android-beta:publisher-sdk-android:6.4.10'
  
  
}

Contents

Requirements

  • Android 4.0 (Ice Cream Sandwich - API version 14 and above)
  • Amazon OS 5.4 and above

Setup

Before you begin testing the new adapter

  • Configure mediation settings as per the instructions on AdMob integration guide
  • Integrate the Application with the new adapter files and Vungle SDK
  • Update the Google Mobile Ads SDK to the latest version in the project

Note: Vungle SDK and adapter is verified against 17.2.0 version of Google Ads SDK

(https://developers.google.com/admob/android/rel-notes)

Verify that the integration contains the updated SDK and adapter (Vungle/6.4.10 and AdMob/6.4.10) by using a network monitor tool such as Charles.

Initialize the app and check the User-Agent in the Request Headers of /config call from Vungle to confirm the SDK version.

Memory Settings

Starting from v6.4.10, you can prevent the SDK from requesting ads or even initializing if the storage of your Android phone falls below a predefined threshold. If this happens, you will get an error similar to the following:

There is not enough file system size on the device. 

Sample code:

import com.vungle.mediation.VungleNetworkSettings;

//Integer value sets the required minimum available free storage space to be able to initialize the SDK
VungleNetworkSettings.setMinSpaceForInit(<INTEGER_VALUE>);

//Integer value sets the required minimum available free storage space to be able to request an ad
VungleNetworkSettings.setMinSpaceForAdLoad(<INTEGER_VALUE>);

Ad Format

v 6.4.10 onwards supports AdMob’s banner ads 

To display a banner ad in the application, create an MREC placement on Vungle dashboard and configure this to a Banner Ad unit on AdMob dashboard. 

Presently, Vungle supports banner size 300*250 and should be specified as MEDIUM_RECTANGLE as AdSize in the implementation

Sample code 

AdView adView = new AdView(this);
adViews.add(adView);
adView.setAdSize(AdSize.MEDIUM_RECTANGLE);
adView.setAdUnitId(<AdUnit>);

Android ID

From SDK v6.4.10 onwards, publishers can now restrict from passing Android ID from the device to the SDK

Sample code 


VungleNetworkSettings.setAndroidIdOptOut(true);

New Rewarded API

As documented in AdMob instruction guide, v17.2.0 and higher supports caching multiple rewarded ads at the same time.

Since Vungle does not support this feature, the Ad request for the second  “Load ad” will not be filled by Vungle, rather it will be passed to the next ad network in the waterfall. 

Network Specific Parameters 

The Vungle AdMob adapter continues to support network specific parameters and v6.4.10 and above will support an additional parameter setAutoRotateEnabled(bool) to play the ad as per device orientation

Sample code 


Bundle
extras = new VungleExtrasBuilder(placements)
         
.setSoundEnabled(false)
         
.setUserId("test_user")
.setAutoRotateEnabled(true)
         
.build();
AdRequest request =  new AdRequest.Builder()
         
.addNetworkExtrasBundle(VungleAdapter.class, extras)             // Rewarded video.
         
.addNetworkExtrasBundle(VungleInterstitialAdapter.class, extras) // Interstitial.
         
.build();

 

Was this article helpful?
0 out of 0 found this helpful