This optional module will trigger validation of each bid on the bid response. Validation of a particular bid is based on its ortb2 values compared to the values in the bid.meta. The module configuration allows you to specify whether to enforce validation of particular fields or not. It also lets to specify if the bid should be rejected if selected field metadata value is not present.
Fields that can be configured:
cat - Banned categories idsadv - Banned advertiser domainsattr - Banned attributesmediaTypes - Banned bids of mediaTypes not present on adUnit| Field | Scope | Type | Description | Default |
|---|---|---|---|---|
enforce |
optional | boolean | Specifies whether to enforce validation for the field | true |
blockUnknown |
optional | boolean | Specifies whether it should reject the bid if the corresponding value in the bid metadata is undefined | true |
pbjs.setConfig({
bidResponseFilter: {
cat: {
blockUnknown: false // setting only one of parameters will keep the other one as default
},
adv: {
enforce: false
},
attr: {
enforce: false,
blockUnknown: false
},
mediaTypes: {
enforce: true,
blockUnknown: true
}
}
});
The new mediaTypes parameter allows you to block bids whose mediaType does not match any of the media types declared at the ad unit level.
To block bids containing In-Banner Video creatives IAB Creative Attributes 6 and 7, as defined in the AdCOM 1.0 specification, configure the Bid Response Filter module to reject these responses.
Restrict the ad unit to banner only and declare disallowed creative attributes (battr) directly in the ad unit definition:
const adUnit = {
code: 'banner-adunit',
mediaTypes: {
banner: {
battr: [6, 7] // Block In-Banner Video creative attributes
}
},
bids: [ /* bidder configs */ ]
};
Enable both the attr and mediaTypes filters in the bidResponseFilter configuration:
pbjs.setConfig({
bidResponseFilter: {
attr: { enforce: true },
mediaTypes: {
banner: { enforce: true }
}
}
});