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

Prebid Request Correction Module #3941

Open
bretg opened this issue Sep 25, 2024 · 0 comments
Open

Prebid Request Correction Module #3941

bretg opened this issue Sep 25, 2024 · 0 comments

Comments

@bretg
Copy link
Contributor

bretg commented Sep 25, 2024

Turns out that client code, both PBJS and PBSDK, is sometimes buggy, and that even once fixed, it's hard to get pubs and/or users to adopt the fixes. So Prebid Server has a role in dealing with the messy real world. Rather than hardcoding such fixes into PBS-core, we propose putting them into a module.

The first two corrections supported by the module are from the Prebid Mobile world.

PBSDK: remove "PrebidMobile/*" from device.ua

As described in #3723, there are versions of the PBSDK that set device.ua to include "PrebidMobile/x.y.z". This can cause some bidders to view the request as invalid traffic.

If the "pbsdkUaCleanup" correction is enabled, the module would:

  1. if app.ext.prebid.source!=“prebid-mobile” exit
  2. if app.ext.prebid.version >= 2.1.6 exit
  3. scan device.ua for the pattern "PrebidMobile/[0-9][^\S]*" (PrebidMobile/, followed by a number, then any number of non-whitespace characters)
  4. If found, remove this pattern from device.ua

this means the module will have to split the major, minor, and patch versions and do all the comparisons. If the version is “2.2”, that should be considered “2.2.0”, which is less than “2.2.3.”

PBSDK: remove errant instl flag

The ‘pbsdkAndroidInstlRemove’, feature removes the instl:1 ORTB flag in the following scenario:

  1. If imp[0].instl is not specified or is 0, exit
  2. if app.ext.prebid.source is not “prebid-mobile”, exit
  3. if app.bundle does not contain the string “android”, exit
  4. if app.ext.prebid.version > 2.2.3, exit
  5. If we're still here, remove the imp[0].instl flag

this means the module will have to split the major, minor, and patch versions and do all the comparisons. If the version is “2.2”, that should be considered “2.2.0”, which is less than “2.2.3.”

Configuration

This is the proposed module configuration:

{
   "hooks": {
      "modules": {
         "pb-request-correction": {
            "enabled": true,
            "pbsdkUaCleanup": true,
            "pbsdkAndroidInstlRemove": true
         }
     }
}

Notes:

  • The idea is that each new correction gets a code. e.g. "pbsdkUaCleanup"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready for Dev
Development

No branches or pull requests

1 participant