Skip to content
Open
Show file tree
Hide file tree
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
36 changes: 35 additions & 1 deletion dev-docs/adunit-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ See the table below for the list of properties in the `mediaTypes` object of the
{: .table .table-bordered .table-striped }
| Name | Scope | Type | Description |
|---------+----------+---------------------------------------+-----------------------------------------------------------------------------------------|
| `sizes` | Required | Array[Number] or Array[Array[Number]] | All sizes this ad unit can accept. Examples: `[400, 600]`, `[[300, 250], [300, 600]]`. Prebid recommends that the sizes auctioned by Prebid should be the same auctioned by AdX and GAM OpenBidding, which means AdUnit sizes should match the GPT sizes. |
| `sizes` | Required if `format` is not provided | Array[Number] or Array[Array[Number]] | All sizes this ad unit can accept. Examples: `[400, 600]`, `[[300, 250], [300, 600]]`. Prebid recommends that the sizes auctioned by Prebid should be the same auctioned by AdX and GAM OpenBidding, which means AdUnit sizes should match the GPT sizes. |
| `format` | Required if `sizes` is not provided | Array of ORTB [Format](https://github.com/InteractiveAdvertisingBureau/openrtb2.x/blob/main/2.6.md#objectformat) objects | Alternative to `sizes`, and takes precedence over it. Allows for more options, such as . |
| `pos` | Optional | Integer | OpenRTB page position value: 0=unknown, 1=above-the-fold, 3=below-the-fold, 4=header, 5=footer, 6=sidebar, 7=full-screen |
| `name` | Optional | String | Name for this banner ad unit. Can be used for testing and debugging. |

Expand Down Expand Up @@ -222,6 +223,39 @@ pbjs.addAdUnits({
});
```

#### Flex banner example

```javascript
pbjs.addAdUnits({
code: slot.code,
mediaTypes: {
banner: {
expdir: [1, 2, 3, 4],
format: [{w: 250, h: 250}],
wmin: 250,
wmax: 375,
hmin: 250,
hmax: 250,
},
},
ortb2Imp: {
banner: {
ext: {
flexslot: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wmin: 250,
wmax: 375,
hmin: 250,
hmax: 250
}
}
}
},
bids: [
// ...
]
})
```

<a name="adUnit-video-example"></a>

### Video
Expand Down
12 changes: 7 additions & 5 deletions dev-docs/bidder-adaptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,13 @@ The parameters of the `bidResponse` object are:

| Key | Scope | Description | Example |
|--------------+---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------|
| `requestId` | Required | The bid ID that was sent to `spec.buildRequests` as `bidRequests[].bidId`. Used to tie this bid back to the request. | 12345 |
| `cpm` | Required | The bid price. We recommend the most granular price a bidder can provide | 3.5764 |
| `currency` | Required | 3-letter ISO 4217 code defining the currency of the bid. | `"EUR"` |
| `width` | Required | The width of the returned creative. For video, this is the player width. | 300 |
| `height` | Required | The height of the returned creative. For video, this is the player height. | 250 |
| `requestId` | Required | The bid ID that was sent to `spec.buildRequests` as `bidRequests[].bidId`. Used to tie this bid back to the request. | 12345 |
| `cpm` | Required | The bid price. We recommend the most granular price a bidder can provide | 3.5764 |
| `currency` | Required | 3-letter ISO 4217 code defining the currency of the bid. | `"EUR"` |
| `width` | Required except when using `wratio` / `hratio` | The width of the returned creative. For video, this is the player width. | 300 |
| `height` | Required except when using `wratio` / `hratio` | The height of the returned creative. For video, this is the player height. | 250 |
| `wratio` | Required for flex ads | For flexible banner only, the relative width of the creative | 6 |
| `hratio` | Required for flex ads | For flexible banner only, the relative height of the creative | 5 |
| `ad` | Required | The creative payload of the returned bid. | `"<html><h3>I am an ad</h3></html>"` |
| `ttl` | Required | Time-to-Live - how long (in seconds) Prebid can use this bid. See the [FAQ entry](/dev-docs/faq.html#does-prebidjs-cache-bids) for more info. | 360 |
| `creativeId` | Required | A bidder-specific unique code that supports tracing the ad creative back to the source. | `"123abc"` |
Expand Down