QuickStart Guide for AdMob Mediation + Vungle SDK v.5.1+ (Android)

Contents

Before You Begin

Step 1. Set Up Vungle as an Ad Network

  1. Log into the AdMob dashboard and navigate to the Monetize tab. 

  2. Choose the app to which you want to add Vungle as an ad network.

  3. Select the ad format and add the ad unit to your app.

    • For the Interstitial ad format, select the Video option, because all Vungle ads are video ads.

      image2.png

    • For the Rewarded video ad format, select the Set a reward option and enter values in the Reward amount and Reward item Vungle does not support the Use third-party ad network settings functionality.

      image6.png

  4. Choose your ad unit and click ad sources in the Mediation column.

    image1.png

  5. Click + New Ad Network.

    image5.png

  6. Select Vungle from the left panel and enter your Vungle Application ID. 

    image4.png

Step 2. Integrate the Vungle Adapter and SDK

  1. Download the Vungle AdMob adapter and add it to your project library.

    image3.png

  2. Follow the instructions in the “Step 1. Include the Vungle SDK in Your Project“ section of “Get Started with Vungle - Android SDK“ to add the necessary frameworks.

  3. If you need to set Multidex , Proguard, and Google Play Services, follow the instructions in the “Advanced Settings“ section of “Get Started with Vungle - Android SDK“.

Step 3. Pass a Placement Reference ID to the Adapter

With Vungle SDK version 5.1, you must import VungleExtrasBuilder and create a Bundle object to provide the placement reference ID and all placement reference IDs to the Vungle adapter.

Note: A default placement is created for each app automatically. You must provide its placement reference ID in this initialization step whether or not you plan to take advantage of the placements functionality. If you create multiple placements, provide all the reference IDs.

For Interstitial:

String[] placements = @[@"PLACEMENT_ID_1", @"PLACEMENT_ID_2", @"PLACEMENT_ID_3"];
Bundle extras = new VungleExtrasBuilder(placements).setPlayingPlacement("PLACEMENT_ID_1").build();
AdRequest adRequest = new AdRequest.Builder()
       .addNetworkExtrasBundle(VungleInterstitialAdapter.class, extras)
       .build();

mInterstitialAd01.loadAd(adRequest);

For Rewarded Video:

String[] placements = @[@"PLACEMENT_ID_1", @"PLACEMENT_ID_2", @"PLACEMENT_ID_3"];
Bundle extras = new VungleExtrasBuilder(Placements).setPlayingPlacement("PLACEMENT_ID_2").build();
AdRequest adRequest = new AdRequest.Builder()
       .addNetworkExtrasBundle(VungleAdapter.class, extras)
       .build();

mRewardedAd01.loadAd(RewardedAdUnitID01, adRequest);

Note: The Vungle SDK will cache an ad automatically for the placement you selected to be Auto Cached​ in the Vungle Dashboard. We highly recommend selecting the AdMob Ad Unit shown first or the Ad Unit shown most frequently as the Auto Cached placement.

Passing Additional Parameters (Optional)

You can use extra properties to customize ads.

Property

Description

userId

Sets unique user ID to be passed to Vungle SDK for use in server-to-server callback for Rewarded ads.

setSoundEnabled

Sets the starting sound state for the ad. If set to false, video begins with muted sound, but the user may modify it.

// sending user id ("USER_ID") and setting ad playback muted
String[] placements = @[@"PLACEMENT_ID_1", @"PLACEMENT_ID_2", @"PLACEMENT_ID_3"];
Bundle extras = new VungleExtrasBuilder(placements).setUserId("USER_ID").setSoundEnabled(false)
.setPlayingPlacement("PLACEMENT_ID_1").build();
AdRequest adRequest = new AdRequest.Builder()
       .addNetworkExtrasBundle(VungleInterstitialAdapter.class, extras)
       .build();

mInterstitialAd01.loadAd(adRequest);
Have more questions? Submit a request

Comments