MoPub Mediation - pubnative/pubnative-hybid-android-sdk GitHub Wiki

To use HyBid SDK directly in MoPub Mediation you will need to integrate the MoPub SDK and the Hybid SDK into your app.

Integrate MoPub SDK

To integrate MoPub SDK into your app you should follow the instructions in their website.

Integrate HyBid SDK

To integrate the HyBid SDK follow the instruction in the integration page.

You also need to import the MoPub Adapters module from the HyBid SDK:

implementation 'net.pubnative:hybid.sdk:3.0.4'
implementation 'net.pubnative:hybid.adapters.mopub:2.9.0'

Code sample

You can find a demo app with code samples for this type of integration here.

Set up network on MoPub Dashboard

To set up the HyBid Adapters in the MoPub mediation you need to follow a few steps.

If you already have an app and ad units created then you can skip those parts.

Create app

Create a new app in the MoPub Dashboard

Create banner ad unit

Create a new ad unit and set up the format as Banner (320x50)

After this step, you will obtain an Ad Unit Id. Use this to request ads for this placement.

Create medium ad unit

Create a new ad unit and set up the format as Medium (300x250)

After this step, you will obtain an Ad Unit Id. Use this to request ads for this placement.

Create leaderboard ad unit

Create a new ad unit for tablet and set up the format as Leaderboard (728x90)

After this step, you will obtain an Ad Unit Id. Use this to request ads for this placement.

Create interstitial ad unit

Create a new ad unit and set up the format as Fullscreen

After this step, you will obtain an Ad Unit Id. Use this to request ads for this placement.

Create PubNative Mediation Network

Go to the Networks tab on the MoPub Dashboard. Select the option to add a new network. Select Custom SDK Network.

On the App and Ad Unit setup section of the network creation dialog, navigate the list of app all the way to the app and ad units where you want to set up HyBid adapters.

Insert for each format the following custom event names and params:

Custom event for Banner:

net.pubnative.lite.adapters.mopub.mediation.HyBidMediationBannerCustomEvent

Custom event for Medium:

net.pubnative.lite.adapters.mopub.mediation.HyBidMediationMRectCustomEvent

Custom event for Leaderboard:

net.pubnative.lite.adapters.mopub.mediation.HyBidMediationLeaderboardCustomEvent

Custom event for Interstitial:

net.pubnative.lite.adapters.mopub.mediation.HyBidMediationInterstitialCustomEvent

Custom event for Rewarded:

net.pubnative.lite.adapters.mopub.mediation.HyBidMediationRewardedVideoCustomEvent

Custom event for Native:

net.pubnative.lite.adapters.mopub.mediation.HyBidMediationNativeCustomEvent

Parameters to set up [Example]:

{
    "pn_app_token": "1234567890abcdefghijklmnopqrstuv",
    "pn_zone_id": "1"
}

After setting up the network. Activate it for the app in the Segments tab in the MoPub Dashboard

Set up the proper floor eCPM and make sure the network is enabled for all the required ad units.

Request ads

Ads should be requested using the regular MoPub process using the generated Ad Unit Ids. You can find the intructions in the MoPub developers page.

Initialization

Please note: to complete implementation, the HyBid SDK needs to be initialized. Follow the HyBid integration guide and complete this step.


-> Admob Mediation