Skip to main content

Ad Format Integration

Here's how to integrate the supported ad formats on Godot. Each ad format has its own unique characteristics and implementation details.

Banner ads are rectangular advertisements that appear at the top or bottom of the device screen.

Implementation

  1. Load and show the banner ad:
yodo1_node.loadBannerAd("Banner", "Center", "Bottom", "Any placementID")

Parameters:

  • Adsize: Banner, SmartBanner, AdaptiveBanner, IABMediumRectangle, Large Banner
  • HorizontalAlignment: Left, Center, Right
  • VerticalAlignment: Top, Bottom
  • AdPlacement: Any string used to track different ad units in MAS Dashboard
  1. Hide/Show banner:
yodo1mas.hideBannerAd();
yodo1mas.showBannerAd();
  1. Event callbacks:
func _onBannerAdLoaded() -> void:
print("Yodo1 onBannerAdLoaded")

func _onBannerAdFailedToLoad(error_code:int) -> void:
print("Yodo1 onBannerAdFailedToLoad", error_code)

func _onBannerAdOpened() -> void:
print("Yodo1 onBannerAdOpened")

func _onBannerAdFailedToOpen(error_code:int) -> void:
print("Yodo1 onBannerAdFailedToOpen", error_code)

func _onBannerAdClosed() -> void:
print("Yodo1 onBannerAdClosed")

Best Practices

  1. Preload Ads: Always preload ads before showing them to ensure they're ready when needed.
  2. Handle Callbacks: Implement all callbacks to properly track ad states and handle errors.
  3. Error Handling: Always check if the ad is loaded before attempting to show it.
  4. User Experience: Place ads at natural transition points in your game.
  5. Testing: Use test ads during development and verify all callbacks are working correctly.