Published: April 30, 2014
From the Solution Explorer window, double click the “package.appxmanifest” file.
Click the Capabilities tab and ensure that Internet Client is checked, as shown below. Without this capability, the ad client cannot make calls to the internet to fetch ads.
From the Solution Explorer window, right click References, and select Add Reference…
Click Windows, and then Extensions. Select Microsoft Advertising SDK for Windows 8.1 (JS). Then click OK.
Confirm that your reference was added. Your Solution Explorer should look similar to the following:
Open the default.html file (or other html file as appropriate for your project).
<!-- Microsoft Advertising required references --> <script src="/MSAdvertisingJS/ads/ad.js" ></script>
This line must be placed in the <head> section after the include of default.js; otherwise, you will encounter an error when you build your project.
Modify the <body> section in the default.html file (or other html file as appropriate for your project) to include the following:
Compile and run the app to see it with an ad, similar to the following:
Complete default.html for a Sample Project
You can drag the ad.js file from the Project Explorer window to the <head> section of the default.html file and the code for the AdControl will insert automatically.
Follow the walkthrough above through step 6. For Step 7, drag the ad.js file from the Project Explorer window to the <head> section of the default.html file. Continue on from Step 8.
Follow the walkthrough above through step 5. Then in VS right-click the project (not the solution) in Project Explorer and from the context menu look down at the bottom entries and click Open in Blend. From Blend, in the Assets tab, under Advertising you can drag and drop the AdControl onto the design space.
Support and Feedback
Get product support or report a bug in the advertising SDK by visiting the Windows Store Apps developer support page support page. For product support, under "App development" click the "Advertising SDK" link. To post a question in the support forum, scroll down to "Find answers online" and click "Ads-in-Apps for Windows 8 forum".
Send feedback about this documentation to firstname.lastname@example.org. There is no product support through this alias. Documentation feedback only.