Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Price Floors: Add bid object into cpmAdjustment function #5609

Merged
merged 1 commit into from
Aug 26, 2020

Conversation

robertrmartinez
Copy link
Collaborator

Type of change

  • Bugfix

Description of change

The priceFloors module has to run the bidCpmAdjustment function if a bidder has it.

Turns out, that not only is the cpm value needing to be passed into the adjustment function, but some publishers use the bidResponse object to grab the CPM (even though they are the same)

It is possible publishers to more intricate logic with this, so we will pass along the bidResponse object so it works in all scenarios!

const adjustmentFunction = utils.deepAccess(getGlobal(), `bidderSettings.${bidderName}.bidCpmAdjustment`);
if (adjustmentFunction) {
return parseFloat(adjustmentFunction(inputCpm));
return parseFloat(adjustmentFunction(inputCpm, {...bid, cpm: inputCpm}));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is called at bidRequest time, we do not really have a bidResponse object, so we''ll make a pseduo one with the cpm. Where cpm is actually the resulting floor from the adapters getFloor call.

@idettman idettman merged commit aaae81f into master Aug 26, 2020
BrightMountainMediaInc pushed a commit to BrightMountainMediaInc/Prebid.js that referenced this pull request Sep 14, 2020
BrightMountainMediaInc added a commit to BrightMountainMediaInc/Prebid.js that referenced this pull request Sep 14, 2020
@robertrmartinez robertrmartinez deleted the priceFloors-cpmAdjustment branch September 21, 2020 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants