Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

Feature Request: allow publishers to configure bid filtering on .meta fields

Open patmmccann opened this issue 5 years ago • 8 comments

Type of issue

Feature request

Description

The discussion on #3115 is currently around the ability for bid filtering on meta fields. Publishers may want to filter particular values of meta fields (eg banned advertisers or incomplete dchains) or when they are missing (no dchain or advertiserDomain at all). Publishers may want this ability via modules or via setConfig. This issue is to give that discussion a home and allow for the closing of #3115

patmmccann avatar Mar 22 '21 16:03 patmmccann

Isn't this pretty simple to do with just a few lines of code using the getBidResponses and markWinningBidAsUsed to remove it.

To avoid hurting performance one needs to do these blocks server side no? Otherwise, bids get rejected and the second-highest bid at the exchange never makes it to prebid.

So to properly use this, one needs to track and monitor rejected bids as well. At this point, the few lines of code are nothing in comparison to the coding required for tracking and monitoring.

Am I missing something?

Slind14 avatar Mar 22 '21 16:03 Slind14

I think publisher logic here might be arbitrarily complex and there's an opportunity for a module, but I think you are right for simple cases.

patmmccann avatar Mar 22 '21 16:03 patmmccann

If it is arbitrarily complex won't a module be limiting publishers and in the end custom code will prevail?

I'm not trying to find the negatives here, just wondering if there is an actual use case where it makes sense to have a module.

Slind14 avatar Mar 22 '21 17:03 Slind14

I am imagining the geoedge and future related module(s) might include this feature

patmmccann avatar Mar 22 '21 17:03 patmmccann

Would you mind hashing out your example a bit more if you think we can close this with doc?

patmmccann avatar Mar 22 '21 17:03 patmmccann

pbjs.requestBids({
    bidsBackHandler: (bids) => {
        // loop through ad units
        Object.entries(bids).forEach(([adUnit, bids]) => {
            // invalidate blocked ads
            bids.forEach(bid => {
                if (isBlockScopedAd(bid.meta)) {
                    pbjs.markWinningBidAsUsed({ adId: bid.adId });
                }
            })
        });
        // continue normal logic
    },
});

Alternatively, one could loop do a while loop with getHighestCpmBids() ...

Slind14 avatar Mar 22 '21 17:03 Slind14

Hi,

I'd say it would be important to provide publishers (and eventually bidders) visibility on the filtration rate. IMO this could be done on two ways:

  • Adding post-bid filtering events to Prebid Analytics, so that publishers can see filtrarion rate per buyer and report top offenders
  • Adding a Loss URL mechanism to buyers so they can receive RT feedback

If there is enough Publisher demand for .meta validation features (maybe after prebid 5.0), would make sense to package this into a dedicated module to easy this job (examples: to enforce adomain, bid.cat, bid > bidfloor, meta ids)

Allan

allanjun avatar Apr 12 '21 16:04 allanjun

Going to push analytics events + further module enhancements, will document @Slind14's code snippet in examples for publishers to utilize if they so desire.

gglas avatar Apr 14 '21 16:04 gglas