PubMatic

Features

Bidder CodepubmaticPrebid.org Memberyes
Media Typesdisplay, video, nativeGDPR Supportyes
User IDsunifiedId/tradedeskCOPPA Supportno

"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_pubmatichb_bidder_pubmatichb_adid_pubmatic
hb_size_pubmatichb_source_pubmatichb_format_pubmatic
hb_cache_host_pubmathb_cache_id_pubmatichb_uuid_pubmatic

"Deal ID" Ad Server Key

hb_deal_pubmatic

Prebid Server Note:

Before configuring the PubMatic adapter as S2S, you must reach out to the PubMatic team for approval and setup steps.

Prebid 1.0 Upgrade Note:

If you upgrading from a Prebid version prior to 1.0, please reach out to your PubMatic Customer Success Manager prior to your upgrade. Publisher accounts need new settings to function correctly with the PubMatic Prebid 1.0 adapter and your Customer Success Manager will ensure your account is setup correctly.

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 '40.712775' string
lon optional Longitude '-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 'AUD' (Value configured only in the 1st adunit will be passed on.
Values if present in subsequent adunits, will be ignored.)
string
dctr optional Deal Custom Targeting
(Value configured only in the 1st adunit will be passed on.
Values if present in subsequent adunits, will be ignored.)
'key1=123|key2=345' string
bcat optional Blocked IAB Categories
(Values from all slots will be combined and only unique values will be passed. An array of strings only. Each category should be a string of a length of more than 3 characters.)
[ 'IAB1-5', 'IAB1-6', 'IAB1-7' ] array of strings

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.

For Prebid.js v1.15.0 and later:

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

For Prebid.js v1.14.0 and before:

pbjs.setConfig({
   userSync: {
    iframeEnabled: true,
    enabledBidders: ['pubmatic']
 }});

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'

Support and behavior differs by Prebid.js version

Prebid.js v2.13.0 and later:

adSlot parameter is now 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. If you are using Prebid Server, Prebid Server v0.69.0 or higher (Go version) or v1.18.0 or higher (Java version) is required to use Without Size. If you are using a managed service provider for Prebid Server, consult the provider to find out which version of Prebid Server they are using. All options will send the ad request with all sizes specified in the Prebid ad unit configuration.

Prebid.js v2.9.0 to v2.12.0:

Both formats are supported. Without Size is the recommended option. If you are using Prebid Server, Prebid Server v0.69.0 or higher (Go version) or v1.18.0 or higher (Java version) is required to use Without Size. If you are using a managed service provider for Prebid Server, consult the provider to find out which version of Prebid Server they are using. Both formats will send the ad request with all sizes specified in the Prebid ad unit configuration.

Prebid.js v1.1.18 to v2.8.0:

Both formats are supported. Without Size is the recommended option. If you are using Prebid Server, Prebid Server v0.69.0 or higher (Go version) or v1.18.0 or higher (Java version) is required to use Without Size. If you are using a managed service provider for Prebid Server, consult the provider to find out which version of Prebid Server they are using. Without Size will send the ad request with all sizes specified in the Prebid ad unit configuration. With Size will only request the specified size. Mutli-sized ad units are not supported when using Prebid Server.

Prebid.js v1.1.17 and earlier:

Only With Size is supported. To support multi-size ad units, list the PubMatic bidder entry multiple times, once for each size. Mutli-sized ad units are not supported when using Prebid Server.

video parameters

The PubMatic adapter supports video as of Prebid 1.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.minbitrate optional Minumim 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'
        }
    },
    bids: [{
      bidder: 'pubmatic',
      params: {
        publisherId: '32572',                     // required
        adSlot: '38519891@300x250',              // required
        video: {
          mimes: ['video/mp4','video/x-flv'],   // required
          skippable: true,                      // 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
          minbitrate: 10,                       // optional
          maxbitrate: 10                        // optional
        }
      }
    }]
}]

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'
    }
});