You are here: Publishers > Header bidding solutions > OpenX Bidder > Standard implementation

Standard implementation for OpenX Bidder

Last updated on December 23, 2016

After you have reached out to your account manager, you and your OpenX representative will use the following instructions to guide you through the standard implementation of OpenX BidderOpenX's header bidding solution. Bidder enables publishers to realize the true value of their direct and indirect inventory in real time. "Bidder" can also mean a program designed to bid in real time on inventory in the OpenX Ad Exchange..

In this topic we will:


The following steps will guide you through the standard implementation process for OpenX Bidder.

  1. Provide a list of any special targeting or block lists to your OpenX representative.
  2. Set the required variable, OX_dfp_options, to ensure the proper functioning of this feature.
    var OX_dfp_options = {prefetch: true};
  3. Using the global variable, OX_dfp_ads, define the ad slots for which you plan to fetch prices. The properties of the OX_dfp_ads variable are shown below.
    var OX_dfp_ads = [
       [DFP_AdUnit, [size_array], div, {targetingMap}]







    DFP ad unitIn OpenX, the smallest inventory component that represents the space on a site where ads display. name




    Available sizes for the specified ad unit

    String (Array)['160x600','300x600']



    div id that will be called in the googletag.display call




    Targeting map for specific key-value pairs

    String or null{'pos':['atfAbove the fold. ATF ads are visible on the screen without needing to scroll. See screen location.']}


  4. Load the OpenX JavaScript Tag (JSTAG) library. The PUBLISHERIn OpenX, an account type that represents a business with ad space to sell., NETWORKCODE and SITEAn OpenX component that represents top-level domains or sub-domains and is used to organize ad units. Sites enable you to target and report on inventory performance. placeholders are provided by your OpenX representative.
    <script type="text/javascript" src="//">
  5. Check your standard implementation of the OpenX Bidder.
  6. Send your test page to your OpenX representative for review.
  7. After OpenX review, deploy this implementation to all your production digital pages.

Code Sample

Below is an example of a test page created using the steps outlined above in the Process section. This example assumes that the publisher is participating in OpenX Bidder and has the following ad units defined in DFP in the following format: /DFP_NetworkCode/DFP_AdUnit .







Note: You can view a live example of the code below on this test page.

// From step #2.		
var OX_dfp_options = {prefetch: true};		
From step #3, define the ad slots for which you plan to fetch prices. 
OX_dfp_ads is an array that pre-requests ad units on the page.  
The ad units that are define should be a 1:1 match of the defineSlots on each page.

var OX_dfp_ads = [
   ["/90577858/OxDemoStandard_7289BTF", ["728x90"], "div-gpt-ad-1478110158052-0"],    
   ["/90577858/OxDemoStandard_7289", ["728x90"], "div-gpt-ad-1478110158052-1"],    
   ["/90577858/OxDemoStandard_3002BTF", ["300x250"], "div-gpt-ad-1478110158052-2"],
   ["/90577858/OxDemoStandard_3002", ["300x250"], "div-gpt-ad-1478110158052-3"],
   ["/90577858/OxDemoStandard_1606LR", ["160x600"], "div-gpt-ad-1478110158052-5"],
   ["/90577858/OxDemoStandard_1606RR", ["160x600"], "div-gpt-ad-1478110158052-4"]


// From step #4, load the OpenX JavaScript Tag (JSTAG) library. 				
<script type="text/javascript" 

<script type="text/javascript">
   var googletag = googletag || {};
   googletag.cmd = googletag.cmd || [];
   (function() {
      var gads = document.createElement("script");
      gads.async = true;
      gads.type = "text/javascript";
      var useSSL = "https:" == document.location.protocol;
      gads.src = (useSSL ? "https:" : "http:") + 
      var node = document.getElementsByTagName("script")[0];
      node.parentNode.insertBefore(gads, node);
<script type='text/javascript'>
googletag.cmd.push(function() {
   googletag.defineSlot('/90577858/OxDemoStandard_7289BTF', [728, 90], 
   googletag.defineSlot('/90577858/OxDemoStandard_7289', [728, 90], 
   googletag.defineSlot('/90577858/OxDemoStandard_3002BTF', [300, 250], 
   googletag.defineSlot('/90577858/OxDemoStandard_3002', [300, 250], 
   googletag.defineSlot('/90577858/OxDemoStandard_1606RR', [160, 600], 
   googletag.defineSlot('/90577858/OxDemoStandard_1606LR', [160, 600], 

Feedback form