Skip to content

Commit

Permalink
Merge pull request #130 from prebid/bugfix-rubicon
Browse files Browse the repository at this point in the history
Bugfix for rubicon
  • Loading branch information
mkendall07 committed Dec 8, 2015
2 parents de92940 + 0bfcfa7 commit d7216a0
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/adapters/rubicon.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,22 @@ var RubiconAdapter = function RubiconAdapter() {
iframeId = bidObj.iframeId;
}

bid = bidfactory.createBid(1);
if (response.ads && response.ads[0] && response.ads[0].status === 'ok') {
bid = bidfactory.createBid(1);

if (response.ads && response.ads[0]) {
var rubiconAd = response.ads[0];
var size = sizeMap[rubiconAd.size_id];
var width = 0;
var height = 0;

var iframeObj = window.frames[iframeId];
var rubiconObj = iframeObj.contentWindow.RubiconAdServing;
var rubiconObj;
if(iframeObj.contentWindow){
rubiconObj = iframeObj.contentWindow.RubiconAdServing
}else{
rubiconObj = iframeObj.window.RubiconAdServing;
}

if (rubiconObj && rubiconObj.AdSizes) {
/* should return
1: {
Expand All @@ -142,6 +148,14 @@ var RubiconAdapter = function RubiconAdapter() {
bid.sizeId = rubiconAd.size_id;
bid.width = width;
bid.height = height;

}else{
bid = bidfactory.createBid(2);
bid.bidderCode = 'rubicon';
var bidObj = bidmanager.getPlacementIdByCBIdentifer(getBidId(response));
if (bidObj) {
placementCode = bidObj.placementCode;
}
}

} catch (e) {
Expand Down

0 comments on commit d7216a0

Please sign in to comment.