<h5>postbid iframe</h5>
<iframe id='postbid_iframe'
FRAMEBORDER="0"
SCROLLING="no"
MARGINHEIGHT="0"
MARGINWIDTH="0"
TOPMARGIN="0"
LEFTMARGIN="0"
ALLOWTRANSPARENCY="true"
WIDTH="0"
HEIGHT="0">
</iframe>
var sizes = [
[300, 250]
];
var PREBID_TIMEOUT = 1000;
var adUnits = [{
code: 'postbid_iframe',
mediaTypes: {
banner: {
sizes: sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: 13144370
}
}]
}];
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
timeout: PREBID_TIMEOUT,
bidsBackHandler: function() {
var iframe = document.getElementById('postbid_iframe');
var iframeDoc = iframe.contentWindow.document;
var adServerTargeting = pbjs.getAdserverTargetingForAdUnitCode('postbid_iframe');
// If any bidders return any creatives
if (adServerTargeting && adServerTargeting['hb_adid']) {
pbjs.renderAd(iframeDoc, adServerTargeting['hb_adid']);
} else {
iframe.width = sizes[0][0];
iframe.height = sizes[0][1];
iframeDoc.write('' + passbackTagHtml + '');
iframeDoc.close();
}
}
});
});
// Define the passback HTML tag here.
// Note that this tag is usually in either Script tag form or iFrame form.
var passbackTagHtml = 'TO ADD';
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Postbid Example</title>
<!-- required scripts -->
<script async src="//cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js"></script>
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
</head>
<body>
<!-- javascript -->
<script>var sizes = [
[300, 250]
];
var PREBID_TIMEOUT = 1000;
var adUnits = [{
code: 'postbid_iframe',
mediaTypes: {
banner: {
sizes: sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: 13144370
}
}]
}];
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
timeout: PREBID_TIMEOUT,
bidsBackHandler: function() {
var iframe = document.getElementById('postbid_iframe');
var iframeDoc = iframe.contentWindow.document;
var adServerTargeting = pbjs.getAdserverTargetingForAdUnitCode('postbid_iframe');
// If any bidders return any creatives
if (adServerTargeting && adServerTargeting['hb_adid']) {
pbjs.renderAd(iframeDoc, adServerTargeting['hb_adid']);
} else {
iframe.width = sizes[0][0];
iframe.height = sizes[0][1];
iframeDoc.write('' + passbackTagHtml + '');
iframeDoc.close();
}
}
});
});
// Define the passback HTML tag here.
// Note that this tag is usually in either Script tag form or iFrame form.
var passbackTagHtml = 'TO ADD';
</script>
<!-- html -->
<h5>postbid iframe</h5>
<iframe id='postbid_iframe'
FRAMEBORDER="0"
SCROLLING="no"
MARGINHEIGHT="0"
MARGINWIDTH="0"
TOPMARGIN="0"
LEFTMARGIN="0"
ALLOWTRANSPARENCY="true"
WIDTH="0"
HEIGHT="0">
</iframe>
</body>
</html>