Bid returned but no creative
Now I'm using this snippet above my domain that is recognized by Rubicon and I can also receive responses from Rubicon like:
{"div-teste-prebid":{"hb_pb_rubicon":"0.50","hb_adid":"208143cee25268","hb_bidder":"rubicon"}}
But when I try to get my creative at:
<div id="container">pbjs.getAdserverTargeting() Response</div> </br></br> <h5>div-teste-prebid</h5> <div id='div-teste-prebid'> <script type='text/javascript'> googletag.cmd.push(function () { googletag.display('div-teste-prebid'); }); </script> </div>
I cannot receive an AD.
(Full head js above)
<!-- Make sure this is inserted before your GPT tag -->
<script>
var PREBID_TIMEOUT = 10000;
var adUnits = [{
code: 'div-teste-prebid',
sizes: [[728, 90]],
bids: [{
bidder: 'rubicon',
params: {
accountId: '12460',
siteId: '48940',
zoneId: '221354',
sizes: [2],
position: 'atf',
inventory: {
adunit: '9764/HP/Comprar/Buscas/Busca_LeC'.replace('9764/', ''),
marca: '',
modelo: '',
ano_modelo: '',
preco: '',
uf: '',
posicao: '1',
position: 'atf'
}
}
}]
}];
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
pbjs.bidderSettings = {
standard: {
adserverTargeting: [{
key: "hb_bidder",
val: function (bidResponse) {
return bidResponse.bidderCode;
}
}, {
key: "hb_adid",
val: function (bidResponse) {
return bidResponse.adId;
}
}, {
key: "hb_pb_rubicon",
val: function (bidResponse) {
var cpm = bidResponse.cpm;
if (cpm < 0.05) {
return (Math.floor(cpm * 100) / 100).toFixed(2);
} else if (cpm < 0.20) {
return (Math.floor(cpm * 10) / 10).toFixed(2);
} else if (cpm < 2.00) {
return (Math.floor(cpm * 2) / 2).toFixed(2);
} else {
return '20.00';
}
}
}]
}
};
</script>
<!-- Prebid Config Section END -->
<!-- Prebid Boilerplate Section START. No Need to Edit. -->
<script type="text/javascript" src="//acdn.adnxs.com/prebid/not-for-prod/prebid.js" async></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function () {
googletag.pubads().disableInitialLoad();
});
pbjs.que.push(function () {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest
});
});
function sendAdserverRequest() {
if (pbjs.adserverRequestSent) return;
pbjs.adserverRequestSent = true;
googletag.cmd.push(function () {
pbjs.que.push(function () {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
var targetingParams = pbjs.getAdserverTargeting();
var container = document.getElementById('container');
container.innerHTML = JSON.stringify(targetingParams);
});
});
}
setTimeout(function () {
sendAdserverRequest();
}, PREBID_TIMEOUT);
</script>
<!-- Prebid Boilerplate Section END -->
<script>
(function () {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>
<script>
googletag.cmd.push(function () {
googletag.defineSlot('9764/HP/Comprar/Buscas/Busca_LeC', [728, 90], 'div-teste-prebid');
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
<h2>Prebid.js Test</h2>
Thanks for all help.
And this is what we are putting in our creative: `
`
@marvinferreira
change %%PATTERN:hb_adid_rubicon%% to %%PATTERN:hb_adid%%
Closing. Please reopen if it's still not working.