windows-guidelines | Banner Ads

Banner Ads are graphical ads, typically including a combination of static/animated images and text designed to convey a marketing message and/or cause the user to take action. All types of apps can leverage Banner ads for monetization!


Follow these steps to start monetizing with Banner ads:

  1. Setting up a Banner Ad in the UI
  2. Creating a Banner Ad
  3. Testing the Integration

Step 1. Setting up a Banner Ad in the UI

  1. Go to the Inventory tab in the navigation bar and press + next to the app you want to add your Banner ad placement to.
  2. Select Add Placement in the aerBanner placement section.

    Note: The UI enables you to add multiple placements in step 2 before continuing to step 3.

  3. Fill in the details in the following fields. Some of them are optional. Read the descriptions to understand the functionality of each field:
    • Name - A unique name that will help identify this placement.
    • Size - Defines the ad slot size for the placement.
    • Frequency Cap - Limits the amount of times an ad can be delivered to a specific user in a given duration.
    • Refresh Interval - Defines the amount of time a placement will wait before calling for another ad.
    • COPPA Compliance - A flag to determine if the section of the app where this placement resides, needs to be COPPA compliant. Checking this box indicates that the placement needs COPPA compliance.
    • Ad Mode - This toggle will enable display of test ads on your placement.

      WARNING: If enabled, the placement will only show test ads. These test ads do not have revenue associated with them and should be used strictly for testing purposes.

    • It’s an Audience Bidder Placement - This field should remain unchecked and is not relevant to the Windows SDK.

Step 2. Creating a Banner Ad

The IMBanner is simply a subclass of FrameworkElement for displaying HTML ads.

The InMobi Windows SDK provides a programmatic instantiation of the Banner ad.

Let us take a look at the steps required to create and show a Banner ad.

  1. Import the header and create a Banner:

    Import the InMobi.Ads header, and declare an instance of IMBanner.

    Sample Code:

    using InMobi.Ads;
    // <additional headers here>
    namespace <namespace_here> {
        public sealed partial class AdRequestTesting: Page {
            private IMBanner banner;
            // rest of your code below
        }
    }
    		
  2. Instantiate the Banner object:

    The Banner object can be instantiated with following method provided in the IMBanner class:

    public IMBanner(string placementId, IMAdSize size)
    		

    Param Definitions:

    1. placementId: A placement ID is a unique ID that defines a specific place in your application where an ad will be served.
    2. size: It refers to the desired ad slot for the Banner. For more information on sizes, you can refer to the IMAdSize class.

      The following column lists the supported Banner sizes:

      Banner Slot
      Banner300x50
      Banner320x50
      Banner320x100
      Banner640x100
      Leaderboard728x90
      Leaderboard924x50
      Leaderboard924x250
      MedRect300x250
      Skyscraper160x600
      Skyscraper300x600
      Portrait320x480
      Portrait320x568
      Landscape480x320
      Fullscreen1024x728

    Initialize the Banner object in the following format:

    banner = new IMBanner(<placement_id>, <banner_size>);
    		

    Recommended: You may register the Banner to the following events:

    banner.OnAdLoadSucceeded += Banner_OnAdLoaded;
    banner.OnAdLoadFailed += Banner_OnAdFailed;
    banner.OnAdDisplayed += Banner_OnAdDisplayed;
    banner.OnAdDismissed += Banner_OnAdDismissed;
    banner.OnAdInteraction += Banner_OnAdInteraction;
    banner.OnAdWillLeaveApplication += Banner_OnAdWillLeaveApplication;
    		

    These events are triggered in following situations:

    a. OnAdLoadSucceeded: When the Banner ad is fully loaded.

    b. OnAdLoadFailed: When the Banner ad has failed to load due to some error.

    c. OnAdDisplayed: When the Banner ad model view has been presented.

    d. OnAdDismissed: When the Banner ad view has been dismissed.

    e. OnAdInteraction: When the user interacts with the Banner ad. (i.e. click)

    f. OnAdWillLeaveApplication: When the app is about to leave the application after the Banner ad is clicked.

  3. Displaying the Banner ad:

    The Banner ad may be displayed using the following method call:

    banner.LoadAd()
    		
  4. Configuring the Banner Refresh Interval:

    The refresh interval of the Banner object can be controlled using the following property on IMBanner instance.

    public int RefreshInterval
    		

Step 3. Testing the Integration

The Banner placement can be set to Test mode in order to test your integration.

Note: The default setting for a placement is Live.

When any placement is in Test mode, the placement will only show test ads.

These test ads do not have revenue associated with them and should be used strictly for testing purposes!

To switch a placement’s Ad Mode:

  • Go to the placement edit page
  • Find the “Ad Mode” toggle and switch to Test
  • Select “Confirm” from the reminder dialogue box.
  • Press “Save” on the placement edit page.
  • Once testing is complete, remember to switch the placement’s “Ad Mode” back to Live to start monetizing the placement.