Monetizing your app: Use interstitial banner as fallback for interstitial video

Monetizing your app: Use interstitial banner as fallback for interstitial video

Do you show ads while loading your app or between levels of your game (also known as interstitial ads)?

Microsoft Advertising now offers interstitial banners as an option for ads in your app. Interstitial ads have a higher monetization value, but have a lower fill rate in many markets. You can choose to use an interstitial banner when a video ad is not available.

Another option is to request both a video ad and an interstitial banner ad and show whichever ad is ready at the time of loading the app.

The code below is an example of how you can show either a video ad or a banner ad – whichever is ready first for you to load your app.

Add this to the cs file of the page that you want to load the interstitial ad:


//Add the Ads reference:
		using Microsoft.Advertising.WinRT.UI;
	//Initialize the ads:
		InterstitialAd MyVideoAd;
		InterstitialAd MyBannerAd;
	//Intiialize the Adunits:
		var MyAppID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx";
             // video adunit
            var MyVideoAdUnitId = "xxxxxxxx";
            // Interstitial banner adunit
            var MyAdUnitId = "xxxxxxxxx";
            //Request the ads:
            // instantiate an InterstitialAd
            MyVideoAd = new InterstitialAd();
            MyBannerAd = new InterstitialAd();
           // wire up all 4 events, see below for function template
            MyVideoAd.AdReady += MyVideoAd_AdReady;
            MyVideoAd.ErrorOccurred += MyVideoAd_ErrorOccurred;
            MyVideoAd.Completed += MyVideoAd_Completed;
            MyVideoAd.Cancelled += MyVideoAd_Cancelled;
            MyBannerAd.AdReady += MyBannerAd_AdReady;
            // pre-fetch an ad 30-60 seconds before you need it
            MyVideoAd.RequestAd(AdType.Video, MyAppID, MyVideoAdUnitId);
            MyBannerAd.RequestAd(AdType.Display, MyAppID, MyAdUnitId);

	//write the code for the events
void MyVideoAd_AdReady(object sender, object e)
        {
            // code
            if (!bannerready)
            {
                MyVideoAd.Show();
                videoready = true;
            }
        }
        void MyBannerAd_AdReady(object sender, object e)
        {
            // code
            if (!videoready)
            {
                MyBannerAd.Show();
                bannerready = true;
            }
        }
        void MyVideoAd_ErrorOccurred(object sender, AdErrorEventArgs e)
        {
            var A = MyVideoAd.State;
        }



        void MyVideoAd_Completed(object sender, object e)
        {
            var A = MyVideoAd.State;
        }
        void MyVideoAd_Cancelled(object sender, object e)
        {
            var A = MyVideoAd.State;
        }

Stay tuned over the next few weeks for additional tips to increase ad monetization.

Source: Monetizing your app: Use interstitial banner as fallback for interstitial video

About KENNETH 19694 Articles
지락문화예술공작단

Be the first to comment

Leave a Reply

Your email address will not be published.


*


이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.