Rewarded
Android SDK Admob Adapter - Rewarded ad unit
Important Note
Each placement has a Placement ID. If you integrate multiple placements, you will need to use a different Placement ID for each.
Adding Appnext Rewarded to Admob
Please follow the steps below to integrate Appnext’s adaptor for Admob
Step 1: Login to your AdMob account and configure Appnext
As explained above, you must have an AdMob account, and an associated app within this account, in order to integrate Appnext
Step 2: Within your AdMob account, press the “Apps” button and choose your app from the ‘All apps’ list:
Step 3: Create an ad unit
- Select the app for which you want to add a new ad unit from your app list on the left side menu.
- Click on “Ad Units” from the app screen.
- Click on the 'Get Started' button -
Note: If it's not your first Ad unit implementation, click on 'Add Ad Unit'
- Choose the 'Rewarded' Ad Unit -
- Configure your new ad unit
- Enter a name for your ad unit
- Click on Advanced settings
- Make sure both text, images, and videos are checked
- Please add the App ID to your project manifest file
Note: If it's not your first Ad unit implementation skip this step.
<meta-data
android:name=“com.google.android.gms.ads.APPLICATION_ID”
android:value=“ca-app-pub-3899300681756284~5575119254"/>
- After the Ad Unit is created successfully, please press on Meditation button
Then, press on create Medition Group button -
Choose Ad Format and Platform -
Enter Mediation Group name and click on Add Ad units -
Select your app:
Step 4: Under the Waterfall section
- Press on Add Custom Events
- Set Label and an eCPM value
Step 5: Configure eCPM
You should allocate the Appnext eCPM manually in order for Appnext to show ads in your AdMob SDK.
You can configure the eCPM for the Appnext network in the ‘Mediation’ page and press ‘Save’ after each change:
- In the “Custom Event” details fill the following details:
- Class name:
com.appnext.sdk.adapters.admob.ads.AppnextAdMobRewardedVideoAdapter
- Parameter: Appnext Placement ID
- Class name:
-
Finally, press ‘Done’ at the bottom of the page.
-
Choose the ‘Ad unit’ you want to add Appnext’s custom event from the ‘Ad units’ list by pressing its ‘ad sources’ link
- Click the "Save" button on the "Mediation" page to save the newly added ‘Ad Network‘
Step 6 (optional): Callbacks
In order to receive client-side callbacks, import the following references:
mCustomEventRewarded.setRewardedVideoAdListener(new RewardedVideoAdListener() {
@Override
public void onRewardedVideoAdLoaded() {
}
@Override
public void onRewardedVideoAdOpened() {
}
@Override
public void onRewardedVideoStarted() {
}
@Override
public void onRewardedVideoAdClosed() {
}
@Override
public void onRewarded(RewardItem rewardItem) {
}
@Override
public void onRewardedVideoAdLeftApplication() {
}
@Override
public void onRewardedVideoAdFailedToLoad(int errorCode) {
}
});
Step 7: You’re all done!
Your AdMob 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.
Configuring the ad unit - Rewarded
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 RewardedConfig object for RewardedVideo ad and call any of the following setters before loading the ad by the AdMob loadAd interface:
RewardedConfig config = new RewardedConfig();
config.setMultiTimerLength(7);
config.setRollCaptionTime(-1);
config.setMode(RewardedVideo.VIDEO_MODE_MULTI);
config.setPostback("Your_Postback_Params");
config.setCategories("Categories");
config.setMute(false);
config.setVideoLength(RewardedVideo.VIDEO_LENGTH_DEFAULT);
config.setOrientation(RewardedVideo.ORIENTATION_DEFAULT);Bundle customEventExtras = new Bundle();
customEventExtras.putSerializable(AppnextAdMobCustomEvent.AppnextConfigurationExtraKey, config);
mCustomEventRewarded.loadAd("AdMob_ID",
new AdRequest.Builder().addNetworkExtrasBundle(AppnextAdMobRewardedVideoAdapter.class, customEventExtras).build());
List of configurable options
Rewarded video modesetMode
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 setMultiTimerLength
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. Default value is 8 seconds.
Roll screen caption time 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. 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
Postback parameters that will be posted to your server after user installed an app (make sure to encode the values)
Mute Video setMute
Mute the video which is played in the ad (default is "false")
- true
- false
Video Length setVideoLength
Set video length - 15 or 30 seconds long (default is VIDEO_LENGTH_DEFAULT
)
VIDEO_LENGTH_SHORT
- Up to 15 seconds long videos
VIDEO_LENGTH_LONG
- 20-60 seconds long videos
VIDEO_LENGTH_DEFAULT
- Appnext's algorithm priority. Any available video campaign will be served
Please note that if no SHORT type length videos are available, long videos will be served
Orientation 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.
RewardedVideo.ORIENTATION_DEFAULT
RewardedVideo.ORIENTATION_LANDSCAPE
RewardedVideo.ORIENTATION_PORTRAIT
Server-side postback for rewarded video
You can choose to receive server-side postbacks whenever a user finishes watching a video ("video ended" event).
The "video ended" event will serve as a trigger for the reward action.
Please note that in addition to configuring the postback in this integration process, you will also need to set your postback URL on the Appnext Self-Service platform (under the "Apps" page / app "Settings & Placements" / "Advanced Settings').
In order to receive the server-side postback on the "video ended" event, call any of the following setters before loading the ad by the AdMob loadAd interface:
RewardedServerSidePostback postbackParams = new RewardedServerSidePostback();
postbackParams.setRewardsTransactionId("your_rewardsTransactionId");
postbackParams.setRewardsUserId("your_rewardsUserId");
postbackParams.setRewardsRewardTypeCurrency("your_rewardsRewardTypeCurrency");
postbackParams.setRewardsAmountRewarded("your_rewardsAmountRewarded");
postbackParams.setRewardsCustomParameter("your_rewardsCustomParameter");
Bundle customEventExtras = new Bundle();
customEventExtras.putSerializable(AppnextAdMobCustomEvent.AppnextRewardPostbackExtraKey, postbackParams);
mCustomEventRewarded.loadAd("AdMob_ID",
new AdRequest.Builder().addNetworkExtrasBundle(AppnextAdMobRewardedVideoAdapter.class, customEventExtras).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 |
Should you have any problems integrating the product, log a ticket with us by emailing [email protected]
Integration Support
Should you have any problems integrating the product, log a ticket with us by emailing [email protected]
Updated about 2 years ago