Video Ads
This module implements interstitial and rewarded video ads. Please read the JOGOS_SDK Introduction
page and the section related to your game engine, and use the video ad features as follows:
window.JOGOS_SDK.ad;
Please make sure to read our Ad Requirements, because if your game does not comply, it will be rejected without any feedback.
Requesting Video Ads
We support two types of video ads: interstitial (midgame
) and rewarded (rewarded
);
- Interstitial Ads: Can be triggered during events like user death or level completion.
- Rewarded Ads: Users voluntarily watch rewarded ads to earn rewards (extra life, revival on death, additional items, extra attributes, etc.).
// Callback functions
const callbacks = {
// Called when ad starts
onstarted: () => console.log('ad started'),
// Called when ad finishes
onfinished: () => console.log('ad finished'),
// Called if ad encounters an error
onerror: (error) => console.log('ad error:', error),
};
// Request to show interstitial ad
window.JOGOS_SDK.ad.requestAd('midgame', callbacks);
// Request to show rewarded ad
window.JOGOS_SDK.ad.requestAd('rewarded', callbacks);
Ad Usage Notes
Interstitial ads have a minimum refresh interval (typically 60 seconds). Frequent calls trigger an error:
500 At least a ${time} second interval is required to display new advertisements
.Rewarded ads have a daily limit (typically 50 per user per day). Excess calls trigger an error:
500 You can only watch up to ${max} rewarded ads per day
.We recommend setting cooldowns or daily limits for rewarded ad points. You can also use the following API to get the remaining rewarded ad count for the current user to decide whether to hide rewarded ads.
const result = await window.JOGOS_SDK.ad.getRewardAdCount();
console.log('Remaining rewardAd count ', result);
Ad Block Detection
Use the following methods to detect if a user has an ad blocker enabled:
const result = await window.JOGOS_SDK.ad.hasAdblock();
console.log('Adblock usage fetched', result);