this should be easy, adding another object in the units array. But when I do, I get an error, as the API can not find the container with the given ID. Screenshot of the Firebug console.
I have 3 units and the unit IDs are properly given and associated with containers. window.Mopub gets initialized and populated, it's and array of three objects, here's a screenshot of DOM - window.Mopub :
Integration code:
<script type="text/javascript">
window.mopub = [{
ad_unit: "2acca42ca4e746689c1d41cd1d5587e7",
ad_container_id: "mopub_top", // Specify the div or container to which you’d like to the mobile web tag
ad_width: 320,
ad_height: 50,
keywords: "", // Optionally pass keywords as a comma separated list
}, {
ad_unit: "c3eb9222c0fb459997b2ab3bfb4bde0d",
ad_container_id: "mopub_mid", // Specify the div or container to which you’d like to the mobile web tag
ad_width: 320,
ad_height: 50,
keywords: "", // Optionally pass keywords as a comma separated list
}, {
ad_unit: "a2a35dc504334ccd8e244076a4ee7518",
ad_container_id: "mopub_floater", // Specify the div or container to which you’d like to the mobile web tag
ad_width: 1,
ad_height: 1,
keywords: "", // Optionally pass keywords as a comma separated list
}]; // To load additional ad units, add another object into the array.
(function() {
var mopubjs = document.createElement("script");
mopubjs.async = true;
mopubjs.type = "text/javascript";
mopubjs.src = "//d1zg4cyg8u4pko.cloudfront.net/mweb/mobileweb.min.js";
var node = document.getElementsByTagName("script")[0];
node.parentNode.insertBefore(mopubjs, node);
})();
</script>
The application is a classic mobile HTML5 website.
Am I missing something here?