TRY BY YOURSELF AND EDITOR LINK
Preview: wannateam.link (Stay until the end )
Editor: Forum-vnihoul77 | Bubble Editor
INTRODUCTION
Rewarded ads can be a great solution to make a profit from your app, today weâll see how to integrate this into your app, from scratch.
This solution also works for other ads types such as Display ads or Video ads
Hereâs what it looks like:
DIFFICULTY
VERY EASY - START FROM SCRATCH
DURATION
FAST INTEGRATION (BUT YOU NEED TO WAIT FOR APIs)
Prerequisite
-
We will work with Adinplay (https://adinplay.com/) for three reasons: their integration process is very easy, they are approved by Google Ads, they answer super fast.
â Go to their website and fill the sign up form, donât worry youâll have a response within few hours
-
Install the plugin âToolboxâ (Toolbox Plugin | Bubble)
1 - UNDERSTAND HOW IT WORK
2 - GET YOUR API KEY
The Adinplay support will contact you after you submitted the form, they should send you your API key that looks like âXXX/xxxxxxx.xxxâ
3 - LOAD THE INTERSTITIAL ON YOUR PAGE
If you want to show the interstitial at a moment, you need to load the script into your page before.
For that, we use the following code in the âPage HTML Headerâ section of your page properties
(REPLACE THE XXXXXX VALUE AT THE END OF THE CODE WITH YOUR API KEY)
<script>
window.aiptag = window.aiptag || {cmd: []};
aiptag.cmd.player = aiptag.cmd.player || [];
//CMP tool settings
aiptag.cmp = {
show: true,
position: "centered", //centered, bottom
button: true,
buttonText: "Privacy settings",
buttonPosition: "bottom-left" //bottom-left, bottom-right, top-left, top-right
}
aiptag.cmd.player.push(function() {
adplayer = new aipPlayer({
AIP_REWARDEDCOMPLETE: function (evt) {
bubble_fn_adcomplete(evt);
},
});
});
function show_rewarded() {
//check if the adslib is loaded correctly or blocked by adblockers etc.
if (typeof adplayer !== 'undefined') {
aiptag.cmd.player.push(function() { adplayer.startRewardedAd(); });
} else {
//Adlib didnt load this could be due to an adblocker, timeout etc.
//Please add your script here that starts the content, this usually is the same script as added in AIP_REWARDEDCOMPLETE.
bubble_fn_adcomplete("error");
}
}
</script>
<script async src="//api.adinplay.com/libs/aiptag/pub/XXXXXX/tag.min.js"></script>
Now if we open the page and check what happens with Chrome, we can see that the script is loaded.
We can now execute our interstitial ad at any moment!
NOTES
You can only load your ads on the domains you give to Adinplay
If you have an error: check your Adblock :))
I really suggest you to read the code you copy paste
4 - RUN THE INTERSTITIAL
This part is very easy, you just have to add the âRun javascriptâ element to your workflow with this line:
show_rewarded();
(If youâre curious, itâs a javascript call, it will call the function âshow rewardedâ that we put in our HTML header, you can check itâs there.)
5 - HANDLE THE RESPONSE
Now when we click our button, the interstitial shows up But we need to catch the response from the ad, to know if the user watches the app fully and deserve a reward, if he aborted or if something went wrong (such as an adblocker)
Remember the code we copy-paste? (I told you to read it âŚ)
It says in English âwhen the reward is completed, then call the function bubble_fn_adcomplete with the parameter evt where evt is the message we want to getâ.
Another function call! Same as the one we used to show the ad, but this time itâs our ad that is called.
So we need to add a âJavascripttoBubbleâ element to our page with the following parameters.
This is the previously called function bubble_fn_suffix
And we want to trigger something (such as a reward) from this function call.
So we also create a workflow event trigger
6 - UNDERSTAND THE RESPONSE
So now the interstitial call us, and we pick up the phone. But we have to listen to the message itâll say. This is the different messages you can get from the interstitial:
âcanceledâ the user stop the interstitial before the end
âgrantedâ everything went well
âerrorâ something went wrong
Youâre now able to set yourself your events based on conditions:
GO FURTHER & CUSTOMIZE THE GDPR POPUP
Documentation: AdinPlay - Adding AdinPlay Ads to Your Site
If you need help, feel free to comment.
As well as if you have ideas to add or if you see English mistakes
AN IN-THE-THEME WAY TO THANKS ME 
You can see a rewarded (or two) ad here wannateam.link