Page tree




This documentation is also available at prebid.org.

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 are 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.

Bidder Code

  • pubmatic

"Send All Bids" Ad Server Keys

  • hb_pb_pubmatic
  • hb_adid_pubmatic
  • hb_size_pubmatic

"Default Deal ID" Ad Server Key

  • hb_deal_pubmatic

Bid Params

NameScopeSupported Client-SideSupported S2SDescriptionExample
publisherIdrequiredPublisher ID“32572”
adSlotrequiredAd Unit ID“38519891@300x250”
pmzoneidoptional
Zone ID“zone1,zone2”
latoptional
Latitude“40.712775”
lonoptional
Longitude“-74.005973”
yoboptional
Year of Birth“1982”
genderoptional
Gender“M”
kadpageurloptional
Overrides Page URLhttp://www.yahoo.com/”
kadflooroptional
Bid Floor“1.75”
dctroptionalUp to Prebid v0.34
Deal Custom Targeting"company=pubmatic|place=pune,banglore"


Configuration

PubMatic recommends the UserSync configuration below. Without it, the PubMatic adapter will not be able to perform user syncs, which will lower match rate and reduce 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']
    }
});‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
Combine the above configuration with any other UserSync configuration. Multiple setConfig() calls overwrite each other and only the last call for a given attribute takes effect.

Video Specific Parameters 

The PubMatic client-side adapter supports video as of Prebid 1.16.0

NameScopeDescriptionExample
video.mimesrequiredVideo MIME types['video/mp4','application/javascript']
video.skippableoptionalIf ‘true’, user can skip adtrue
video.mindurationoptionalMinimum ad duration in seconds5
video.maxdurationoptionalMaximum ad duration in seconds30
video.startdelayoptionalStart delay in seconds for pre-roll, mid-roll, or post-roll ad placements. See OpenRTB 2.5 specification, List 5.12 for values0
video.playbackmethodoptionalDefines 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
[2,3]
video.apioptionalAPI frameworks supported
Values:
1 = VPAID 1.0
2 = VPAID 2.0
3 = MRAID-1
4 = ORMMA
5 = MRAID-2
[1,2]
video.protocolsoptionalSupported 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.woptionalVideo player width in pixels. The "playerSize" value in the mediaTypes video configuration will take precedence and override this parameter.640
video.hoptionalVideo player height in pixels. The "playerSize" value in the mediaTypes video configuration will take precedence and override this parameter.480
video.battroptionalBlocked creative attributes, See OpenRTB 2.5 specification, List 5.3 for values[3, 9]
video.linearityoptionalIndicates if the impression is linear or nar
Values:
1 = Linear/In-Stream
2 = Non-Linear/Overlay.
1
video.placementoptionalVideo placement type. See OpenRTB 2.5 specification, List 5.9 for values1
video.maxbitrateoptionalMaximum bit rate in Kbps1400


Sample Video Ad Unit Bidder Configuration

var videoAdUnits = [
{
    code: 'test-div-video',
    mediaTypes: {
        video: {
            playerSize: [640, 480],           // required
            context: 'instream'
        }
    },
    bids: [{
      bidder: 'pubmatic',
      params: {
        publisherId: "156209",
        adSlot: "pubmatic_video1@640x480", // maps to imp.tagid in request
        video: {
          skippable: true,
          minduration: 1,
          maxduration: 30,
          mimes: ['video/mp4', 'video/webm', 'application/javascript', ' video/ogg'],
          api: [2],
          startdelay: 0,
          playbackmethod: [2],
          protocols: [2, 3, 5, 6],
          w: 640,
          h: 480,
          linearity: 1,
          placement: 1
      }
    }
  }]
}]

Configuration for video

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

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


⇧ Top