Follow this guide to quickly add Vungle Android SDK to the AdMob mediation layer. Including Vungle ads in AdMob mediation requires integrating the Vungle adapter, which enables communication between the AdMob SDK and the Vungle SDK.
- AdMob must be set up before starting this tutorial. To begin, sign up for an AdMob account.
- The Vungle AdMob Android adapter supports both interstitial and rewarded video placements.
- Interstitial video ads play automatically at your selected placement. Vungle calls these non-incentivized ads.
- Rewarded video ads are user opt-in and offer rewards to users in exchange for ad views. Vungle calls these incentivized ads.
- If you haven't already done so, head over to the Vungle dashboard and add your app to your account. This step is required for you to get your Vungle Application ID. You will use the Vungle App ID to initialize Vungle within AdMob.
- Log into the AdMob dashboard and click + Monetize New App.
- In Step 1 - Select an app, click Search For Your App if your app is live on Google Play Store. If you are adding your app manually, make sure you select Android as Platform.
- In Step 2 - Select ad format and ad unit:
- For Interstitial ads, make sure the Video option is selected, because all Vungle ads are of this nature.
- For Rewarded Interstitial ads, select the Set a reward option and enter values in the Reward amount and Reward item fields. Vungle does not support the Use third-party ad network settings functionality.
- Click + New Ad Network and select Vungle from the left panel. Find your Vungle Application ID on the Vungle dashboard (Vungle uses one app ID for both interstitial and rewarded interstitial).
- For Ad network optimization (Optional), enter the Reporting API key to give AdMob access to your eCPM through the Vungle Reporting API. (Refer to How can I request a Reporting API key? for the key, if you don't have it.)
Please follow AdMob’s Get Started in Android Studio guide to integrate AdMob SDK into your Android project. Then continue with AdMob’s Interstitial Ads guide and/or Rewarded Ads: Publishers Get Started guide to request and display ads.
- Download Vungle AdMob Adapter
- Download Vungle Android SDK
- Add Vungle AdMob adapter (one .aar file) and Vungle SDK (three .jar files) to your project library:
- Update the app level
compile fileTree(dir: 'libs', include: ['*.jar']) // Vungle SDK
compile(name:'VungleAdapter', 'ext':'aar') // Vungle Adapter for AdMob
- Update the
AndroidManifest.xmlfile for Vungle permissions and activities:
<!-- permissions to download and cache video ads for playback -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Required activities for playback of Vungle video Ads -->
Vungle will now be in the default AdMob waterfall, along with any other ad networks you choose. Now all you need to do is test the integration, submit the app, and go live by switching Vungle and AdMob out of Test Mode!
For more general information about the Vungle Android SDK, please refer following guides:
* Please note that
onAdLeftApplication() callback is never invoked when an ad is clicked and the browser/ app store is launched.
Android SDK v4.0.3 and AdMob adapter v2.1.0 supports extra parameters.
Sets unique user ID to be passed to Vungle SDK to be used in server-to-server callback for incentivized ads.
Sets the starting sound state for the ad. If false, video begins muted but user may modify.
Sample integration code:
// build network extras bundle
Bundle extras = new VungleExtrasBuilder()
// build request for reward-based ads
AdRequest rewardedAdRequest = new AdRequest.Builder()
// load rewarded ad
// or for interstitial ads
AdRequest interstitialAdRequest = new AdRequest.Builder()
// load interstitial ad