locked
Adding an AD using javascript RRS feed

  • Question

  • I am making an HTML5/JavaScript Win 8 app and trying to add an AD on my HTML page from a js file. I am using the following code:

    adDiv= document.createElement('div');

    adDiv.setAttribute("id", "myAd2");

    adDiv.setAttribute("data-win-control", "MicrosoftNSJS.Advertising.AdControl");

    adDiv.setAttribute("data-win-options", "{applicationId: 'd25517cb-12d4-4699-8bdc-52040c712cab', adUnitId: '10043105'}");

    adDiv.setAttribute("style", "width: 150px; height: 120px; border:solid 2px #000");

    document.getElementById("xyz").appendChild(adDiv);

    where div id="xyz" exists.

    Yet, the AD div appears to be blank. Its just the black border that is visible.

    The AD looks and works fine when directly placed in the HTML file:

    <div id="myAd" style="width: 250px; height: 250px; z-index: 1" data-win-control="MicrosoftNSJS.Advertising.AdControl" data-win-options="{applicationId: 'd25517cb-12d4-4699-8bdc-52040c712cab', adUnitId: '10043105'}"> </div>

    Can't ADs be added from a js file? This seems weird.

    Wednesday, March 20, 2013 1:38 PM

Answers

  • Hello Kedar,

    Answering to your query, please be informed that Bing ads and pubCenter are two different platforms and queries of this nature is handled by a different team of Microsoft and to contact them you need to navigate to advertise.bingads.microsoft.com/.../contact-sales-and-support in order to submit your query so that our sales and support team may able to answer you.

    Thank you!

    Tuesday, March 26, 2013 12:28 PM