Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

bidResponse and bidAdjustment called but pbjs.getBidResponses is empty

Open smartbidder1 opened this issue 8 years ago • 3 comments

Type of issue

bidResponse and bidAdjustment called but pbjs.getBidResponses is empty. (it shouldn't be at this point)

Description

I've set up one bidder, and there is a bid response, I've set up a bidResponse event to call a timeout when all the bids are returned, in this case 1 bid only. but after the time out, when I am querying pbjs.getBidResponses or pbjs.getHighestCpmBids(); they are both empty. they should be filled with the bidder response.

Steps to reproduce

  1. create an example HTML with one bidder call pbjs.onEvent('bidResponse', function(a){ currentBidCount++; if (currentBidCount === adUnitNumer){ console.log(pbjs.getBidResponses()); } });

smartbidder1 avatar Dec 14 '17 15:12 smartbidder1

please include a more complete example and include what prebid.js version you are using.

mkendall07 avatar Dec 15 '17 15:12 mkendall07

full html example: (using the newest prebid version 0.34)

<script type='text/javascript'>
var pbjs = pbjs || {}; pbjs.que = pbjs.que || []; 
var adUnits = [{code:"test","sizes":[[300,250]],bids:
	[
		{"bidder":"lifestreet","params":{"jstag_url":"//ads.lfstmedia.com/getad?site=267101","slot":"slot128345","adkey":"faf","ad_size":"300x250"}}
	]
}];

</script>
<script type="text/javascript" src="prebid.js" async></script>
<script>   

	pbjs.que.push(function() {
        pbjs.addAdUnits(adUnits);
		pbjs.onEvent('bidResponse', function(a){
			console.log(pbjs.getBidResponses());
		});
		pbjs.onEvent('bidAdjustment', function(a){
			console.log(pbjs.getBidResponses());
		});		
        pbjs.requestBids({
            bidsBackHandler: sendAdserverRequest
        });
    });

	    function sendAdserverRequest() {
        if (pbjs.adserverRequestSent) return;
        pbjs.adserverRequestSent = true;
				console.log(pbjs.getBidResponses());
    }
</script>
<body>

</body>

while logging pbjs.getBidResponses we should get the bid response that was returned, but the dict is empty.

smartbidder1 avatar Dec 17 '17 09:12 smartbidder1

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 06 '18 21:03 stale[bot]