Back to Bidders

PubMatic

Features

Bidder Code pubmatic Prebid.org Member yes
Prebid.js Adapter yes Prebid Server Adapter yes
Media Types display, video, native Multi Format Support will-bid-on-one
TCF-EU Support yes IAB GVL ID 76
GPP Support some (check with bidder) DSA Support check with bidder
USP/CCPA Support yes COPPA Support yes
Supply Chain Support yes Demand Chain Support yes
Safeframes OK yes Supports Deals check with bidder
Floors Module Support yes First Party Data Support yes
Endpoint Compression yes ORTB Blocking Support yes
User IDs all Privacy Sandbox check with bidder
Prebid Server App Support yes

Bid Params

Name Scope Description Example Type
publisherId required Publisher ID '32572' string
adSlot optional Ad Slot Name (see below) '38519891' string
pmzoneid optional Zone ID 'zone1,zone2' string
lat optional Latitude
Supported until Prebid version 7.54.4 and starting from version 8.11.0, can be configured using ortb2.device or ortb2.user
'40.712775' string
lon optional Longitude
Supported until Prebid version 7.54.4 and starting from version 8.11.0, can be configured using ortb2.device or ortb2.user
'-74.005973' string
yob optional Year of Birth '1982' string
gender optional Gender 'M' string
kadpageurl optional Overrides Page URL 'http://www.yahoo.com/' string
kadfloor optional Bid Floor '1.75' string
currency optional Bid currency
(Value configured only in the 1st adunit will be passed on. Values if present in subsequent adunits, will be ignored.)
'AUD' string
dctr optional Deal Custom Targeting
(Value configured in each adunit will be passed inside adunit configs i.e., imp.ext)
'key1=123\|key2=345' string
acat optional Allowed categories
(Can be sent via ortb2 or slot-level params. If both are present, ortb2 takes priority.)
[ 'IAB1-5', 'IAB1-6', 'IAB1-7' ] array of strings
bcat optional Blocked IAB Categories
(Combined across all slots, unique values only. Each must be a string with more than 3 characters.)
[ 'IAB1-5', 'IAB1-6', 'IAB1-7' ] array of strings
deals optional PMP deals
(Passed per slot. Each deal-id should be a string with more than 3 characters.)
[ 'deal-id-5', 'deal-id-6', 'deal-id-7' ] array of strings
outstreamAU optional Outstream AdUnit described in Blue BillyWig UI (Required if mimeType is video and context is outstream) 'renderer_test_pubmatic' string

Configuration

PubMatic recommends the UserSync configuration below. Without it, the PubMatic adapter will not able to perform user syncs, which lowers match rate and reduces monetization.

pbjs.setConfig({
  userSync: {
    filterSettings: {
      iframe: {
        bidders: '*',      // '*' represents all bidders
        filter: 'include'
      }
    }
  }
});

Note: Combine the above the configuration with any other UserSync configuration. Multiple setConfig() calls overwrite each other and only last call for a given attribute will take effect.

adSlot Specification and Multi-Size Ad Units

The adSlot parameter supports two different formats:

Format Example
Without Size '38519891'
With Size '38519891@300x205'

adSlot parameter is optional. To omit the adSlot parameter, your publisher account must have default site and tag enabled. Consult your account manager to find out if default site and tag is enabled on your account. If used, both formats are supported. Without Size is the recommended option. Both options will send the ad request with all sizes specified in the Prebid ad unit configuration.

video parameters

The PubMatic adapter supports video as of Prebid v1.16.0

Name Scope Description Example
video.mimes required Video MIME types ['video/mp4','video/x-flv']
video.skippable optional If ‘true’, user can skip ad true
video.minduration optional Minimum ad duration in seconds 5
video.maxduration optional Maximum ad duration in seconds 30
video.startdelay optional Start delay in seconds for pre-roll, mid-roll, or post-roll ad placements 5
video.playbackmethod optional Defines whether inventory is user-initiated or autoplay sound on/off
Values:
1: Auto-play, sound on
2: Auto-play, sound off
3: Click-to-play
4: mouse-over
1
video.api optional API frameworks supported
Values:
1: VPAID 1.0
2: VPAID 2.0
3: MRAID-1
4: ORMMA
5: MRAID-2
[1, 2]
video.protocols optional Supported video bid response protocols
Values
1: VAST 1.0
2: VAST 2.0
3: VAST 3.0
4: VAST 1.0 Wrapper
5: VAST 2.0 Wrapper
6: VAST 3.0 Wrapper
[5, 6]
video.battr optional Blocked creative attributes, See OpenRTB 2.5 specification, List 5.3 for values [3, 9]
video.linearity optional Indicates if the impression is linear or nonlinear
Values:
1: Linear/In-Stream
2: Non-Linear/Overlay.
1
video.placement optional Video placement type. See OpenRTB 2.5 specification, List 5.9 for Values 1
video.plcmt optional Video placement type. See OpenRTB 2.6 specification - github, For values plcmt subtypes 1
video.minbitrate optional Minimum bit rate in Kbps. 50
video.maxbitrate optional Maximum bit rate in Kbps. 70

AdUnit Format for Video

var videoAdUnits = [
{
    code: 'test-div-video',
    mediaTypes: {
        video: {
            playerSize: [640, 480],           // required
            context: 'instream',
            mimes: ['video/mp4','video/x-flv'],   // required
            skip: 1,                              // optional
            minduration: 5,                       // optional
            maxduration: 30,                      // optional
            startdelay: 5,                        // optional
            playbackmethod: [1,3],                // optional
            api: [ 1, 2 ],                        // optional
            protocols: [ 2, 3 ],                  // optional
            battr: [ 13, 14 ],                    // optional
            linearity: 1,                         // optional            
            placement: 2,                         // optional
            plcmt: 1,                             // optional
            minbitrate: 10,                       // optional
            maxbitrate: 10                        // optional
        }
    },
    bids: [{
      bidder: 'pubmatic',
      params: {
        publisherId: '32572',                     // required
        adSlot: '38519891@300x250'                // required
      }
    }]
}]

AdUnit Format for Native

var adUnits = [
{
    code: 'test-div',    
    mediaTypes: {
       native: {
            image: {
                required: true,
                sizes: [150, 50]
            },
            title: {
                required: true,
                len: 80
            },
            sponsoredBy: {
                required: true
            },
            body: {
                required: true
            }
        }
    },
    bids: [{
      bidder: 'pubmatic',
      params: {
        publisherId: '156295',               // required
        adSlot: 'pubmatic_test2@1x1',       // required
      }
    }]
}];

Configuration for video

For Video ads, prebid cache needs to be enabled for PubMatic adapter.

pbjs.setConfig({
    cache: {
        url: 'https://prebid.adnxs.com/pbc/v1/cache'
    }
});

Prebid Server Test Request

The following test parameters can be used to verify that Prebid Server is working properly with the PubMatic adapter. This example includes an imp object with an PubMatic test publisher ID, ad slot, and sizes that would match with the test creative.

{
"imp":[
      {
         "id":"some-impression-id",
         "banner":{
            "format":[
               {
                  "w":300,
                  "h":250
               },
               {
                  "w":300,
                  "h":600
               }
            ]
         },
         "ext":{
            "pubmatic":{
               "publisherId": "156276",
               "adSlot":"pubmatic_test"
            }
         }
      }
   ]
}

First Party Data

Publishers should use the ortb2 method of setting First Party Data. The following fields are supported:

  • ortb2.site.*
  • ortb2.user.*

AdUnit-specific data is supported using AdUnit.ortb2Imp.ext.*

Endpoint Compression

This adapter utilizes gzip compression support built into Prebid.js core. For more information, see Compression Support for Outgoing Requests

Disabling Compression

You can disable gzip compression at the bidder level using pbjs.setBidderConfig. Set the gzipEnabled value to false:

pbjs.que.push(function () {
  pbjs.setBidderConfig({
    bidders: ['pubmatic'],
    config: {
      gzipEnabled: false
    }
  });
});

"Send All Bids" Ad Server Keys

These are the bidder-specific keys that would be targeted within GAM in a Send-All-Bids scenario. GAM truncates keys to 20 characters.
hb_pb_pubmatic hb_bidder_pubmatic hb_adid_pubmatic
hb_size_pubmatic hb_source_pubmatic hb_format_pubmatic
hb_cache_host_pubmat hb_cache_id_pubmatic hb_uuid_pubmatic
hb_cache_path_pubmat hb_deal_pubmatic

Back to Bidders