Prebid Request Correction Module
Opened this issue · 1 comments
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:
- if app.ext.prebid.source!=“prebid-mobile” exit
- if app.ext.prebid.version >= 2.1.6 exit
- scan device.ua for the pattern "PrebidMobile/[0-9][^\S]*" (PrebidMobile/, followed by a number, then any number of non-whitespace characters)
- 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:
- If imp[0].instl is not specified or is 0, exit
- if app.ext.prebid.source is not “prebid-mobile”, exit
- if app.bundle does not contain the string “android”, exit
- if app.ext.prebid.version > 2.2.3, exit
- 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"
released with PBS-Java 3.15