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

Feature: Inherit standard bidderSettings

Open BartVB opened this issue 10 years ago • 7 comments

It's great that there is a 'bidCpmAdjustment' bidder setting in Prebid.js but this is a bit hard to use because bidderSettings are not inherited.

In my 'standard' settings I assign some price buckets. One of the bidders that I use needs a CPM adjustment, but if I want to do this through 'bidCpmAdjustment' I need to copy/paste the pricebuckets to the relevant bidderSettings section. It would be really nice if I could do something like:

        foobarnetwork: {
            bidCpmAdjustment : function(bidCpm){
                return bidCpm * 0.7;
            },
            inheritStandard: true
        },
       standard: {
         etc

or, maybe even better, if this were the default.

BartVB avatar Dec 24 '15 13:12 BartVB

Indeed @BartVB and thanks for the great feedback! This feature is definitely still in Alpha and your feedback is very helpful. Like you said, inheritStandard is not even needed - it should just be the default.

@mkendall07 do you see any issue with the inheritance? Seems like a really small change.

ghost avatar Jan 04 '16 23:01 ghost

I did this simply, for the "other" bidder..

    // Copy the default bidderSetting to AppNexus
    if(pbjs.bidderSettings["appnexus"] === undefined)
        pbjs.bidderSettings["appnexus"] = pbjs.bidderSettings["standard"];

than simply defined thebidCpmAdjustment function for the new bidder.

Reduxmedia avatar Jan 05 '16 13:01 Reduxmedia

we can add this as a feature. Thanks for the feedback @BartVB

mkendall07 avatar Jan 05 '16 15:01 mkendall07

Thank you for considering this and for Prebid.org!

@Reduxmedia great workaround :)

BartVB avatar Jan 05 '16 15:01 BartVB

@BartVB I have staged the update and will merge after verifying some more tests. You can see the unit test here: https://github.com/prebid/Prebid.js/blob/148_inherit_bid_settings/test/test.js#L177

mkendall07 avatar Jan 06 '16 16:01 mkendall07

Thanks @BartVB and @Reduxmedia!

ghost avatar Jan 07 '16 00:01 ghost

Fixed in https://github.com/prebid/Prebid.js/releases/tag/0.5.0

mkendall07 avatar Jan 11 '16 17:01 mkendall07