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

bidCpmAdjustment for alias bidder?

Open headerbidding opened this issue 10 years ago • 1 comments

How do I do a bidCpmAdjustment for an alias bidder?

I tried this, but it results in a syntax error:

pbjs.que.push(function() {
    pbjs.addAdUnits(adUnits);
    pbjs.aliasBidder('appnexus', '152media');
    
    pbjs.bidderSettings = {152media: {
    bidCpmAdjustment : function(bidCpm){
      return bidCpm * .95;}
      }
    }; 

I also have another advertiser who is using appnexus (bRealtime), so I do not want to do a bidCpmAdjustment for appnexus.

headerbidding avatar Nov 07 '16 20:11 headerbidding

Yeah! That works!

Thank you!

From: Matt Lane [mailto:[email protected]] Sent: Monday, November 07, 2016 4:25 PM To: prebid/Prebid.js Cc: Flixxy; Author Subject: Re: [prebid/Prebid.js] bidCpmAdjustment for alias bidder? (#777)

The syntax error is due to 152media being an invalid JavaScript identifier (it starts with a number) rather than it being an alias bidder. You can still use this as an object key with bracket notation though. Try something like:

pbjs.bidderSettings = {}; pbjs.bidderSettings['152media'] = { bidCpmAdjustment: function(bidCpm) { return bidCpm * .95; } };

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/prebid/Prebid.js/issues/777#issuecomment-258967279 , or mute the thread https://github.com/notifications/unsubscribe-auth/AP62IhPBOQcwCLdD1pAFBoN37zw57bEgks5q75cjgaJpZM4KrrgV .Image removed by sender.

headerbidding avatar Nov 07 '16 22:11 headerbidding