Search code examples
htmlwindows-store-appswindows-store

Windows 8 AdControl using HTML5


I have a Windows 8 AdControl set-up in this way:

<div id="adControl" style="width: 728px; height: 90px; border: solid 1px red; visibility:visible;"
    data-win-control="MicrosoftNSJS.Advertising.AdControl"
    data-win-options="{applicationId: 'abc-1234', adUnitId: '12345'}">
</div>

I know the control is displaying because I can see a red line around it. However, I'm not seeing any ads being rendered (the ad is registered). I have the same control in a Metro app using XAML and I see the ads fine.

Is there an extra trick to ads using HTML5 that I've missing?

EDIT:

The SDK is included in the project.


Solution

  • Okay - in the end I sussed this completely by accident. An obvious mistake, but very difficult to spot with Javascript's "No errors" policy! The problem was that I hadn't included the script:

    <script src="/MSAdvertisingJS/ads/ad.js"></script>
    

    I'd added the reference and it didn't occur to me that it needed this as well.