Retrieve Display Ads
General
You fill an ad slot by calling the insertAd
command, passing the ad slot name and a destination
container:
<!-- anywhere in the page (preferred in the <head> of the page) -->
<script>
function callback(error, result) {}
somtag.cmd("insertAd", <adSlotName>, { container: "#rectangle_ad_container" }, callback);
</script>
<!-- anywhere in the page -->
<div id="rectangle_ad_container"></div>
Parameter | Description |
---|---|
adSlotName | name of the ad slot (see Overview of Display Ad Slots and Products) |
{ options } | object with only mandantory key container : a selector pointing to the ad container element |
callback(error, result) | optional callback function (see Callback function) |
Special config for InRead / MinRead Config
Please add an additional anchor element to your page, where the ad will be displayed.
The id of that element can only be 71M_inreadads
.
Example:
<script>
somtag.cmd("insertAd", "inread1", {
container: "#ad_inread_container",
});
</script>
<div id="“ad_inread_container”">
<!-- In here the ad will be requested, but not displayed -->
</div>
<p>Lorem ipsum ...</p>
<div id="71M_inreadads"></div>
<!-- In here the ad will be displayed -->
<p>Lorem ipsum ...</p>