PrebidJS

 

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:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { 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:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 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:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 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.

  • Define and Request only what will be immediately rendered.

    • In some scenarios it might be useful to define and prepare all ad slots which will ever be displayed on page.

    • However, if some ad slots are never rendered these ad requests may reduce the fill % on the page, as well as possible SPO/optimization by buyers which exclude your inventory.

  • Keep the number of ad slots to less than 4

    • To improve view-ability and user experience we recommend limiting the number of active ad slots to 4, ensuring to keep them as view-able as possible.

  • Timeouts

    • A timeout of at least 1000ms is recommended per bidder unless most of your inventory is on slow mobile connections, in which case increasing the timeout to 3000ms is recommended.

  • Define, request, and render ad slots as they near view

    • If you are lazy loading ads on long article pages we recommend defining the new ad slots, making requests, and rendering the ad as the user scrolls through content and nears the ad slot.

    • This benefits the page by minimizing the ad load and reduces resources until such a time they are required.

  • Avoid creating new ad slots when you want to refresh ads

    • We recommend using Prebid’s documented refresh functionality.

  • Keep it simple

    • Avoid wrapping Prebid functionality in classes, functions, namespaces, etc

    • If you obfuscate Prebid you may introduce additional complexity when needing to troubleshoot

  • Add User ID Modules

  • Provide position of the ad unit if possible, following Open RTB Spec:

    • 1: Above the Fold

    • 3: Below the Fold

    • 4: Header

    • 5: Footer

    • 6: Sidebar

    • 7: Full Screen

  • For Prebid.js version 6.7.0 and above, Sharethrough supports first party data, as documented in this Prebid Guide.

 

Adapter Details

Sharethrough

End Point

  • https://btlr.sharethrough.com/universal/v1?supply_id=WYu2BXv1

Request and Response Attributes

  • Calls to Sharethrough are single Request

  • Bids are returned in NET (The bid returned reflect the bid amount with rev share already taken into account; no adjustment is necessary)

  • Sharethrough is GDPR & COPPA Compliant

Supported mediaTypes

  • Banner

  • Video (instream and outstream)

Default Ad Server Key Value

  • sharethrough

Prebid Modules

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

  • Price Floors

  • Supply Chain Object

  • User ID

Additional Notes on STR Adapter

For publishers on Prebid version 5 and above,

  • TTL is 360 for display, 3600 for video (in milliseconds)

  • Advertiser domains into the bid.meta object 

  • Safeframes are supported

 

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:

1 imp[].ext.gpid: ADSLOTNAME#UNIQUIFIER

Example:

1 2 3 4 5 6 7 8 9 10 11 12 13 pbjs.addAdUnits({ code: '/1111/homepage-leftnav', ortb2Imp: { ext: { gpid: "/1111/homepage-leftnav", data: { pbadslot: "/1111/homepage-leftnav" } } }, mediaTypes: ... bids: ... });

Support for GPID is available for the following:

  • display

  • video

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