Overview

PrebidJS for Web is an open-source Javascript library and community which allows publishers to implement Header Bidding.

The PrebidJS library and a configuration is usually placed in the header of a web site and will work with an existing ad server such as Google Ad Manager, AppNexus, and others.

This specific page contains brief information on how to get started with Prebid using our demand.

Quick Start Guide

  1. Download PrebidJS

  2. Select the latest version of Prebid to maximize revenue (5.17.0 or higher)

  3. Check the box for ‘Sharethrough’

  4. Enter your e-mail address and a built Prebid library will be emailed to you with our adapter included

  5. This Prebid library may then be added to your web page making Prebid functions and methods available for use, we recommend using a test page to configure Prebid before going live in Production.

  6. Push Price Priority Line Items to your publisher adserver (for instance GAM for those using Google’s adserver) using the defined price granularity and setup specific for that adserver.

    1. This Python project does a good job for users semi-familiar with the Ad Manager API and Python

    2. Use the key-values 'sharethrough' per the bidder parameters documentation from Prebid.

  7. Configure the ad units for which you want the sharethrough bidder to return bid responses. Sharethrough supports both banner and video impression requests as of version 5.17.0 or higher.
    See the general Prebid documentation for adunit configuration for reference.

  8. For each ad unit (banner or native), the potential parameters (marked required and optional as relevant) are:

{
  bidder: "sharethrough",
  params: {
    // REQUIRED - The placement key as defined in the STR publisher platform
    pkey: 'LuB3vxGGFrBZJa6tifXW4xgK',

    // OPTIONAL - Blocked Advertiser Domains
    badv: ['domain1.com', 'domain2.com'],

    // OPTIONAL - Blocked Categories (IAB codes)
    bcat: ['IAB1-1', 'IAB1-2'],

    // OPTIONAL - default bid floor, if not specified in bid request (USD)
    floor: 0.1,
  }
}

9. A complete setup for a banner ad unit may look like the following:

var bannerAdUnits = [{
  code: <your ad unit code>, // Example of GPT Ad unit ID
  mediaTypes: {
      banner: {
          sizes: [[300, 250], [300, 600]] // all sizes supported by this ad unit
          pos: 4 // position of the ad unit on page, list of supported values below
      }
  },
  bids: [
    {
      bidder: 'sharethrough',
      params: {
        pkey: 'enter-your-pkey-here'
      }
    },
    {
      bidder: 'another_bidder',
      params: {
        param: 'placement_id'
      }
    }
  ]
}];

10. A complete setup for a video ad unit may look like the following:

var videoAdUnits = [{
  code: 'test-div-video',
  mediaTypes: {
      video: {
        context: 'instream', // 'instream' or 'outstream'
        placement: 1,
        delivery: 1,
        companiontype: 'companion type',
        companionad: 'companion ad',
        // default values shown below this point
        pos: 0,
        skip: 0,
        linearity: 1,
        minduration: 5,
        maxduration: 60,
        playbackmethod: [2],
        api: [2],
        mimes: ['video/mp4'],
        protocols: [2, 3, 5, 6, 7, 8],
        playerSize: [640, 360],
        startdelay: 0,
        skipmin: 0,
        skipafter: 0,
      },
  },
  bids: [
    {
      bidder: 'sharethrough',
      params: {
          pkey: 'pkey1'           
      },
    {
      bidder: 'another_bidder',
      params: {
        param: 'placement_id'
      }
  ]
}]

11. After configuring your bid array, Sharethrough should start immediately competing in your header bidding auction. Be sure to add Sharethrough to your ads.txt file.

12. Note that the Sharethrough adapter does NOT support multiple formats (banner, video) for the same placement key.
13. Sharethrough adapter does NOT support mediaType of native.
14. For the default values specified for the mediaType of video, if they are specified, they will override the default values shown here. If the default values are fine, no specification of a value at the ad unit level is necessary.

Best Practices

Before implementing any Prebid demand on your pages we recommend some best practices to ensure the maximum benefit is provided to your bottom line while not impacting users.

Adapter Details

Sharethrough

End Point

Request and Response Attributes

Supported mediaTypes

Default Ad Server Key Value

Prebid Modules

For publishers on Prebid version 5 and above, current Prebid modules support include:

Additional Notes on STR Adapter

For publishers on Prebid version 5 and above,

Configuring Prebid with GPID

The Global Placement ID (GPID) was an initiative in the Fall of 2021 led by the TradeDesk to solve the problem of inventory identification in an industry-wide way. i.e. Buyers want to be able to identify ad slots in a unique way even when the publisher uses the same ad slot name multiple times.

The suggestion for GPID is to simply append the HTML div element id (aka the ‘div-id’) to the ad slot name. But some publishers generate div-ids randomly, so the definition of GPID has become:

imp[].ext.gpid: ADSLOTNAME#UNIQUIFIER

Example:

pbjs.addAdUnits({
    code: '/1111/homepage-leftnav',
    ortb2Imp: {
        ext: {
            gpid: "/1111/homepage-leftnav",
	    data: {
                pbadslot: "/1111/homepage-leftnav"
            }
        }
    },
    mediaTypes: ...
    bids: ...
});

Additional information on defining GPID can be found here: https://dev.prebid.org/features/pbadslot.