prebid-server
prebid-server copied to clipboard
Richmedia filtering module
I've received a request to have Prebid Server be able to filter out MRAID creatives for a specific account. They refuse to run Prebid SDK/Server in their mobile app without this capability because they have been burned before. They don't trust setting the api
field because DSPs can ignore it. They want PBS to be able to recognize and remove bids with MRAID creatives.
Rather than building an MRAID-specific module, I propose calling it the "RichMedia Filter" module. We'll start with just supporting MRAID, but can extend to other scenarios as needed.
My understanding is that MRAID creatives in a bid would contain this code:
<script src="mraid.js"></script>
Assuming that's enough to identity MRAID, here are the proposed details.
Turning on the Module
Account-Level Config
The expected way this would normally work is for the account to state their preference:
{
"hooks": {
"modules": {
"pb-richmedia-filter": {
"filter-mraid": true
// future richmedia filtering options would go here
}
}
}
}
Behavior
Built as a hook in the All Processed Bid Response stage
, when invoked, this module:
- Determines whether the request needs to be processed. If
filter-mraid: true
in account config, then continue, else there's nothing to do -- just return to PBS. - Loop through all bid responses
- substring search the creative body (
adm
) for the patternmraid.js
. If it doesn't exist, go on the next bid response. - if
mraid.js
is found- reject the bid response with code 350 (as defined in https://github.com/prebid/prebid-server/issues/2367#issuecomment-1299097069)
- add an entry to the analytics tag for this rejected bid response. It's ok for a given impid to have more than one atag from the same bidder.
- substring search the creative body (
[{
// scenario: response from bidderA response rejected for imp=1
activities: [{
name: "reject-richmedia",
status: "success", // no errors from the module
results: [{
status: "success-block",
values: { // these are module-specific details about the result
"richmedia-format": "mraid"
},
appliedto: {
"bidder": "bidderA",
impids: ["1"]
}
// nothing logged to atags when no rejections take place
}]
}]
Discussed. The one item we need to settle on is the name-spacing of the modulecode.
Current proposal is "VENDOR.MODULE_NAME_WITH_UNDERSCORES"
e.g. pb.richmedia_filter
Going once...
Removed the request-level config override. Too complicated for the low value.
Done with PBS-Java 2.9