This module allows configured bidders to pass more than one bid per AdUnit through to the ad server.
Without this module, bidders can place multiple bids on the bid cache, but only the highest bid will be considered for sending to the ad server.
There are two specific actions enabled by this module:
1) It tells bidders how many bids will be considered. If useBidCache is on, more than one bid response per adapter can be registered. (Note that this is the case even without this module, but bid adapters might not know they can supply extra bids without the multibid
config.)
2) It expands the number of ad server targeting values that can go to the ad server.
Here’s an example configuration:
pbjs.setConfig({
multibid: [{
bidder: "bidderA",
// bidderA can supply up to two bids
maxBids: 2,
// the second bid will go to the ad server as hb_pb_bidA2
targetBiddercodePrefix: "bidA"
},{
bidder: "bidderB",
// bidderB can supply up to three bids
maxBids: 3,
// additional bids will be passed as hb_pb_bidB2 and hb_pb_bidB3
targetBiddercodePrefix: "bidB"
},{
bidders: ["bidderC","bidderD"]
maxBids: 3
// don't send extra bids to ad server, just cache good ones
}]
});
MultiBid configuration takes these parameters:
Param | Required? | Type | Description | Example |
---|---|---|---|---|
bidder | Yes, unless bidders is specified | string | A biddercode | 'bidderA' |
bidders | Yes, unless bidder is specified | array of strings | Multiple biddercodes | ['bidderB','bidderC'] |
maxBids | Yes | integer | The number of bids the named bidder(s) can supply. Max of 9. | 2 |
targetBiddercodePrefix | No | string | An alternate (short) bidder code to send to the ad server. A number will be appended, starting from 2, e.g. hb_pb_PREFIX2. If not provided, the extra bids will not go to the ad server. | 'bidA' |
Note: Some bid adapters normally return more than one bid response per AdUnit. These
bids are available to the useBidCache
scenario even without this module.
If those bidders are mentioned in the multibid
config, the additional bids will
become subject to the maxBids
limit.
The MultiBid module is not included with Prebid.js by default. To get this behavior, you must include the module in the build:
gulp build --modules=multibid,exampleBidAdapter
Publishers don’t need to set up more line items in the ad server unless they want to optimize a scenario where the primary bid might not match special targeting. Example scenarios include:
Bid adapters can check the bidRequest.bidLimit value to see if they’re going to be allowed to provide more than one bid response.
When they are allowed to do so, just add another bid response object to the
array returned from the interpretResponse
function.