SDK Documentation
HomeBlogSign up
English
English
  • 🏠Homepage
  • 🧪Test Ad Units
  • Privacy
    • ✅Google Data Safety
  • Android SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Native (Google)
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
    • 🛠️ProGuard
  • iOS SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Native (Google)
      • Revenue reporting
    • 🙍User consent
    • 🔓Privacy
  • Unity SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
  • Flutter SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Native (Google)
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
  • React Native
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
  • Web SDK
    • ⌨️SDK integration
Con tecnología de GitBook
En esta página
  • Integration
  • Adaptive banners
  • Anchored
  • Inline
  • Listener setup
  • Example
  1. Unity SDK
  2. SDK integration

Banner

Banner ads are rectangular image or text ads that occupy a space inside the application layout. They stay on screen while the users interact with the app and can automatically refresh after a certain period of time. If you are new in mobile advertising, they are an excellent choice to start.

Integration

Para realizar la integración de un banner, es necesario implementar un código similar al del ejemplo que se muestra a continuación:

// Create a banner
WortiseBanner bannerAd = new WortiseBanner(
    "Wortise Ad Unit ID",
    WortiseAdSize.Height50,
    WortiseAdPosition.Top
);

// Optional: Set the auto-refresh time in milliseconds
bannerAd.AutoRefreshTime = 60000;

// Request an ad
banner.LoadAd();

Adaptive banners

Adaptive banners are a new banner format where the size of the ads is adapted according to the device and the app user-interface, in order to maximize performance.

Currently there is support for two kind of adaptive banners:

Anchored

This kind of banner is designed to replace the traditional 320x50 banners and be positioned at the top or bottom of the screen.

To make use of this format, an WortiseAdSize generated in the following way must be passed to the WortiseBannerAd instance:

// It is needed to specify the banner width
WortiseAdSize.GetAnchoredAdaptiveBannerAdSize(width);

Inline

This other kind of banner, in comparison to the anchored, is designed to have a variable height and be positioned inside a scrolling content.

In this case, an WortiseAdSize must be generated this way:

// It is needed to specify the banner width. The maximum height is an
// optional parameter (by passing 0 or a negative value)
WortiseAdSize.GetInlineAdaptiveBannerAdSize(width, maxHeight);

Listener setup

Some listeners can be added to receive the different events that may occur during the interstitial lifecycle. For this, you can make use of the following attributes that are available at the WortiseBanner class:

  • OnClicked

  • OnFailedToLoad

  • OnImpression

  • OnLoaded

  • OnRevenuePaid

Example

bannerAd.OnClicked      += () => Debug.Log('Banner clicked');
bannerAd.OnFailedToLoad += () => Debug.Log('Banner failed to load');
bannerAd.OnImpression   += () => Debug.Log('Banner impression');
bannerAd.OnLoaded       += () => Debug.Log('Banner loaded');
bannerAd.OnRevenuePaid  += (data) => Debug.Log('Banner revenue paid');
AnteriorApp OpenSiguienteInterstitial

Última actualización hace 3 días

⌨️