Integrating AdMob Mediation + Vungle SDK v.5.1+ (iOS)

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 Rewarded video ad format, 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.

      image5.png

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

    image6.png

  5. Click + New Ad Network.

    image1.png

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

    image3.png

Step 2. Integrate the Vungle Adapter and SDK

  1. Download the Vungle AdMob adapter and the Vungle SDK. Then add them to your project by placing them under the Frameworks folder.

    image4.png

    Make sure VungleSDK.framework and libVungleAdapter.a are included in the project's Build Phases → Link Binary With Libraries section.

  2. Follow the instructions in the “Add Other Required Frameworks“ section of “Get Started with Vungle - iOS SDK“ to add the necessary frameworks.

  3. Follow the instructions in the “Add the “-ObjC” Linker Flag“ section of “Get Started with Vungle - iOS SDK“ to add the linker flag.

  4. Follow the instructions in the “Remove the iOS Status Bar“ section of “Get Started with Vungle - iOS SDK“ to remove the status bar.

Step 3. Pass a Placement Reference ID to the Adapter

With Vungle SDK version 5.1, you must import VungleAdNetworkExtras.h and create a VungleAdNetworkExtras object to provide placement reference ID and all placement reference IDs to 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:

    self.interstitial = [[GADInterstitial alloc] initWithAdUnitID:@"AD_UNIT_ID"];
    self.interstitial.delegate = self;
    GADRequest *request = [GADRequest request];
    VungleAdNetworkExtras *extras = [[VungleAdNetworkExtras alloc] init];
    extras.placements = @[@"PLACEMENT_ID_1", @"PLACEMENT_ID_2", @"PLACEMENT_ID_3"];
    extras.placement = @"PLACEMENT_ID_1";
    [request registerAdNetworkExtras:extras];
    [self.interstitial loadRequest:request];

For Rewarded Video:

    GADRequest *request = [GADRequest request];
    VungleAdNetworkExtras *extras = [[VungleAdNetworkExtras alloc] init];
    extras.placements = @[@"PLACEMENT_ID_1", @"PLACEMENT_ID_2", @"PLACEMENT_ID_3"];
    extras.placement = @"PLACEMENT_ID_1";
    [request registerAdNetworkExtras:extras];
    [[GADRewardBasedVideoAd sharedInstance] loadRequest:request
                                           withAdUnitID:@"AD_UNIT_ID"];

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 the Vungle SDK for use in server-to-server callback for Rewarded ads.

muted

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

// sending user id ("USER_ID") and setting ad playback muted
self.interstitial = [[GADInterstitial alloc] initWithAdUnitID:@"AD_UNIT_ID"];
self.interstitial.delegate = self;
GADRequest *request = [GADRequest request];
VungleAdNetworkExtras *extras = [[VungleAdNetworkExtras alloc] init];
extras.placements = @[@"PLACEMENT_ID_1", @"PLACEMENT_ID_2", @"PLACEMENT_ID_3"];
extras.placement = @"PLACEMENT_ID_1";
extras.userId = @"USER_ID";
extras.muted = YES;
[request registerAdNetworkExtras:extras];
[self.interstitial loadRequest:request];
Have more questions? Submit a request

Comments