This module allows Prebid.js to support PAAPI (formerly FLEDGE) by integrating with GPT’s support for component auctions.
To learn more about PAAPI in general, go here.
Note that Prebid can’t help anyone with which fields to include in auctionconfig, but you can start by looking in this section of the PAAPI documentation.
To use PAAPI with GPT:
include this module with your Prebid.js bundle; this also automatically includes the PAAPI module
gulp build --modules=paapiForGpt,...
By default, Prebid.js attempts to configure GPT slots for PAAPI at the end of each auction. This requires GPT to be loaded before the first Prebid auction is started; to avoid this requirement, or for more control in general over GPT slot configuration, you can use setPAAPIConfigForGPT
.
First, disable automatic configuration of GPT slots:
pbjs.setConfig({
paapi: {
gpt: {
autoconfig: false
}
}
})
You may then use setPAAPIConfigForGPT
, typically from a bidsBackHandler
:
pbjs.requestBids({
// ...
bidsBackHandler: function(bids, timedOut, auctionId) {
pbjs.setPAAPIConfigForGPT();
// ...
}
})
It’s important to invoke the pbjs.setPAAPIConfigForGPT()
function within the bidsBackHandler
whenever new bids are requested, such as when refreshing ad slots. This ensures that the auctionConfig is manually applied to a GPT slot when autoconfig is disabled. Without this manual configuration, GPT slots will not be properly set up to handle new bids, potentially resulting in duplicate impression calls.
See the API reference for more options.