Skip to content

Commit 95b2a96

Browse files
authored
Document bid desirability adjustment (#6602)
1 parent 64f0529 commit 95b2a96

1 file changed

Lines changed: 44 additions & 16 deletions

File tree

dev-docs/publisher-api-reference/bidderSettings.md

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebarType: 1
66
---
77

88

9-
#### 1. Overview
9+
## 1. Overview
1010

1111
The bidderSettings object provides a way to define some behaviors for the
1212
platform and specific adapters. The basic structure is a 'standard' section with defaults for all adapters, and then one or more adapter-specific sections that override behavior for that bidder:
@@ -33,23 +33,24 @@ Some sample scenarios where publishers may wish to alter the default settings:
3333
* passing additional information to the ad server
3434
* adjusting the bid CPM sent to the ad server
3535

36-
#### 2. Bidder Setting Attributes
36+
## 2. Bidder Setting Attributes
3737

3838
{: .table .table-bordered .table-striped }
3939
| Attribute | Scope | Version | Default | Description |
4040
| --- | --- | --- | --- | --- |
4141
| adserverTargeting | standard or adapter-specific | all | see below | Define which key/value pairs are sent to the ad server. |
4242
| bidCpmAdjustment | standard or adapter-specific | all | n/a | Custom CPM adjustment function. Could, for example, adjust a bidder's gross-price bid to net price. |
43+
| bidDesirabilityAdjustment | standard or adapter-specific | 11.15.0 | n/a | Custom bid desirability adjustment function. Allows bids to be ranked by a publisher-defined score without changing the adjusted CPM. |
4344
| inverseBidAdjustment | standard or adapter-specific | 7.33.0 | n/a | Inverse of `bidCpmAdjustment` |
4445
| sendStandardTargeting | adapter-specific | 0.13.0 | true | If adapter-specific targeting is specified, can be used to suppress the standard targeting for that adapter. |
4546
| suppressEmptyKeys | standard or adapter-specific | 0.13.0 | false | If custom adserverTargeting functions are specified that may generate empty keys, this can be used to suppress them. |
4647
| allowZeroCpmBids | standard or adapter-specific | 6.2.0 | false | Would allow bids with a 0 CPM to be accepted by Prebid.js and could be passed to the ad server. |
4748
| storageAllowed | standard or adapter-specific | 6.13.0 | true in 6.x, false after 7.0 | Allow use of cookies and/or local storage. |
48-
| allowAlternateBidderCodes | standard or adapter-specific | 6.23.0 | true in v6.x <br /> false from v7.0| Allow adapters to bid with alternate bidder codes. |
49+
| allowAlternateBidderCodes | standard or adapter-specific | 6.23.0 | true in v6.x <br /> false from v7.0 | Allow adapters to bid with alternate bidder codes. |
4950
| allowedAlternateBidderCodes | standard or adapter-specific | 6.23.0 | n/a | Array of bidder codes for which an adapter can bid. <br />`undefined` or `['*']` will allow adapter to bid with any bidder code. |
5051
| adjustAlternateBids | standard or adapter-specific | 7.48.0 | false | Optionally allow alternate bidder codes to use an adapter's bidCpmAdjustment function by default instead of the standard bidCpmAdjustment function if present (note: if a bidCpmAdjustment function exists for the alternate bidder code within bidderSettings, then this will be used instead of falling back to the adapter's bidCpmAdjustment function). |
5152

52-
##### 2.1. adserverTargeting
53+
### 2.1. adserverTargeting
5354

5455
As described in the [AdOps documentation]({{site.baseurl}}/adops/before-you-start.html), Prebid has a recommended standard
5556
set of ad server targeting that works across bidders. This standard targeting approach is
@@ -144,15 +145,15 @@ pbjs.bidderSettings = {
144145
}
145146
```
146147

147-
In other words, the above config sends 2 pairs of key/value strings targeting for every AppNexus bid and for every ad unit. The 1st pair would be `apn_pbMg` => the value of `bidResponse.pbMg`. The 2nd pair would be `apn_adId` => the value of `bidResponse.adId`. You can find the bidResponse object documentation [here](/troubleshooting/troubleshooting-guide.html#common-bid-response-parameters).
148+
In other words, the above config sends 2 pairs of key/value strings targeting for every AppNexus bid and for every ad unit. The 1st pair would be `apn_pbMg` => the value of `bidResponse.pbMg`. The 2nd pair would be `apn_adId` => the value of `bidResponse.adId`. See [common bid response parameters](/troubleshooting/troubleshooting-guide.html#common-bid-response-parameters) for bidResponse object documentation.
148149

149150
Note that sendStandardTargeting is set to false so that the standard Prebid targeting (hb_bidder, etc.) aren't also sent to the ad server.
150151

151152
**Price Buckets**
152153

153154
Now let's say you would like to define a bidder-specific price bucket function rather than use the ones available by default in prebid.js. Even the [priceGranularity config](/dev-docs/publisher-api-reference/setConfig.html#setConfig-Price-Granularity) option applies to all bidders -- with this approach you can overwrite price buckets.
154155

155-
*Note: this will only impact the price bucket sent to the ad server for targeting. It won't actually impact the cpm value used for ordering the bids.*
156+
*Note: this will only impact the price bucket sent to the ad server for targeting. It won't actually impact the CPM or desirability score used for ordering the bids.*
156157

157158
```javascript
158159
pbjs.bidderSettings = {
@@ -180,7 +181,7 @@ pbjs.bidderSettings = {
180181
}
181182
```
182183

183-
##### 2.2. bidCpmAdjustment
184+
### 2.2. bidCpmAdjustment
184185

185186
Some bidders return gross prices instead of the net prices (what the publisher will actually
186187
get paid). For example, a publisher's net price might be 15% below the returned gross price.
@@ -189,7 +190,7 @@ header bidding auction. Otherwise, this bidder's gross price will unfairly win o
189190
other demand sources who report the real price.
190191

191192
Custom adjustment can be provided as a function taking 3 arguments: `bidCpmAdjustment(cpm, bidResponse, bidRequest)`.
192-
Note that either `bidResponse` or `bidRequest` may be missing, although at least one of them is guaranteed to be present. This is because Prebid will sometimes need to run adjustment when no bid has been made yet; see [inverseBidAdjustment](#23-inversebidadjustment) below.
193+
Note that either `bidResponse` or `bidRequest` may be missing, although at least one of them is guaranteed to be present. This is because Prebid will sometimes need to run adjustment when no bid has been made yet; see [inverseBidAdjustment](#24-inversebidadjustment) below.
193194

194195
For example:
195196

@@ -208,7 +209,34 @@ pbjs.bidderSettings = {
208209

209210
In the above example, the AOL bidder will inherit from "standard" adserverTargeting keys, so that you don't have to define the targeting keywords again.
210211

211-
##### 2.3. inverseBidAdjustment
212+
### 2.3. bidDesirabilityAdjustment
213+
214+
By default, Prebid.js ranks accepted bids using their CPM after `bidCpmAdjustment` has been applied. Publishers who want to rank bids with additional business logic can provide `bidDesirabilityAdjustment`. This function returns a numeric score used to compare bids: higher scores are preferred.
215+
216+
This is useful when the publisher wants auction ordering to account for signals that should not change the bid's adjusted CPM, price bucket, or ad server reporting value. For example, a publisher could prefer bids from a demand source that has better historical fill, lower discrepancy, or other business-priority signals while keeping the CPM available for targeting and reporting unchanged.
217+
218+
The function takes 3 arguments: `bidDesirabilityAdjustment(cpm, bidResponse, bidRequest)`. The `cpm` argument is the bid CPM after `bidCpmAdjustment` has been applied. The function should return a number, and the default score is the adjusted CPM. If the function throws an error, Prebid.js logs the error and falls back to the adjusted CPM.
219+
220+
For example:
221+
222+
```javascript
223+
pbjs.bidderSettings = {
224+
standard: { ... },
225+
exampleBidder: {
226+
bidDesirabilityAdjustment: function(adjustedCpm, bid) {
227+
// Prefer this bidder slightly for ordering without changing its CPM.
228+
if (bid.dealId) {
229+
return adjustedCpm + 0.25;
230+
}
231+
return adjustedCpm;
232+
}
233+
}
234+
};
235+
```
236+
237+
In the above example, deal bids from `exampleBidder` receive a higher desirability score than their adjusted CPM. The bid's CPM is not changed by this function.
238+
239+
### 2.4. inverseBidAdjustment
212240

213241
When using [price floors](/dev-docs/modules/floors.html), Prebid attempts to calculate the inverse of `bidCpmAdjustment`, so that the floor values it requests from SSPs take into account how the bid will be adjusted.
214242
For example, if the adjustment is `bidCpm * .85` as above, floors are adjusted by `bidFloor * 1 / .85`.
@@ -231,7 +259,7 @@ pbjs.bidderSettings = {
231259
};
232260
```
233261

234-
##### 2.4. sendStandardTargeting
262+
### 2.5. sendStandardTargeting
235263

236264
This boolean flag minimizes key/value pairs sent to the ad server when
237265
adapter-specific targeting is specified. By default, the platform will send both adapter-specific adServerTargeting as well as the standard adServerTargeting.
@@ -241,19 +269,19 @@ suppress the standard targeting for adapters that define their own.
241269

242270
See the [example above](#key-targeting-specific-bidder) for example usage.
243271

244-
##### 2.5. suppressEmptyKeys
272+
### 2.6. suppressEmptyKeys
245273

246274
If a custom adServerTargeting function can return an empty value, this boolean flag can be used to avoid sending those empty values to the ad server.
247275

248-
##### 2.6. allowZeroCpmBids
276+
### 2.7. allowZeroCpmBids
249277

250278
By default, 0 CPM bids are ignored by Prebid.js entirely. However if there's a valid business reason to allow these bids, this setting can be enabled to allow
251279
either specific bid adapter(s) or all bid adapters the permission for these bids to be processed by Prebid.js and potentially sent to the respective ad server
252280
(depending on the Prebid.js auction results).
253281

254282
<a id="storageAllowed"></a>
255283

256-
##### 2.7. storageAllowed
284+
### 2.8. storageAllowed
257285

258286
This setting defines if the bid adapter can access browser cookies or local storage. Allowed values are:
259287

@@ -271,13 +299,13 @@ Note that:
271299

272300
<a id="allowAlternateBidderCodes" />
273301

274-
##### 2.8. allowAlternateBidderCodes
302+
### 2.9. allowAlternateBidderCodes
275303

276304
If this flag is set to `true`, bidders that have not been explicitly requested in [`adUnit.bids`](../adunit-reference.html#adunitbids) may take part in the auction.
277305
<br />Default value is `true` in version 6.x
278306
<br />Default value will be `false` from version 7.0
279307

280-
##### 2.9. allowedAlternateBidderCodes
308+
### 2.10. allowedAlternateBidderCodes
281309

282310
This array will work in conjunction with `allowAlternateBidderCodes`. In this array, you can specify the names of the bidder for which an adapter can accept the bid. If the value is not specified for the array or `[‘*’]` is specified, Prebid will accept bids of all the bidders for the given adapter.
283311

@@ -310,7 +338,7 @@ pbjs.bidderSettings = {
310338
In the above example, `groupm` bid will have a bid adjustment of 80% since the `bidCpmAdjustment` function says so.<br />
311339
If `appnexus` bids with another bidder code, say `appnexus2`. This bidder code will adjust the bid cpm to 95% because it will apply the `bidCpmAdjustment` function from `standard` setting, since the `bidCpmAdjustment` is missing for given bidder code I.e `appnexus2`
312340

313-
##### 2.10. adjustAlternateBids
341+
### 2.11. adjustAlternateBids
314342

315343
Optionally allow alternate bidder codes originating from a specific bid adapter to fallback to that same adapter's bidCpmAdjustment function. When adjustAlternateBids is set to true, the prioity of which bidCpmAdjustment function to utilize will be as follows based on what is present within the bidderSettings object:
316344

0 commit comments

Comments
 (0)