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
Update floors module to work with ortb2Imp.bidfloor
#11285
Comments
As you have discovered, floor data is calculated before the first auction event fires. There's a few ways you could work around it but none are clean. I think we could delay floor logic until after BEFORE_REQUEST_BIDS to address this. Currently, ad units have one piece of floor information that you can manipulate, Otherwise I think the next best - but still very ugly - way to do this would be to monkey-patch |
@dgirardi thank you for the answer. Both solutions work for me. |
Proposal:
|
ortb2Imp.bidfloor
ortb2Imp.bidfloor
ortb2Imp.bidfloor
Thanks @dgirardi - I agree with 3 of these bullet points. But not this one:
If the floors module is active, it's floors should override static default AdUnit.ortb2Imp.bidfloor values. Yes, I recognize this is the opposite of the standard that publisher-supplied values take precedence, but given the nature of this feature, I think it's warranted. A publisher that wants to supply a completely static floor value should just not incorporate the floors module. |
We rely on before request bids to ascertain the floor we've set |
Current behaviour in the ortb2Converter is that it will use the floor from the Floors Module if a floor is also specified on ortb2Imp.bidfloor. PMC decision: We don't want to introduce a breaking change. The ortb2Imp.bidfloor should only be used if publishers do not want to use the Floors module. If the Floors module is present, Prebid.js will always use those floors. There is an implied feature request here to make it easier update the floors manually in the Floors module. |
Hi @wiedaw You are basically set up for dynamic floors from any source you want. If you build the It's defined here in great detail: https://docs.prebid.org/dev-docs/modules/floors.html#defining-floors#floors-defined-in-the-adunit In the end you set a var adUnits = [
{
code: 'test-div',
mediaTypes: {
banner: { sizes: [[300,250],[300,600]] }
},
// get this project from where ever you like it to be
floors: {
currency: 'USD',
schema: {
delimiter: '|',
fields: [ 'mediaType' ]
},
values: {
'*': 1.10 /* here you can calculate whatever you want */
}
},
bids: [
// ...
]
}
]; |
@muuki88 yes, indeed but the situation I described was different. The are no adUnits defined at the beginning but all adUnits with their floors are added directly to requestBids method as arguments. So my question was how from external script could I change floors for these adUnits. I got the answer about floorMin and monkey-patch which works fine for me. If you know any other way to achive it please describe. |
Hi @wiedaw So I see three different scenarios here
1) External floor price providerThey should join this issue and explain a little bit their use case, why a 2) You are a floor price providerI would assume that you want publishers to drop your script on the page and everything works magically. That's never going to work properly, because
What exactly have you tried? 3) You are a publisherSo you control the external script to some degree. A very window.pbjs = window.pbjs || { que: [] };
const pbjsReady = new Promise(resolve => window.pbjs.que.push(resolve));
const floors = new Promise(resolve => {
// wait for the external script to push to a que like pbjs or dynamically insert the js here and wait for the onload event
// and resolve the promise with the floor data
resolve(floorData);
});
floors.then(floorData => {
window.pbjs.que.push(() => {
window.pbjs.requestBids({
bidsBackHandler,
adUnits: [
{
code: 'test-div',
mediaTypes: {
banner: { sizes: [[300,250],[300,600]] }
},
// get this project from where ever you like it to be
floors: {
currency: 'USD',
schema: {
delimiter: '|',
fields: [ 'mediaType' ]
},
values: {
'*': floorData['test-div'];
}
},
bids: [
// ...
]
}
];
]
});
});
}); |
Type of issue
Question
Description
I have the script which calls
requestBids
. The script doesn’t use addAdunit method to define the adUnit but calls directly requestBids with the adUnit as an argument. Ad units have set floor.I'm wondering if there is possibility to change the floor configuration from external script just before sending bid request. I was checking beforeRequestBids, auctionInit events but it doesn't work and the floor stays the same, do not take into consideration my changes in configuration.
Expected results
Expected result is to be able to set floors from external script.
Actual results
Platform details
Prebid.js version 8.27.0
The text was updated successfully, but these errors were encountered: