Skip to content

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:

javascript
window.JOGOS_SDK.ad;
Ad Requirements

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.).
javascript
// 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.

javascript
const result = await window.JOGOS_SDK.ad.getRewardAdCount();
console.log('Remaining rewardAd count ', result);

Ad Block Detection

Ad Requirements
Our game design allows the game to continue running even if the user has an ad blocker. However, detection mechanisms may produce false positives. To avoid affecting normal users, we recommend mild restrictions: limit premium content (like special skins, extra levels) only for ad-block users, and ensure that users can restore full functionality by simply refreshing the page after disabling the ad blocker.

Use the following methods to detect if a user has an ad blocker enabled:

javascript
const result = await window.JOGOS_SDK.ad.hasAdblock();
console.log('Adblock usage fetched', result);