Rewarded and Fullscreen
Appnext Mopub adapter - Rewarded and Fullscreen video ad unit
Adding Appnext Rewarded/Fullscreen to Mopub
Step 1: Login to your MoPub account and configure Appnext
As explained above, you must have an MoPub account, and an associated app within this account, in order to integrate Appnext
Step 2: Select your app and click to monetize it
- Within your MoPub account, press the ‘Apps’ tab
- For Rewarded videos - Appnext must be integrated as a Rewarded Video ad unit (fullscreen)
- For Fullscreen videos - Appnext must be integrated as a custom event of a fullscreen ad unit (landscape / portrait).
- After clicking on your app’s name, you will need to click the “Add an Ad Unit” button:
Rewarded Videos:
- Define your Ad Unit, by selecting the following:
- Device - select a device type (Phone / Tablet)
- Format - select "Rewarded Video"
- Name - enter a name for your ad unit
- Frequency cap - optional, but not recommended
When you set the server-to-server callback URL in Mopub dashboard, the Mopub SDK will send the dashboard. If you set a rewarded postback within Appnext adapter, it will send the rewarded postback from Appnext in addition to Mopub we recommend using Mopub's settings only.
Click the “Save” button
Fullscreen Videos:
- Define your Ad Unit, by selecting the following:
- Device - select a device type (Phone / Tablet)
- Format - select "Fullscreen"
- Name - enter a name for your ad unit
- Layout - choose “Portrait” or “Landscape” according to your app orientation
- Frequency cap - optional, but not recommended
Click the “Save” button
Step 8: Configure Appnext as a network (if you haven’t done it in the past)
You will to configure Appnext as an ad network and associate it with your Ad Unit.
- Click on the “Networks” tab
- Click on the “New network” button:
- Select “Custom SDK network”:
- Set up the Custom SDK Network:
Network name - enter a name for the new network: “Appnext”
- Set Up Your Inventory as describe:
i. Scroll down to find your app
ii. Under your app, find your Rewarded Ad Unit
iii. Add the following class to the “CUSTOM EVENT CLASS” section [- 2nd cube in the line ]:
//For rewarded videos:
com.appnext.sdk.adapters.mopub.ads.AppnextMoPubRewardedVideo
//For fullscreen videos:
com.appnext.sdk.adapters.mopub.ads.AppnextMoPubCustomEventFullScreenVideo
iv. Add your app’s Placement ID (available on the Appnext platform) to the “CUSTOM EVENT CLASS DATA” section:
{"AppnextPlacementId":"YOUR_PLACEMENT_ID_HERE"}
The data in this section should be in JSON format.
v. Configure Appnext’s Interstitial from the server (optional):
You can configure several elements in the Appnext unit, without editing your client-side integration, by passing their values in the “CUSTOM EVENT CLASS DATA” section [- 3nd cube in the line ] (see the optional parameter explanation at the end of the doc):
Fullscreen
{
"AppnextPlacementId":"YOUR_PLACEMENT_ID_HERE",
"AppnextButtonText":"Install",
"AppnextButtonColor":"#6AB344",
"AppnextBackButtonCanClose":"false",
"AppnextCategories":"Action",
"AppnextPostback":"Your_Postback",
"AppnextMute":"false",
"AppnextVideoLength":"30",
"AppnextShowClose":"true",
"AppnextOrientation":"not_set"
}
Rewarded
{
"AppnextPlacementId":"YOUR_PLACEMENT_ID_HERE",
"AppnextVideoMode":"normal",
"AppnextRollCapTime":"3",
"AppnextMultiTimerLength":"8",
"AppnextBackButtonCanClose":"false",
"AppnextCategories":"Action",
"AppnextPostback":"Your_Postback",
"AppnextMute":"false",
"AppnextVideoLength":"30",
"AppnextOrientation":"not_set",
"AppnextShowCta":"true"
}
Configuring the Ad Unit on this section, will overwrite the default and custom ad unit configuration, set in the client-side integration step.
Step 9: Create / edit your App’s ad unit’s segment
In order for Appnext ads to appear in your ad unit, you must set a priority for Appnext ads, by creating a segment and configure Appnext’s eCPM accordingly.
- Go to the “Segments” tab:
- Go to “Global Segments”:
- Click on your Ad Unit (under your app) and set the eCPM for the Appnext network.
- Set the Frequency Caps:
a. Hourly Impression Cap (optional)
b. Daily Impression Cap (optional)
c. Allocation Percentage (optional)
Click the “Save” button
Step 10: You’re all done!
Your MoPub SDK should start showing Appnext ads immediately.
If Appnext ads are not shown, check the eCPM allocation and make sure it’s high enough so it will give Appnext priority.
Important Note
- Each placement has a Placement ID. If you integrate multiple placements, you will need to use a different Placement ID for each.
Customizing the ad unit - Fullscreen Video
The Appnext SDK provides an option to change the ad unit’s configuration. By default, the SDK configuration will be loaded from Appnext's server, but you can choose to change it directly by creating a config object and call any of the following setters before loading the ad by the MoPub loadAd interface.
FullscreenConfig config = new FullscreenConfig();
config.setCategories("Action");
config.setPostback("YOUR_POSTBACK_HERE");
config.setBackButtonCanClose(false);
config.setMute(false);
config.setVideoLength(Video.VIDEO_LENGTH_LONG);
config.setOrientation(Ad.ORIENTATION_AUTO);
config.setShowClose(false);
Map<String, Object> extras = new HashMap<>();
extras.put(AppnextMoPubCustomEvent.AppnextConfigurationExtraKey, config);
mCustomisedCustomEventFullScreen.setLocalExtras(extras);
mCustomisedCustomEventFullScreen.load();
List of configuration options:
Roll screen caption time setRollCaptionTime
setRollCaptionTime
The number of seconds that the google play text caption is showing. The caption is shown to the user after clicking the Call-to-action button. The function (setRollCaptionTime) can accepts values from 1 to 20. The default value is 3 seconds. Entering -1 will make the caption visible until the video finish to play
###Category setCategories
Set preferred ad categories
Install Postback setPostback
setPostback
Postback parameters that will be posted to your server after user installed an app (make sure to encode the values)
Mute Video setMute
setMute
Mute the video which is played in the ad (the default value is "false")
- true
- false
Fullscreen - Show Close Button setShowClose
setShowClose
Display or hide the "x" (close) button
- true
- false
Video Length setVideoLength
setVideoLength
Set video length - 15 or 30 seconds long (default is VIDEO_LENGTH_DEFAULT)
VIDEO_LENGTH_SHORT
- Up to 15 seconds long videosVIDEO_LENGTH_LONG
- 20-60 seconds long videosVIDEO_LENGTH_DEFAULT
- Appnext's algorithm priority. Any available video campaign will be served
Please Note!
Please note that if no SHORT type length videos are available, long videos will be served
Orientation setOrientation
setOrientation
Set the preferred orientation if both landscape and portrait are supported by the application (default is ORIENTATION_DEFAULT
). The ad unit displayed orientation cannot be changed by the user after the ad unit started.
FullScreenVideo.ORIENTATION_DEFAULT
FullScreenVideo.ORIENTATION_LANDSCAPE
FullScreenVideo.ORIENTATION_PORTRAIT
Customizing the ad unit - Rewarded Video
Rewarded ad unit configuration
It is possible to change the Rewarded ad unit configuration using Mopub dashboard (See above). In addition to the Fullscreen setters, the following setters are available for the Rewarded ad unit only.
Rewarded video mode AppnextVideoMode
AppnextVideoMode
Set the mode the rewarded ad unit will work in:
- Multi - with pre-roll video selection screen
- Normal - without pre-roll video selection screen (default)
Rewarded video video selection timer AppnextMultiTimerLength
AppnextMultiTimerLength
When "multi" mode is on, this function (setMultiTimerLength) sets the number of seconds to make a video selection. The function can accept values from 1 to 20. The default value is 8 seconds.
Rewarded Postback Parameters - Using Appnext Rewarded parameters in addition to Mopub server-side postback (Optional)
You can choose to Initialize MoPub with custom Rewarded Postback parameters, In addition to the settings in the Mopub ad unit setting. Doing so will fire a client-side postback as defined in Appnext dashboard. This postback will be sent to your server once a user finished watching a video (the time to reward him). It is highly recommended to use either Mopub settings or Appnext settings, but not both at the same time.
MoPubRewardedVideos.initializeRewardedVideo(this, new AppnextMoPubRewardedVideo.AppnextMediationSettings.Builder()
.withRewardsAmountRewarded("1")
.withRewardsCustomParameter("add_custom_param")
.withRewardsRewardTypeCurrency("USD")
.withRewardsTransactionId("add_unique_id")
.withRewardsUserId("add_user_id")
.build());
App Categories
1. Action 2. Adventure 3. Arcade 4. Arcade & Action 5. Board 6. Books & Reference 7. Brain & Puzzle 8. Business 9. Card 10. Cards & Casino 11. Casino 12. Casual 13. Comics 14. Communications 15. Education 16. Educational 17. Entertainment 18. Family 19. Finance 20. Health & Fitness 21. Libraries & Demo 22. Lifestyle 23. Live Wallpaper | 24. Media & Video 25. Medical 26. Music 27. Music & Audio 28. News & Magazines 29. Personalization 30. Photography 31. Productivity 32. Puzzle 33. Racing 34. Role Playing 35. Shopping 36. Simulation 37. Social 38. Sports 39. Sports Games 40. Strategy 41. Tools 42. Travel & Local 43. Trivia 44. Weather 45. Word |
Make sure to encode (%20) categories with more than 1 word, example: Travel%20%26%20Local
Integration Support
Should you have any problems integrating the product, log a ticket with us by emailing [email protected].
Updated over 6 years ago