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

floor price module should pick the highest matching floor not the first matching floor #10708

Closed
PascalSalesch opened this issue Nov 9, 2023 · 3 comments

Comments

@PascalSalesch
Copy link
Contributor

PascalSalesch commented Nov 9, 2023

Type of issue

  • Feature

Description

The floor price module currently only retrieves the first matching rule via getFirstMatchingFloor.
Which sorts the rules by ascending number of occurences of wildcards *.

Imo, it would make more sense to pick the highest floor.

Steps to reproduce

{
   "data":{
      "schema":{
         "fields":[
            "device",
            "country"
         ]
      },
      "values":{
         "desktop|*":3,
         "*|ch":5
      }
}

Expected results

I would expect all matching rules to apply. Using the rule with the highest floorRuleValue will accomplish that.

Actual results

With the above configuration, if you're on a desktop in switzerland (ch) the floorRuleValue will be 3, rather than 5:

{
    "floorMin": 0,
    "floorRuleValue": 3,
    "matchingData": "desktop|ch",
    "matchingRule": "desktop|*",
    "matchingFloor": 3
}
@patmmccann
Copy link
Collaborator

It is specifically documented and designed not to do this. Why do you have this expectation?

@patmmccann patmmccann moved this from Triage to Needs OP in Prebid.js Tactical Issues table Nov 9, 2023
@PascalSalesch
Copy link
Contributor Author

PascalSalesch commented Nov 10, 2023

Ah, sorry I should have not used the word "expect" ^^' It's just that, that's the templates headline, so I used the same wording. This is a change request. The docs are clear about the behavior.

I personally would like for it to work this way since having rules for many countries just so that they take priority is a bit messy.

I understand if these rules are supposed to prioritize explicit matches, but if you could point me to any reasoning for this it would be appreciated.

@patmmccann
Copy link
Collaborator

This feels like quite a painful change that would affect just as many or more parties negatively in transition pain as it would benefit. OP could easily solve his issues by returning different rules files in different countries rather than having his js be country-aware.

@patmmccann patmmccann closed this as not planned Won't fix, can't repro, duplicate, stale Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants