Skip to content

Instantly share code, notes, and snippets.

@nickjacob
Created December 21, 2016 15:39
Show Gist options
  • Save nickjacob/4e14f5f7b551704d8343c931ffee0408 to your computer and use it in GitHub Desktop.
Save nickjacob/4e14f5f7b551704d8343c931ffee0408 to your computer and use it in GitHub Desktop.
gearheads prebid price granularity code
// around line 341 on homepage template
var bidderSettings = {
brealtime: {
bidCpmAdjustment : function(bidCpm){
// adjust the bid in real time before the auction takes place
return bidCpm * .80;
}
},
rubicon: {
bidCpmAdjustment : function(bidCpm){
return bidCpm * .85;
}
},
standard: {
adserverTargeting: [
{
key: "hb_bidder",
val: function(bidResponse) {
return bidResponse.bidderCode;
}
}, {
key: "hb_adid",
val: function(bidResponse) {
return bidResponse.adId;
}
}, {
key: "hb_pb",
val: function(bidResponse) {
// NOTE: this is the only line that changes
if (bidResponse.cpm < 20.00) {
return bidResponse.pbHg; // 1-cent increments
}
return '20.00'; // anything > 20 becomes $20
}
}
]
},
key: "hb_pb"
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment