Over a million developers have joined DZone.

Walkthrough: Monetize Windows 8 with the Microsoft Advertising SDK

· Mobile Zone

An interstitial advertisement is traditionally recognized as a full-page ad appearing between two pages. Interstitial, which means “gap” perceives a gap between to parts of the UI (especially pages on a web site) and fills it with an advertisement.

Wiki: On the World Wide Webinterstitials are web pagesdisplayed before or after an expected content page, often to display advertisements or confirm the user's age (prior to showing age-restricted material). Most interstitial advertisements are delivered by an ad server. Full-screen interstitial ads are referred to as hyperstitials.

I am sure we have all experienced this type of advertising. And, I think I can speak for everyone, we all hate this type of advertising. These ads make apps or sites feel slow; we spend most of the time hunting for “skip this ad”, not reading it. So, what’s this article about then?

Something else we are not talking about

Banner ads also suck. Look at phone apps. They screw up their UI to “make room” for stupid banners? They create miss-tap areas just for banner placement!

And, web sites are worst. They clutter their navigation and gutters with banners that distract users (are you distracted?) from their content! Surely they have failed their original good site design.

But banner ads are the most common modality to advertise in an app. As a result, developers shoehorn them and hope they have minimized user frustration.

To that end, banner ads certainly work. But so does cracking nuts with a steamroller. What if there was a better way? What if you could preserve fidelity and still monetize your app  with advertising?

Here’s my suggestion

The most common control in Windows 8 apps is the GridView control – it presents lists of data in a uniform, scrollable grid. Its cousin, the ListView, is the the most common such control in the SnapViewstate. The screen below is a great sample of a Windows 8 app; we in evangelism have worked hard to make sure this consistent approach is a go-to UI for Windows 8 developers.

ListView and GridView

Since we know that banner ads work. And since we know that banner ads suck (mostly be cause they screw up the layout of the app. Let’s consider a “data interstitial” ad. Let us project a gap into our data and place the advertisement in that location. We can preserve our UI. And we can work hard to localize and categorize our advertisements so that they are most relevant to users.


In the image above, the blue box represents an advertisement. I have intentionally made the templates on my page correlate to the banner sizes available to me. For Windows 8, the most common template dimensions are 250x250 and, conveniently, Microsoft advertising supplies an ad the same size.

How many to show?

This is going

Is this interstitial?

The most common form of interstitial is the in-between-page ad. However, the concept of interstitial is an advertisement that fills the “gap”. I believe the most effective type of interstitial is the ad that fills the gap in your data. If you ask “what gap in my data?” I simply mean the gap in your data that you create – literally making space for your ad to flow in with your data. I preserves your UI and is easily the most non-invasive introduction of advertising in an app.

What are your options?

There are a few sized you can choose from. Go to http://pubcenter.microsoft.com and create your advertising account (it’s free). When you setup your ad unit, you choose from a list of sizes. Based on your app’s data, choose the one that fits most unobtrusively into your regular workflow. Some developers like to call this type of advertisement “inline” and that’s fine, too.

Here are your options today:

image image
image image
image image

Here are test values for developers

For all testing:

  1. Use the ApplicationId d25517cb-12d4-4699-8bdc-52040c712cab
  2. Use an AdUnitId from the Test Mode Values Table below
  3. Learn more: http://msdn.microsoft.com/en-us/library/hh506361(v=msads.10).aspx
Ad Unit Size 
(Width x Height)
Experience AdUnitId

160 x 600

Windows 8 Image Ad with click to Full Screen Image


160 x 600

Windows 8 Video Ad with click to Full Screen Video


160 x 600

Windows 8 Image Ad


250 x 125

Windows 8 Image + Text Ad


250 x 250

Windows 8 Text Ad


250 x 250

Windows 8 Image Ad with click to Full Screen Image


250 x 250

Windows 8 Image Ad with Hotspots


250 x 250

Windows 8 Image + Text Ad


292 x 60

Windows 8 Image + Text Ad


300 x 250

Windows 8 Image Ad with click to Full Screen Image


300 x 250

Windows 8 Video Ad with click to Full Screen Video


300 x 250

Windows 8 Image + Text Ad


300 x 250

Windows 8 Image Ad with Hotspots


500 x 130

Windows 8 Image + Text Ad


728 x 90

Windows 8 Image Ad with click to Full Screen Image


728 x 90

Windows 8 Video Ad with click to Full Screen Video


728 x 90

Windows 8 Image Ad


Keeping it relevant

Remember, the reason you are putting ads into your app is to make money. Not because we like ads. But how do you make ads not distracting? How do make ads useful to the user? There are a few things you can do. First, do a good job selecting the category of ads for your app.


The screen above (on http://pubcenter.microsoft.com) is where you configure your ads content. It’s true that you cannot control the ad itself, but you can influence its categories. This means the resulting ads can present more value to the user of your application. As a result, you might see more clicks. And with more clicks, you see more revenue.


The other thing you can do is add location information to your ads. If you are using the Location API (or if you just add the location API to your app) then the latitude and longitude of the user is available to you. This is something you can “feed” to the ad control on your page. Why? Well, you have already configured the ad to show relevant ads by category. Lat/Long lets you help narrow the ad relevancy to location, too. And relevancy directly ties to revenue, if you ask me.

Here’s a video to show you how!

Get the Microsoft Advertising SDK here: http://aka.ms/w8ads

Go to the Microsoft Advertising Support Forums: here

Remember this!

  1. The z-order of the AdControl is always the top level, which means an expanded ad can conflict with other WebView controls. An article discussing the issue can be found here.
  2. The Resume and Suspend APIs are provided to ease the implementation of working around the flickering and z-order issues.
  3. If hosting an ad on a page with user input controls, beware that focus is moved to theAdControl on an ad because XAML automatically gives focus to the newly added WebViewcontrol. The workaround is to manually refresh and do not call Refresh while the user is engagedwith your app.
  4. Setting border related properties inherited by the AdControl from its parent class will cause the ad placement to be wrong. The Windows 8 interface discourages the use of borders. Consistent layout and the use of margins are the Windows 8 style. For more information seeDeveloping Windows 8 style apps.
  5. ApplicationId must be the same for all ad placements in an app, and cannot be changed during runtime. AdUnitId cannot be changed for a given AdControl during runtime. If you do assign a new value, the property value will change without throwing an exception. However, on the next ad refresh the errorOccurred event will fire.
  6. Apps may show some flickering during refresh as the old ad unloads and the new one loads.
  7. More…

The Store’s advertising guidelines

2. Windows Store apps can display ads but are more than just ads or websites

2.1 Your app must not display only ads
If your app includes or displays ads, it must provide additional functionality beyond the ads.

2.2 Ads in your apps must comply with our content policies
Our content policies are described in Section 5. Windows Store apps are appropriate for a global audience.

Content means the images, sounds, and text contained in the app, the tiles, notifications, error messages or ads exposed through your app, and anything that’s delivered from a server or that the app connects to. Because Windows and the apps in the Windows Store are used around the world, these requirements will be interpreted and applied in the context of regional and cultural norms.

2.3 Your app must not use its tiles, notifications, app bar, or the swipe-from-edge interactions to display ads
The elements of your app's description, such as screenshots, text, and promotional images must describe your app and not contain additional advertising.

2.4 The primary experiences your app provides must take place within the app

2.5 Ads must not execute program code that didn't come from the ad provider

4.2 Your app must respect system settings for notifications and remain functional when they are disabled

This includes the presentation of ads and notifications to the customer, which must also be consistent with the customer’s preferences, whether the notifications are provided by the Windows Push Notification Service or any other service. If a customer disables the notification function, either on an app-specific or a system-wide basis, your app must remain functional.

There is this z-index thing; let me help you w/that

Critical last point! The Advertising EULA

The Advertising EULA contains important information including text that must appear within your own privacy policy and/or terms of use statement when your app uses advertising. Make sure your app complies with all sections of the EULA, including those related to Redistribution Requirements and Data Collection and Use. (more)

The software contains code that you are permitted to distribute in programs you develop if you comply with the terms below. For any Distributable Code you distribute, you must require distributors and external end users to agree to terms that protect it at least as much as this agreement; display your valid copyright notice on your programs; and indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your programs.

If you pass precise location data or other user related data (e.g., user identifier, profile data, behaviorally tracked user data, etc…) to the Microsoft Advertising SDK for Windows 8 Apps, then your program must (a) notify end users that it will be collecting and using user related information and providing this information to Microsoft for Microsoft’s advertising use and (b) explicitly obtain affirmative user consent

Here’s the EULA

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\MSAdvertisingJS\6.1
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\MSAdvertisingXaml\6.1

Best of luck!


Published at DZone with permission of Jerry Nixon, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}