diff --git a/dev-docs/publisher-api-reference.md b/dev-docs/publisher-api-reference.md index c3e11a92a2..086b04156b 100644 --- a/dev-docs/publisher-api-reference.md +++ b/dev-docs/publisher-api-reference.md @@ -14,2813 +14,18 @@ sidebarType: 1 This page has documentation for the public API methods of Prebid.js. - - -## pbjs - -* [pbjs](#module_pbjs) - - * [.getAdserverTargeting()](#module_pbjs.getAdserverTargeting) - * [.getAdserverTargetingForAdUnitCode([adUnitCode])](#module_pbjs.getAdserverTargetingForAdUnitCode) - * [.getBidResponses()](#module_pbjs.getBidResponses) - * [.getBidResponsesForAdUnitCode(adUnitCode)](#module_pbjs.getBidResponsesForAdUnitCode) - * [.getEvents()](#module_pbjs.onEvent) - * [.getHighestCpmBids([adUnitCode])](#module_pbjs.getHighestCpmBids) - * [.getAllWinningBids()](#module_pbjs.getAllWinningBids) - * [.getAllPrebidWinningBids()](#module_pbjs.getAllPrebidWinningBids) - * [.getNoBids()](#module_pbjs.getNoBids) - * [.getNoBidsForAdUnitCode(adUnitCode)](#module_pbjs.getNoBidsForAdUnitCode) - * [.setTargetingForGPTAsync([codeArr], customSlotMatching)](#module_pbjs.setTargetingForGPTAsync) - * [.setTargetingForAst()](#module_pbjs.setTargetingForAst) - * [.renderAd(doc, id)](#module_pbjs.renderAd) - * [.removeAdUnit(adUnitCode)](#module_pbjs.removeAdUnit) - * [.requestBids(requestObj)](#module_pbjs.requestBids) - * [.addAdUnits(Array\|Object)](#module_pbjs.addAdUnits) - * [.bidderSettings](#module_pbjs.bidderSettings) - * [.onEvent(event, handler, id)](#module_pbjs.onEvent) - * [.offEvent(event, handler, id)](#module_pbjs.onEvent) - * [.enableAnalytics(config)](#module_pbjs.enableAnalytics) - * [.aliasBidder(adapterName, aliasedName)](#module_pbjs.aliasBidder) - * [.markWinningBidAsUsed(markBidRequest)](#module_pbjs.markWinningBidAsUsed) - * [.setConfig(options)](#module_pbjs.setConfig) - * [debugging](#setConfig-Debugging) - * [deviceAccess](#setConfig-deviceAcess) - * [bidderTimeout](#setConfig-Bidder-Timeouts) - * [maxRequestsPerOrigin](#setConfig-Max-Requests-Per-Origin) - * [disableAjaxTimeout](#setConfig-Disable-Ajax-Timeout) - * [timeoutBuffer](#setConfig-timeoutBuffer) - * [bidderOrder](#setConfig-Bidder-Order) - * [enableSendAllBids](#setConfig-Send-All-Bids) - * [sendBidsControl](#setConfig-Send-Bids-Control) - * [useBidCache](#setConfig-Use-Bid-Cache) - * [pageUrl](#setConfig-Page-URL) - * [publisherDomain](#setConfig-Publisher-Domain) - * [priceGranularity](#setConfig-Price-Granularity) - * [mediaTypePriceGranularity](#setConfig-MediaType-Price-Granularity) - * [s2sConfig](#setConfig-Server-to-Server) (server-to-server config) - * [app](#setConfig-app) (mobile app post-bid) - * [userSync](#setConfig-Configure-User-Syncing) - * [targetingControls](#setConfig-targetingControls) - * [sizeConfig and labels](#setConfig-Configure-Responsive-Ads) (responsive ads) - * [COPPA](#setConfig-coppa) - * [first party data](#setConfig-fpd) - * [cache](#setConfig-vast-cache) - * [instreamTracking](#setConfig-instream-tracking) - requires [Instream Tracking Module](/dev-docs/modules/instreamTracking.html) - * [site](#setConfig-site) - * [auctionOptions](#setConfig-auctionOptions) - * [Generic Configuration](#setConfig-Generic-Configuration) - * [Troubleshooting your config](#setConfig-Troubleshooting-your-configuration) - * [.setBidderConfig(options)](#module_pbjs.setBidderConfig) - * [.getConfig([string])](#module_pbjs.getConfig) - -Functions added by optional modules - - * [.adServers.dfp.buildVideoUrl(options)](#module_pbjs.adServers.dfp.buildVideoUrl) - requires [GAM Video Module](/dev-docs/modules/dfp_video.html) - * [.adServers.dfp.buildAdpodVideoUrl(options)](#module_pbjs.adServers.dfp.buildAdpodVideoUrl) - requires [GAM Video Module](/dev-docs/modules/dfp_video.html) [Alpha] - * [.adServers.freewheel.getTargeting(options)](#module_pbjs.getTargeting) - requires [Freewheel Module](/dev-docs/modules/freewheel.html) - * [.getUserIds()](#userId.getUserIds) - requires [User Id Module](/dev-docs/modules/userId.html) - * [.getUserIdsAsEids()](#userId.getUserIdsAsEids) - requires [User Id Module](/dev-docs/modules/userId.html) - * [.refreshUserIds(options, callback)](#userId.refreshUserIds) - requires [User Id Module](/dev-docs/modules/userId.html) - - - -### pbjs.getAdserverTargeting() ⇒ `object` - -Returns all ad server targeting for all ad units. Note that some bidder's response may not have been received if you call this function too quickly after the requests are sent. - -The targeting keys can be configured in [ad server targeting](#module_pbjs.bidderSettings). - -When [deals are enabled]({{site.baseurl}}/adops/deals.html), the object returned by this method may include a field `hb_deal_BIDDERCODE`, where `BIDDERCODE` is replaced by the name of the bidder, e.g., AppNexus, Rubicon, etc. - -**Kind**: static method of [pbjs](#module_pbjs) - -**Returns**: `object` - Map of adUnitCodes and targeting values [] - -**Returned Object Example:** - -{% highlight js %} -{ - "/9968336/header-bid-tag-0": { - "hb_bidder": "rubicon", - "hb_adid": "13f44b0d3c", - "hb_pb": "1.50" - }, - "/9968336/header-bid-tag-1": { - "hb_bidder": "openx", - "hb_adid": "147ac541a", - "hb_pb": "1.00" - }, - "/9968336/header-bid-tag-2": { - "hb_bidder": "appnexus", - "hb_adid": "147ac541a", - "hb_pb": "2.50", - "hb_deal_appnexus": "ABC_123" - } -} -{% endhighlight %} - -
/pbjs_demo.html?pbjs_debug=true
See [Prebid.js troubleshooting tips](/dev-docs/troubleshooting-tips.html) for more information.
-
-Turn on debugging permanently in the page:
-{% highlight js %}
-pbjs.setConfig({ debug: true });
-{% endhighlight %}
-
-{: .alert.alert-warning :}
-Note that turning on debugging for Prebid Server causes most server-side adapters to consider it a test request, meaning that they won't count on reports.
-
-
-
-#### Device Access
-
-You can prevent Prebid.js from reading or writing cookies or HTML localstorage by setting this flag:
-
-{% highlight js %}
-pbjs.setConfig({ deviceAccess: false });
-{% endhighlight %}
-
-This can be useful in GDPR, CCPA, COPPA or other privacy scenarios where a publisher has determined that header bidding should not read from or write the user's device.
-
-
-
-#### Bidder Timeouts
-
-Set a global bidder timeout:
-
-{% highlight js %}
-pbjs.setConfig({ bidderTimeout: 3000 });
-{% endhighlight %}
-
-{: .alert.alert-warning :}
-**Bid Timeouts and JavaScript Timers**
-Note that it's possible for the timeout to be triggered later than expected, leading to a bid participating in the auction later than expected. This is due to how [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout) works in JS: it queues the callback in the event loop in an approximate location that *should* execute after this time but *it is not guaranteed*.
-With a busy page load, bids can be included in the auction even if the time to respond is greater than the timeout set by Prebid.js. However, we do close the auction immediately if the threshold is greater than 200ms, so you should see a drop off after that period.
-For more information about the asynchronous event loop and `setTimeout`, see [How JavaScript Timers Work](https://johnresig.com/blog/how-javascript-timers-work/).
-
-#### Max Requests Per Origin
-
-
-
-Since browsers have a limit of how many requests they will allow to a specific domain before they block, Prebid.js
-will queue auctions that would cause requests to a specific origin to exceed that limit. The limit is different
-for each browser. Prebid.js defaults to a max of `4` requests per origin. That value can be configured with
-`maxRequestsPerOrigin`.
-
-{% highlight js %}
-// most browsers allow at least 6 requests, but your results may vary for your user base. Sometimes using all
-// `6` requests can impact performance negatively for users with poor internet connections.
-pbjs.setConfig({ maxRequestsPerOrigin: 6 });
-
-// to emulate pre 1-x behavior and have all auctions queue (no concurrent auctions), you can set it to `1`.
-pbjs.setConfig({ maxRequestsPerOrigin: 1 });
-{% endhighlight %}
-
-#### Disable Ajax Timeout
-
-
-
-Prebid core adds a timeout on XMLHttpRequest request to terminate the request once auction is timedout. Since Prebid is ignoring all the bids after timeout it does not make sense to continue the request after timeout. However, you have the option to disable this by using `disableAjaxTimeout`.
-
-{% highlight js %}
-pbjs.setConfig({ disableAjaxTimeout: true });
-{% endhighlight %}
-
-#### Set Timeout Buffer
-
-
-
-Prebid core adds a timeout buffer to extend the time that bidders have to return a bid after the auction closes. This buffer is used to offset the "time slippage" of the setTimeout behavior in browsers. Prebid.js sets the default value to 400ms. You can change this value by setting `timeoutBuffer` to the amount of time you want to use. The following example sets the buffer to 300ms.
-
-{% highlight js %}
-pbjs.setConfig({ timeoutBuffer: 300 });
-{% endhighlight %}
-
-#### Send All Bids
-
-
-
-When enableSendAllBids is **true** (the default), the page will send keywords for all bidders to your ad server. The ad server can then make the decision on which bidder will win. Some ad servers, such as Google Ad Manager, can then generate reporting on historical bid prices from all bidders.
-
-However, there will be a set of ad server targeting values for each bidder, so if you run many bidders this could cause an issue with how much data is being sent to the ad server.
-
-There are several ways to address the issue of sending too much data to the ad server:
-
-1. Set `enableSendAllBids` to **false**. This will minimize the number of targeting variables sent to the ad server; only the top bid will be sent.
-1. Define the `auctionKeyMaxChars` setting. This allows you to establish a limit on the number of bytes sent to the ad server. See [targetingControls](#setConfig-targetingControls) for more details.
-1. Set `enableSendAllBids` to **false** and `targetingControls.alwaysIncludeDeals` to **true**. This will send the top bid and any deals.
-1. Set `enableSendAllBids` to **false**, `targetingControls.alwaysIncludeDeals` to **true**, and `auctionKeyMaxChars`. This will send the top bid and any deals up to the maximum number of characters.
-
-Note that targeting config must be set before either `pbjs.setTargetingForGPTAsync()` or `pbjs.getAdserverTargeting()` is called.
-
-##### Example results where enableSendAllBids is true
-
-{% highlight bash %}
-{
- "hb_adid_audienceNetw": "1663076dadb443d",
- "hb_pb_audienceNetwor": "9.00",
- "hb_size_audienceNetw": "300x250",
- "hb_format_audienceNe": "banner",
- "hb_source_audienceNe": "client",
- "hb_adid_rubicon": "3485968928",
- "hb_pb_rubicon": "8.00",
- "hb_size_rubicon": "300x250",
- "hb_deal_rubicon": "11111111",
- "hb_format_rubicon": "banner",
- "hb_source_rubicon": "client",
- "hb_adid_appnexus": "191f4aca0c0be8",
- "hb_pb_appnexus": "10.00",
- "hb_size_appnexus": "300x250",
- "hb_format_appnexus": "banner",
- "hb_source_appnexus": "client",
- // the winning bid is copied to attributes without a suffix
- "hb_bidder": "appnexus",
- "hb_adid": "191f4aca0c0be8",
- "hb_pb": "10.00",
- "hb_size": "300x250",
- "hb_format": "banner"
-}
-{% endhighlight %}
-
-You can see how the number of ad server targeting variable could get large
-when many bidders are present.
-
-{% capture noteAlert %}
-The Prebid recommendation is to leave `enableSendAllBids` as **true** when ad server targeting volume is not a concern. This approach is more transparent and leaves the decisioning in the ad server.
-{% endcapture %}
-
-{% include alerts/alert_note.html content=noteAlert %}
-
-##### Example of setting enableSendAllBids to false
-
-Turning off `enableSendAllBids` will cause the system to return only the
-winning bid. However, this could be a problem if you need to support [deals](/adops/deals.html), as often a deal may be chosen to win over an open market bid.
-
-To make sure that deal bids are sent along with the winning bid in the enableSendAllBids:false scenario, use the `alwaysIncludeDeals` flag that's part of [targetingControls](#setConfig-targetingControls):
-
-```javascript
-pbjs.setConfig({
- enableSendAllBids: false,
- targetingControls: {
- alwaysIncludeDeals: true
- }
-});
-```
-
-
-
-#### Configure Send Bids Control
-
-
-
-The `sendBidsControl` object passed to `pbjs.setConfig` provides the publisher with the ability to adjust the targeting behavior when [sendAllBids](#setConfig-Send-All-Bids) is enabled.
-
-{: .table .table-bordered .table-striped }
-| Attribute | Type | Description |
-|------------+---------+---------------------------------|
-| `bidLimit` | integer | The maximum number of bids the system can add to ad server targeting. |
-| `dealPrioritization` | boolean | When `true`, bids with deals are prioritized before bids without deals. |
-
-##### Details on the bidLimit setting
-
-Below is an example config containing `bidLimit`:
-
-```javascript
-pbjs.setConfig({
- sendBidsControl: {
- bidLimit: 2
- }
-});
-```
-When this property is set, the value assigned to `bidLimit` is the maximum number of bids that will be sent to the ad server. If `bidLimit` is set to 0, sendAllBids will have no maximum bid limit and *all* bids will be sent. This setting can be helpful if you know that your ad server has a finite limit to the amount of query characters it will accept and process.
-
-{: .alert.alert-info :}
-Note that this feature overlaps and can be used in conjunction with [targetingControls.auctionKeyMaxChars](/dev-docs/publisher-api-reference.html#setConfig-targetingControls). Please see that section for tips on controlling the number of characters being sent to the ad server.
-
-#### Use Bid Cache
-
-
-
-Prebid.js currently allows for [caching and reusing bids in a very narrowly defined scope](/dev-docs/faq.html#does-prebidjs-cache-bids).
-However, if you'd like, you can disable this feature and prevent Prebid.js from using anything but the latest bids for
-a given auction.
-
-{: .alert.alert-warning :}
-This option is available in version 1.39 as true-by-default and became false-by-default as of Prebid.js 2.0. If you want to use this
-feature in 2.0 and later, you'll need to set the value to true.
-
-{% highlight js %}
-pbjs.setConfig({ useBidCache: true })
-{% endhighlight %}
-
-
-#### Bidder Order
-
-Set the order in which bidders are called:
-
-{% highlight js %}
-pbjs.setConfig({ bidderSequence: "fixed" }) /* default is "random" */
-{% endhighlight %}
-
-
-
-#### Page URL
-
-Override the Prebid.js page referrer algorithm.
-
-a{% highlight js %}
-pbjs.setConfig({ pageUrl: "https://example.com/index.html" )
-{% endhighlight %}
-
-
-
-#### Publisher Domain
-
-Set the publisher's domain where Prebid is running, for cross-domain iframe communication:
-
-{% highlight js %}
-pbjs.setConfig({ publisherDomain: "https://www.theverge.com" )
-{% endhighlight %}
-
-
-
-#### Price Granularity
-
-This configuration defines the price bucket granularity setting that will be used for the `hb_pb` keyword.
-
-{% highlight js %}
-pbjs.setConfig({ priceGranularity: "medium" })
-{% endhighlight %}
-
-Standard values:
-
-+ `"low"`: $0.50 increments, capped at $5 CPM
-+ `"medium"`: $0.10 increments, capped at $20 CPM (the default)
-+ `"high"`: $0.01 increments, capped at $20 CPM
-+ `"auto"`: Applies a sliding scale to determine granularity as shown in the [Auto Granularity](#autoGranularityBucket) table below.
-+ `"dense"`: Like `"auto"`, but the bid price granularity uses smaller increments, especially at lower CPMs. For details, see the [Dense Granularity](#denseGranularityBucket) table below.
-+ `customConfigObject`: If you pass in a custom config object (as shown in the [Custom CPM Bucket Sizing](#customCPMObject) example below), you can have much finer control over CPM bucket sizes, precision, and caps.
-
-
-
-##### Auto Granularity
-
-{: .table .table-bordered .table-striped }
-| CPM | Granularity | Example |
-|---------------------+----------------------------------+--------|
-| CPM <= $5 | $0.05 increments | $1.87 floored to $1.85 |
-| CPM <= $10 and > $5 | $0.10 increments | $5.09 floored to $5.00 |
-| CPM <= $20 and > $10 | $0.50 increments | $14.26 floored to $14.00 |
-| CPM > $20 | Caps the price bucket at $20 | $24.82 floored to $20.00 |
-
-
+### Find a method
-##### Dense Granularity
+
-{: .table .table-bordered .table-striped }
-| CPM | Granularity | Example |
-|------------+-------------------------------+---------|
-| CPM <= $3 | $0.01 increments | $1.87 floored to $1.87 |
-| CPM <= $8 and >$3 | $0.05 increments | $5.09 floored to $5.05 |
-| CPM <= $20 and >$8 | $0.50 increments | $14.26 floored to $14.00 |
-| CPM > $20 | Caps the price bucket at $20 | $24.82 floored to $20.00 |
-
-
-
-##### Custom CPM Bucket Sizing
-
-To set up your own custom CPM buckets, create an object like the following, and pass it into `setConfig`:
-
-```javascript
-const customConfigObject = {
- "buckets" : [{
- "precision": 2, //default is 2 if omitted - means 2.1234 rounded to 2 decimal places = 2.12
- "max" : 5,
- "increment" : 0.01 // from $0 to $5, 1-cent increments
- },
- {
- "max" : 8,
- "increment" : 0.05 // from $5 to $8, round down to the previous 5-cent increment
- },
- {
- "max" : 40,
- "increment" : 0.5 // from $8 to $40, round down to the previous 50-cent increment
- }]
-};
-
-//set custom config object
-pbjs.setConfig({
- priceGranularity: customConfigObject
-})
-```
-
-Here are the rules for CPM intervals:
-
-- `max` and `increment` must be specified
-- A range's minimum value is assumed to be the max value of the previous range. The first interval starts at a min value of 0.
-- `precision` is optional and defaults to 2
-
-{% capture warning-granularity %}
-As of Prebid.js 3.0, the 'min' parameter is no longer supported in custom granularities.
-/pbjs_demo.html?pbjs_debug=true
See [Prebid.js troubleshooting tips](/dev-docs/troubleshooting-tips.html) for more information.
+
+Turn on debugging permanently in the page:
+{% highlight js %}
+pbjs.setConfig({ debug: true });
+{% endhighlight %}
+
+{: .alert.alert-warning :}
+Note that turning on debugging for Prebid Server causes most server-side adapters to consider it a test request, meaning that they won't count on reports.
+
+
+
+#### Device Access
+
+You can prevent Prebid.js from reading or writing cookies or HTML localstorage by setting this flag:
+
+{% highlight js %}
+pbjs.setConfig({ deviceAccess: false });
+{% endhighlight %}
+
+This can be useful in GDPR, CCPA, COPPA or other privacy scenarios where a publisher has determined that header bidding should not read from or write the user's device.
+
+
+
+#### Bidder Timeouts
+
+Set a global bidder timeout:
+
+{% highlight js %}
+pbjs.setConfig({ bidderTimeout: 3000 });
+{% endhighlight %}
+
+{: .alert.alert-warning :}
+**Bid Timeouts and JavaScript Timers**
+Note that it's possible for the timeout to be triggered later than expected, leading to a bid participating in the auction later than expected. This is due to how [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout) works in JS: it queues the callback in the event loop in an approximate location that *should* execute after this time but *it is not guaranteed*.
+With a busy page load, bids can be included in the auction even if the time to respond is greater than the timeout set by Prebid.js. However, we do close the auction immediately if the threshold is greater than 200ms, so you should see a drop off after that period.
+For more information about the asynchronous event loop and `setTimeout`, see [How JavaScript Timers Work](https://johnresig.com/blog/how-javascript-timers-work/).
+
+#### Max Requests Per Origin
+
+
+
+Since browsers have a limit of how many requests they will allow to a specific domain before they block, Prebid.js
+will queue auctions that would cause requests to a specific origin to exceed that limit. The limit is different
+for each browser. Prebid.js defaults to a max of `4` requests per origin. That value can be configured with
+`maxRequestsPerOrigin`.
+
+{% highlight js %}
+// most browsers allow at least 6 requests, but your results may vary for your user base. Sometimes using all
+// `6` requests can impact performance negatively for users with poor internet connections.
+pbjs.setConfig({ maxRequestsPerOrigin: 6 });
+
+// to emulate pre 1-x behavior and have all auctions queue (no concurrent auctions), you can set it to `1`.
+pbjs.setConfig({ maxRequestsPerOrigin: 1 });
+{% endhighlight %}
+
+#### Disable Ajax Timeout
+
+
+
+Prebid core adds a timeout on XMLHttpRequest request to terminate the request once auction is timedout. Since Prebid is ignoring all the bids after timeout it does not make sense to continue the request after timeout. However, you have the option to disable this by using `disableAjaxTimeout`.
+
+{% highlight js %}
+pbjs.setConfig({ disableAjaxTimeout: true });
+{% endhighlight %}
+
+#### Set Timeout Buffer
+
+
+
+Prebid core adds a timeout buffer to extend the time that bidders have to return a bid after the auction closes. This buffer is used to offset the "time slippage" of the setTimeout behavior in browsers. Prebid.js sets the default value to 400ms. You can change this value by setting `timeoutBuffer` to the amount of time you want to use. The following example sets the buffer to 300ms.
+
+{% highlight js %}
+pbjs.setConfig({ timeoutBuffer: 300 });
+{% endhighlight %}
+
+#### Send All Bids
+
+
+
+When enableSendAllBids is **true** (the default), the page will send keywords for all bidders to your ad server. The ad server can then make the decision on which bidder will win. Some ad servers, such as Google Ad Manager, can then generate reporting on historical bid prices from all bidders.
+
+However, there will be a set of ad server targeting values for each bidder, so if you run many bidders this could cause an issue with how much data is being sent to the ad server.
+
+There are several ways to address the issue of sending too much data to the ad server:
+
+1. Set `enableSendAllBids` to **false**. This will minimize the number of targeting variables sent to the ad server; only the top bid will be sent.
+1. Define the `auctionKeyMaxChars` setting. This allows you to establish a limit on the number of bytes sent to the ad server. See [targetingControls](#setConfig-targetingControls) for more details.
+1. Set `enableSendAllBids` to **false** and `targetingControls.alwaysIncludeDeals` to **true**. This will send the top bid and any deals.
+1. Set `enableSendAllBids` to **false**, `targetingControls.alwaysIncludeDeals` to **true**, and `auctionKeyMaxChars`. This will send the top bid and any deals up to the maximum number of characters.
+
+Note that targeting config must be set before either `pbjs.setTargetingForGPTAsync()` or `pbjs.getAdserverTargeting()` is called.
+
+##### Example results where enableSendAllBids is true
+
+{% highlight bash %}
+{
+ "hb_adid_audienceNetw": "1663076dadb443d",
+ "hb_pb_audienceNetwor": "9.00",
+ "hb_size_audienceNetw": "300x250",
+ "hb_format_audienceNe": "banner",
+ "hb_source_audienceNe": "client",
+ "hb_adid_rubicon": "3485968928",
+ "hb_pb_rubicon": "8.00",
+ "hb_size_rubicon": "300x250",
+ "hb_deal_rubicon": "11111111",
+ "hb_format_rubicon": "banner",
+ "hb_source_rubicon": "client",
+ "hb_adid_appnexus": "191f4aca0c0be8",
+ "hb_pb_appnexus": "10.00",
+ "hb_size_appnexus": "300x250",
+ "hb_format_appnexus": "banner",
+ "hb_source_appnexus": "client",
+ // the winning bid is copied to attributes without a suffix
+ "hb_bidder": "appnexus",
+ "hb_adid": "191f4aca0c0be8",
+ "hb_pb": "10.00",
+ "hb_size": "300x250",
+ "hb_format": "banner"
+}
+{% endhighlight %}
+
+You can see how the number of ad server targeting variable could get large
+when many bidders are present.
+
+{% capture noteAlert %}
+The Prebid recommendation is to leave `enableSendAllBids` as **true** when ad server targeting volume is not a concern. This approach is more transparent and leaves the decisioning in the ad server.
+{% endcapture %}
+
+{% include alerts/alert_note.html content=noteAlert %}
+
+##### Example of setting enableSendAllBids to false
+
+Turning off `enableSendAllBids` will cause the system to return only the
+winning bid. However, this could be a problem if you need to support [deals](/adops/deals.html), as often a deal may be chosen to win over an open market bid.
+
+To make sure that deal bids are sent along with the winning bid in the enableSendAllBids:false scenario, use the `alwaysIncludeDeals` flag that's part of [targetingControls](#setConfig-targetingControls):
+
+```javascript
+pbjs.setConfig({
+ enableSendAllBids: false,
+ targetingControls: {
+ alwaysIncludeDeals: true
+ }
+});
+```
+
+
+
+#### Configure Send Bids Control
+
+
+
+The `sendBidsControl` object passed to `pbjs.setConfig` provides the publisher with the ability to adjust the targeting behavior when [sendAllBids](#setConfig-Send-All-Bids) is enabled.
+
+{: .table .table-bordered .table-striped }
+| Attribute | Type | Description |
+|------------+---------+---------------------------------|
+| `bidLimit` | integer | The maximum number of bids the system can add to ad server targeting. |
+| `dealPrioritization` | boolean | When `true`, bids with deals are prioritized before bids without deals. |
+
+##### Details on the bidLimit setting
+
+Below is an example config containing `bidLimit`:
+
+```javascript
+pbjs.setConfig({
+ sendBidsControl: {
+ bidLimit: 2
+ }
+});
+```
+When this property is set, the value assigned to `bidLimit` is the maximum number of bids that will be sent to the ad server. If `bidLimit` is set to 0, sendAllBids will have no maximum bid limit and *all* bids will be sent. This setting can be helpful if you know that your ad server has a finite limit to the amount of query characters it will accept and process.
+
+{: .alert.alert-info :}
+Note that this feature overlaps and can be used in conjunction with [targetingControls.auctionKeyMaxChars](/dev-docs/publisher-api-reference.html#setConfig-targetingControls). Please see that section for tips on controlling the number of characters being sent to the ad server.
+
+#### Use Bid Cache
+
+
+
+Prebid.js currently allows for [caching and reusing bids in a very narrowly defined scope](/dev-docs/faq.html#does-prebidjs-cache-bids).
+However, if you'd like, you can disable this feature and prevent Prebid.js from using anything but the latest bids for
+a given auction.
+
+{: .alert.alert-warning :}
+This option is available in version 1.39 as true-by-default and became false-by-default as of Prebid.js 2.0. If you want to use this
+feature in 2.0 and later, you'll need to set the value to true.
+
+{% highlight js %}
+pbjs.setConfig({ useBidCache: true })
+{% endhighlight %}
+
+
+#### Bidder Order
+
+Set the order in which bidders are called:
+
+{% highlight js %}
+pbjs.setConfig({ bidderSequence: "fixed" }) /* default is "random" */
+{% endhighlight %}
+
+
+
+#### Page URL
+
+Override the Prebid.js page referrer algorithm.
+
+a{% highlight js %}
+pbjs.setConfig({ pageUrl: "https://example.com/index.html" )
+{% endhighlight %}
+
+
+
+#### Publisher Domain
+
+Set the publisher's domain where Prebid is running, for cross-domain iframe communication:
+
+{% highlight js %}
+pbjs.setConfig({ publisherDomain: "https://www.theverge.com" )
+{% endhighlight %}
+
+
+
+#### Price Granularity
+
+This configuration defines the price bucket granularity setting that will be used for the `hb_pb` keyword.
+
+{% highlight js %}
+pbjs.setConfig({ priceGranularity: "medium" })
+{% endhighlight %}
+
+Standard values:
+
++ `"low"`: $0.50 increments, capped at $5 CPM
++ `"medium"`: $0.10 increments, capped at $20 CPM (the default)
++ `"high"`: $0.01 increments, capped at $20 CPM
++ `"auto"`: Applies a sliding scale to determine granularity as shown in the [Auto Granularity](#autoGranularityBucket) table below.
++ `"dense"`: Like `"auto"`, but the bid price granularity uses smaller increments, especially at lower CPMs. For details, see the [Dense Granularity](#denseGranularityBucket) table below.
++ `customConfigObject`: If you pass in a custom config object (as shown in the [Custom CPM Bucket Sizing](#customCPMObject) example below), you can have much finer control over CPM bucket sizes, precision, and caps.
+
+
+
+##### Auto Granularity
+
+{: .table .table-bordered .table-striped }
+| CPM | Granularity | Example |
+|---------------------+----------------------------------+--------|
+| CPM <= $5 | $0.05 increments | $1.87 floored to $1.85 |
+| CPM <= $10 and > $5 | $0.10 increments | $5.09 floored to $5.00 |
+| CPM <= $20 and > $10 | $0.50 increments | $14.26 floored to $14.00 |
+| CPM > $20 | Caps the price bucket at $20 | $24.82 floored to $20.00 |
+
+
+
+##### Dense Granularity
+
+{: .table .table-bordered .table-striped }
+| CPM | Granularity | Example |
+|------------+-------------------------------+---------|
+| CPM <= $3 | $0.01 increments | $1.87 floored to $1.87 |
+| CPM <= $8 and >$3 | $0.05 increments | $5.09 floored to $5.05 |
+| CPM <= $20 and >$8 | $0.50 increments | $14.26 floored to $14.00 |
+| CPM > $20 | Caps the price bucket at $20 | $24.82 floored to $20.00 |
+
+
+
+##### Custom CPM Bucket Sizing
+
+To set up your own custom CPM buckets, create an object like the following, and pass it into `setConfig`:
+
+```javascript
+const customConfigObject = {
+ "buckets" : [{
+ "precision": 2, //default is 2 if omitted - means 2.1234 rounded to 2 decimal places = 2.12
+ "max" : 5,
+ "increment" : 0.01 // from $0 to $5, 1-cent increments
+ },
+ {
+ "max" : 8,
+ "increment" : 0.05 // from $5 to $8, round down to the previous 5-cent increment
+ },
+ {
+ "max" : 40,
+ "increment" : 0.5 // from $8 to $40, round down to the previous 50-cent increment
+ }]
+};
+
+//set custom config object
+pbjs.setConfig({
+ priceGranularity: customConfigObject
+})
+```
+
+Here are the rules for CPM intervals:
+
+- `max` and `increment` must be specified
+- A range's minimum value is assumed to be the max value of the previous range. The first interval starts at a min value of 0.
+- `precision` is optional and defaults to 2
+
+{% capture warning-granularity %}
+As of Prebid.js 3.0, the 'min' parameter is no longer supported in custom granularities.
+