Skip to content

Commit 41fdfe3

Browse files
dgirardipatmmccann
andauthored
Document flex ad mediaType / bidResponse options (prebid#6324)
* Document flex ad mediaType / bidResponse options * Update Flex banner example with documentation link Added a reference to Google request object documentation for Flex banner example. --------- Co-authored-by: Patrick McCann <patmmccann@gmail.com>
1 parent 2aa3fcf commit 41fdfe3

2 files changed

Lines changed: 44 additions & 6 deletions

File tree

dev-docs/adunit-reference.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ See the table below for the list of properties in the `mediaTypes` object of the
8484
{: .table .table-bordered .table-striped }
8585
| Name | Scope | Type | Description |
8686
|---------+----------+---------------------------------------+-----------------------------------------------------------------------------------------|
87-
| `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. |
87+
| `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. |
88+
| `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 . |
8889
| `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 |
8990
| `name` | Optional | String | Name for this banner ad unit. Can be used for testing and debugging. |
9091

@@ -222,6 +223,41 @@ pbjs.addAdUnits({
222223
});
223224
```
224225

226+
#### Flex banner example
227+
228+
See the [Google request object documentation](https://developers.google.com/authorized-buyers/rtb/openrtb-guide#flexslot-object) for additional details. These fields were removed from OpenRTB 2.6 but remain popular.
229+
230+
```javascript
231+
pbjs.addAdUnits({
232+
code: slot.code,
233+
mediaTypes: {
234+
banner: {
235+
expdir: [1, 2, 3, 4],
236+
format: [{w: 250, h: 250}],
237+
wmin: 250,
238+
wmax: 375,
239+
hmin: 250,
240+
hmax: 250,
241+
},
242+
},
243+
ortb2Imp: {
244+
banner: {
245+
ext: {
246+
flexslot: {
247+
wmin: 250,
248+
wmax: 375,
249+
hmin: 250,
250+
hmax: 250
251+
}
252+
}
253+
}
254+
},
255+
bids: [
256+
// ...
257+
]
258+
})
259+
```
260+
225261
<a name="adUnit-video-example"></a>
226262

227263
### Video

dev-docs/bidder-adaptor.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -514,11 +514,13 @@ The parameters of the `bidResponse` object are:
514514

515515
| Key | Scope | Description | Example |
516516
|--------------+---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------|
517-
| `requestId` | Required | The bid ID that was sent to `spec.buildRequests` as `bidRequests[].bidId`. Used to tie this bid back to the request. | 12345 |
518-
| `cpm` | Required | The bid price. We recommend the most granular price a bidder can provide | 3.5764 |
519-
| `currency` | Required | 3-letter ISO 4217 code defining the currency of the bid. | `"EUR"` |
520-
| `width` | Required | The width of the returned creative. For video, this is the player width. | 300 |
521-
| `height` | Required | The height of the returned creative. For video, this is the player height. | 250 |
517+
| `requestId` | Required | The bid ID that was sent to `spec.buildRequests` as `bidRequests[].bidId`. Used to tie this bid back to the request. | 12345 |
518+
| `cpm` | Required | The bid price. We recommend the most granular price a bidder can provide | 3.5764 |
519+
| `currency` | Required | 3-letter ISO 4217 code defining the currency of the bid. | `"EUR"` |
520+
| `width` | Required except when using `wratio` / `hratio` | The width of the returned creative. For video, this is the player width. | 300 |
521+
| `height` | Required except when using `wratio` / `hratio` | The height of the returned creative. For video, this is the player height. | 250 |
522+
| `wratio` | Required for flex ads | For flexible banner only, the relative width of the creative | 6 |
523+
| `hratio` | Required for flex ads | For flexible banner only, the relative height of the creative | 5 |
522524
| `ad` | Required | The creative payload of the returned bid. | `"<html><h3>I am an ad</h3></html>"` |
523525
| `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 |
524526
| `creativeId` | Required | A bidder-specific unique code that supports tracing the ad creative back to the source. | `"123abc"` |

0 commit comments

Comments
 (0)