prebid-server icon indicating copy to clipboard operation
prebid-server copied to clipboard

Richmedia filtering module

Open bretg opened this issue 2 years ago • 3 comments

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:

  1. 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.
  2. Loop through all bid responses
    1. substring search the creative body (adm) for the pattern mraid.js. If it doesn't exist, go on the next bid response.
    2. if mraid.js is found
      1. reject the bid response with code 350 (as defined in https://github.com/prebid/prebid-server/issues/2367#issuecomment-1299097069)
      2. 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.
[{
   // 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
   }]
}]

bretg avatar Dec 06 '22 21:12 bretg

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...

bretg avatar Feb 10 '23 16:02 bretg

Removed the request-level config override. Too complicated for the low value.

bretg avatar Jan 02 '24 15:01 bretg

Done with PBS-Java 2.9

bretg avatar Mar 12 '24 19:03 bretg