Ad Feed Spec
The ad feed uses custom elements to describe ad campaigns as item elements in an RSS feed. An ad feed contains one or more ad campaigns, and each campaign contains one or more ads. For the purposes of this spec, an ad campaign can be thought of as a single advertising message. The individual ads within a campaign share the same message. The difference between ads belonging to the same campaign is the range of sizes they cover.
Like the Syndicated Client Experiences (SCE) data feed, the SCE ad feed is based on RSS 2.0. The extensions to RSS are given in the following two namespaces:
http://schemas.microsoft.com/rss/2007/readerextensions
http://schemas.microsoft.com/rss/2007/contentsyncextensions
Throughout this spec, these namespaces will be prefixed with “rx” and “csx” respectively.
The purpose of the ad feed is two-fold:
- Allow the starter kit based app to sync and store ads offline
- Allow the application to select an appropriate ad based on the available ad inventory.
Top Level Elements
The ad feed is composed of a single RSS channel. The most significant element on the channel level is the lastBuildDate. When processing the ad feed, if the lastBuildDate on disk is the same as the lastBuildDate on the network version of the ad feed, processing stops. Thus, if changes are made to the ad campaign, the lastBuildDate must be updated. In addition, this value must match the <csx:lastBuildDate> of the item in the master feed that references the ad feed.
<rss version="2.0"
xmlns:rx="http://schemas.microsoft.com/rss/2007/readerextensions"
xmlns:csx="http://schemas.microsoft.com/rss/2007/contentsyncextensions">
<channel>
<title>Sample Ad Feed</title>
<link>http://boguslink.com</link>
<description>Sample Ad Feed</description>
<pubDate>Tue, 09 Oct 2007 10:41:44 GMT</pubDate>
<!--important element-->
<lastBuildDate>Tue, 09 Oct 2007 10:41:44 GMT</lastBuildDate>
<!--a collection of items follows, each item represents
a distinct ad campaign-->
<item>
Describing Ad Campaigns
A simple ad campaign <item> containing 2 ads is given below:
<item>
<title>IAB Fixed Aspect Ratio</title>
<pubDate>9/14/2007</pubDate>
<csx:lastBuildDate>9/14/2007 1:18:46 PM</csx:lastBuildDate>
<guid>IABfixedAspectRatio</guid>
<rx:clickThroughLink>http://www.microsoft.com</rx:clickThroughLink>
<rx:ads>
<rx:ad type="Html">
<rx:sizeRange minWidth="300" maxWidth="375" fixedAspectRatio="True" />
<rx:originalSize width="336" height="280" />
<csx:link>sample/IABLargeRectangle.xaml</csx:link>
</rx:ad>
<rx:ad type="Html">
<rx:sizeRange minWidth="255" maxWidth="300" fixedAspectRatio="True" />
<rx:originalSize width="300" height="600" />
<csx:link>sample/IABHalfPage.xaml</csx:link>
</rx:ad>
</rx:ads>
</item>
Required elements for ad feed <item>’s representing ad campaigns
<rx:ads> -- Must contain one or more <rx:ad>. These <rx:ad> elements make up a campaign. More detail on the content of <rx:ad> is given below.
Optional elements for ad feed <item>’s representing ad campaigns
<csx:lastBuildDate> -- (HIGHLY RECOMMENDED) used to determine if the ads and associated resources need to be resynchronized. If not present, the application assumes the <csx:lastBuildDate> is the same as the RSS <pubDate>. If neither <pubDate> nor <csx:lastBuildDate> are specified, the <csx:lastBuildDate> is assumed to be Jan 1st, 1601. Note that this element is different from the RSS <lastBuildDate> element (the RSS version is only defined as a child of <channel>).
<rx:clickThroughLink> -- The link which is navigated to when a user clicks on an ad in this campaign.
Describing Ads
Each ad campaign is composed of one or more ads. These ads are children of the <rx:ads>> element.
Ad Sizes
Since the size of ad rectangles which appear in the app isn’t known a priori, each ad must contain an <rx:sizeRange> which describes the minimum and maximum acceptable sizes of the ad. This element also describes whether or not the ad has a fixed aspect ratio. If the ad does have a fixed aspect ratio, the ad must also contain an <rx:originalSize> element (otherwise, the <originalSize> is an optional element). The original size corresponds to the native resolution of the ad.
When a fixed aspect ratio ad is placed, its width is dictated by the content it is appearing in. The height is subsequently derived from the width of the ad as viewed on the screen and aspect ratio of the ad. The aspect ratio of the ad is calculated from the original height and width of the ad. Thus, if an ad has a fixed aspect ratio, <rx:sizeRange> must have a minWidth and maxWidth attribute. minHeight and maxHeight are calculated automatically using the aspect ratio.
Generally speaking, ads with a greater size range and a non fixed aspect ratio are going to look more attractive throughout the application since the application will have greater flexibility in terms of placing these ads.
Typically, an ad campaign will contain ads of differing sizes. When the application serves an ad, it first selects an ad campaign. It then selects an ad of an appropriate size. For this reason, the <rx:sizeRange> element of different ads within a campaign should not contain overlapping size ranges.
Specifying Ad Types
The <rx:ad> element has a required “type” attribute which specifies the ad type. There are 3 supported types: HTML, WPF, and Image.
HTML ads
This is essentially anything that can be displayed in a web browser (including loose XAML). Care must be taken however, to make the HTML re-scalable. Several examples are given in the sample feed.
Image ads
These can be of any supported media type, such as png, jpg, and bmp. In general, care should be taken not to over optimize these images. Otherwise, these ads will look pixilated when scaled.
Compiled WPF ads
For creating the highest quality ads, use compiled WPF DLL’s. An example ad project is included with the starter kit. This project illustrates how to use WPF’s templating features. Thus, a single ad can scale beautifully to a large range of sizes and aspect ratios. Some vendors offer services which can automatically generate these ads based on existing assets (for example, see www.livetechnology.com).
Downloading and caching ads
The online location of an ad is given by the <csx:link> element. When the application parses the ad feed, it can cache to disk any ads given in the ad feed. By caching the ads, the application provides a lower latency user experience as well as the ability to serve ads when the user is offline.
Ad resources
In addition, an ad can specify additional resources which will be downloaded and saved. These are given as <csx:link>’s inside a <rx:resources> element as follows:
<rx:ad type="Html">
<rx:sizeRange minWidth="150" maxWidth="600" fixedAspectRatio="True"/>
<rx:originalSize width="300" height="250" />
<csx:link>msft/msft.300x250.htm</csx:link>
<rx:resources>
<csx:link>msft/msft.300x250.swf</csx:link>
</rx:resources>
</rx:ad>
Debugging your ad feed
The SCE Starter Kit comes with an AdViewer project that will give you a graphical representation of your ad feed. In addition, the included sample app will log important debug information into the application’s error log.