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

Floors module: default floor price does not apply #10445

Closed
Pupis opened this issue Sep 7, 2023 · 7 comments · Fixed by #10475
Closed

Floors module: default floor price does not apply #10445

Pupis opened this issue Sep 7, 2023 · 7 comments · Fixed by #10475
Labels

Comments

@Pupis
Copy link
Contributor

Pupis commented Sep 7, 2023

Type of issue

Bug or question

Description

Prebid.js documentation says, that it is enough to configure adUnit with the default value, but there is no example with global floor.

...
 floors: {
     default: 1.00     // default currency is USD
 },
 ...

link to documentation

By looking into the source code, it seems that is necessary to have values in floors object link to source code and only default is insufficient, and skipped value to floor data is set to true, and therefore getFloor() does not exist.

Is this approach correct overall? If not, could you provide an example with the default floor value?
Also, is it possible to define default value while calling setConfig?

Expected results

Bid adapter to be able to get the default floor value.

Actual results

getFloor() does not exist.

@patmmccann
Copy link
Collaborator

Are you saying you set a skip rate and you are surprised there is no floor when the floor logic is skipped?

@patmmccann
Copy link
Collaborator

patmmccann commented Sep 7, 2023

As an aside I generally read this logic as confusing as well, conflating random skip and no match; these are very different for analytics purposes.
// if we still do not have a valid floor data then floors is not on for this auction, so skip if (Object.keys(deepAccess(resolvedFloorsData, 'data.values') || {}).length === 0) { resolvedFloorsData.skipped = true; } else { // determine the skip rate now const auctionSkipRate = getParameterByName('pbjs_skipRate') || resolvedFloorsData.skipRate; const isSkipped = Math.random() * 100 < parseFloat(auctionSkipRate); resolvedFloorsData.skipped = isSkipped; }

I remember we had an annoying time getting the set skip rate to match observed skip rate because some unexpected no matches were messing it up.

@dgirardi
Copy link
Collaborator

dgirardi commented Sep 7, 2023

I believe the documentation is incorrect in this:

Alternatively, if there’s only one mediaType in the AdUnit and a single global floor, the syntax gets easier:

from my testing both schema and values are required, and given that I'm not sure what the point of default is. @robertrmartinez ?

@modessef1
Copy link

I have exactly the same problem. I've set up the Prebid configuration just like OP, and the SSP bids below the default floor. They don't seem to see any floor in the requests I send them at all

@dgirardi
Copy link
Collaborator

dgirardi commented Sep 7, 2023

A workaround, to achieve what I think default is meant to do, is to put in the adUnit:

            floors: {
                schema: {
                    fields: ['mediaType'],
                },
                values: {
                    '*': 1.0, // this is effectively "default"
                },
            },

@modessef1
Copy link

@dgirardi In my config, I used a similar notation:

	"floors": {
           "currency": "USD",
           "schema": {
               "fields": ["mediaType"]
					},
           "values": {
               "banner": 0.45,
               "video": 3.00
           }
       },

Professor Prebid sees the config, but the SSPs bid below.
Example page: https://moto.rp.pl/dwa-kolka/art38119391-polski-motocykl-wygral-dwie-prestizowe-nagrody-w-usa

@dgirardi
Copy link
Collaborator

dgirardi commented Sep 7, 2023

@modessef1 when floors are set globally through setConfig, schema and values go under data. On that page, this seems to work:

pbjs.setConfig({
    floors: {
        data: {
            'currency': 'USD',
            'schema': {
                'fields': [
                    'mediaType'
                ]
            },
            'values': {
                'banner': 0.45,
                'video': 3
            }
        }
    }
});

Your floor config is correct if it were in the adUnit, although in that case you still need to activate the module with an empty setConfig (setConfig({floors: {}}))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

4 participants