From 6aabb915b2cb6f642c3dd50761bfe7d259166e99 Mon Sep 17 00:00:00 2001 From: Demetrio Girardi Date: Wed, 5 Nov 2025 09:06:15 -0800 Subject: [PATCH] Document flex ad mediaType / bidResponse options --- dev-docs/adunit-reference.md | 36 +++++++++++++++++++++++++++++++++++- dev-docs/bidder-adaptor.md | 12 +++++++----- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/dev-docs/adunit-reference.md b/dev-docs/adunit-reference.md index 9346cca31e..9ea97c4c96 100644 --- a/dev-docs/adunit-reference.md +++ b/dev-docs/adunit-reference.md @@ -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. | @@ -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: { + wmin: 250, + wmax: 375, + hmin: 250, + hmax: 250 + } + } + } + }, + bids: [ + // ... + ] +}) +``` + ### Video diff --git a/dev-docs/bidder-adaptor.md b/dev-docs/bidder-adaptor.md index 94a35f59bb..19290abd00 100644 --- a/dev-docs/bidder-adaptor.md +++ b/dev-docs/bidder-adaptor.md @@ -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. | `"

I am an ad

"` | | `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"` |