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

Check all bids snippet needs investigation/update

Open mkendall07 opened this issue 8 years ago • 9 comments

The rendered ad snippet isn't working for all cases.

I ran this on a site with 2 rendered bids and it told me 1 wasn't rendered.

image

(function() {
  var responses = ga_pbjs.getBidResponses();
  var winners = ga_pbjs.getAllWinningBids();
  var output = [];
  Object.keys(responses).forEach(function(adUnitCode) {
    var response = responses[adUnitCode];
    response.bids.forEach(function(bid) {
      console.log(bid);
      output.push({
        adunit: adUnitCode,
        size: bid.size,
        adId: bid.adId,
        bidder: bid.bidder,
        time: bid.timeToRespond,
        cpm: bid.cpm,
        msg: bid.statusMessage,
        rendered: !!winners.find(function(winner) {
          return winner.adId==bid.adId;
        })
      });
    });
  });
  if (output.length) {
    if (console.table) {
      console.table(output);
    } else {
      for (var j = 0; j < output.length; j++) {
        console.log(output[j]);
      }
    }
  } else {
    console.warn('NO prebid responses');
  }
})();```

mkendall07 avatar Feb 23 '18 21:02 mkendall07

Just checking to see if there has been any progress here.

chefbenjamin avatar Mar 01 '18 21:03 chefbenjamin

@chefbenjamin I think this might actually be related to your implementation. I'll send an email

mkendall07 avatar Mar 01 '18 21:03 mkendall07

sorry scratch that. It looks like the issue is that pbjs.getAllWinningBids(); is not returning all winning bids after all.

mkendall07 avatar Mar 01 '18 22:03 mkendall07

@mkendall07 ok cool. let me know if you want me to test something.

chefbenjamin avatar Mar 02 '18 22:03 chefbenjamin

I tried looking into this but it's working fine with my test pages. Is there a test page I could look at that is known to have the issue?

snapwich avatar Mar 06 '18 22:03 snapwich

@snapwich happy to share with you, but prefer to send privately. Best email address ?

chefbenjamin avatar Mar 06 '18 22:03 chefbenjamin

Sure

snapwich avatar Mar 06 '18 23:03 snapwich

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 21 '18 21:03 stale[bot]

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 Apr 04 '18 22:04 stale[bot]