Configure Protected Audience API for Prebid.js versions 8.37.0 and up to 9.0.0

Info: Starting in June 2025, Index is pausing support for the Protected Audience API. After this date, you will no longer receive Protected Audience API demand from Index, even if your inventory is configured to be eligible for it.

Before you begin: You must be using Google Ad Manager as your publisher The owner of a website or app where advertisements are served. ad server A platform that manages, stores, and delivers advertisements to a publisher's site..

To receive Protected Audience API auction demand, complete the following steps:

  1. In Google Ad Manager, click Admin, then Global settings, and under Ad preference settings, make sure that the following settings are enabled:
    • Protected Audience API
    • Allow testing on up to 100% of my inventory with non-Google sellers, regardless of performance impact
      screenshot showing the protected audience api options
    • For more information about these settings, see Google’s documentation on Protected Audience API and Ad Manager.

  2. Build the PAAPI module in your Prebid.js An open-source library for publishers to implement header bidding on their websites and manage multiple header bidding partners. configuration by adding fledgeForGpt to the list of modules that you are already using. When you add the fledgeForGpt module, the paapi module automatically gets included as a sub-module. For more information about the paapi module, see Prebid’s PAAPI module documentation.
  3. Note: The fledgeForGpt module documentation no longer exists on Prebid's site. You can however refer to Prebid's Protected Audience API (PAAPI) for GPT Module documentation for information on adding module configurations.

  4. Complete the following steps to make your ad units eligible for Protected Audience API demand:
    1. In the pbjs.setConfig().paapi field, set the defaultForSlots parameter to 1:

      pbjs.que.push(function() {
      	pbjs.setConfig({
      		paapi: {
      			enabled: true,
      			defaultForSlots: 1
      			bidders: ['ix', /* any other bidders */],
      		});
      }); 

    2. In the paapi.gpt.autoconfig field, set autoconfig to false. This step is important because, by default, the fledgeForGpt module expects the Google Publisher Tag (GPT Google Publisher Tag (GPT). An ad tagging library for Google Ad Manager (GAM) which is used to dynamically build ad requests. It takes key details from a publisher, such as ad unit code, ad size, and custom targeting, builds the request, and displays the ad on web pages.) ad units to be loaded before the Protected Audience configuration is added to the ad unit. Setting autoconfig to false will avoid any race conditions resulting from asynchronous libraries being loaded out of order, which would prevent the ad unit from being properly configured for Protected Audience API.

      The following code is an example of the autoconfig configuration:

      pbjs.que.push(function() {
      	pbjs.setConfig({
      		paapi: {
      			enabled: true,
      			defaultForSlots: 1  
      			gpt: { 
      				autoconfig: false 
      			}, 
      			bidders: ['ix', /* any other bidders */],  
      		});  
      });
    3. In the pbjs.requestBids.bidsBackHandler function, call the pbjs.setPAAPIConfigForGPT() function.

      Note: When calling the pbjs.setPAAPIConfigForGPT(); function, make sure that you check the following:

      • The function must be called in the bidsBackHandler each time new bids are requested (for example when refreshing adSlots). This is important because, when autoconfig is disabled, the auctionConfig needs to be associated with a GPT ad unit manually by calling pbjs.setPAAPIConfigForGPT().
      • The function must be called before the pbjs.setTargetingForGPTAsync() function. This is important because the Protected Audience configuration needs to be associated with a GPT ad unit before the Google Ad Manager call is executed.

      The following code is an example of the configuration made in the bidsBackHandler:

      pbjs.requestBids({, ,  
        // ... 
        bidsBackHandler: function(bids, timedOut, auctionId) {  
           pbjs.setPAAPIConfigForGPT(); 
           pbjs.setTargetingForGPTAsync(); 
           // ... 
        } 
      }) 

      For examples on bid requests and responses that include the Protected Audience API fields, see Examples of OpenRTB bid requests and responses.