Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bidResponseFilter module docs #5647

Merged
merged 6 commits into from
Oct 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions dev-docs/modules/bidResponseFilter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
layout: page_v2
page_type: module
title: Module - Bid response filter
description: Validates bid's ortb2 data against its meta data
module_code : bidResponseFilter
display_name : Bid Response Filter
enable_download : true
sidebarType : 1

---

## Overview

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.

## Configuration

Fields that can be configured:

- `cat` - Banned categories ids
- `adv` - Banned advertiser domains
- `attr` - Banned attributes

### Field configuration object

{: .table .table-bordered .table-striped }
| 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` |

### Example module configuration

```javascript
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
}
}
});
```