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:

Process

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}]
    ];

    Property

    Description

    Type

    Example

    Required?

    DFP_AdUnit

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

    String'/12345/abc/zone1'

    Yes

    [size_array]

    Available sizes for the specified ad unit

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

    Yes

    div

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

    Stringdiv-gpt-ad-123456789-1

    Yes

    {targetingMap}

    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.']}

    No


  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="//PUBLISHER-d.openx.net/w/1.0/jstag?nc=NETWORKCODE-SITE">
    </script>
  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.


/90577858/OxDemoStandard_7289BTF
/90577858/OxDemoStandard_7289
/90577858/OxDemoStandard_3002BTF
/90577858/OxDemoStandard_3002
/90577858/OxDemoStandard_1606LR
/90577858/OxDemoStandard_1606RR				

<head>				
<script>
// 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"]
];

</script>

// From step #4, load the OpenX JavaScript Tag (JSTAG) library. 				
<script type="text/javascript" 
  src="//oxdemo-d.openxenterprise.com/w/1.0/jstag?nc=90577858-oxbidder2015">
</script>

<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:") + 
	    "//www.googletagservices.com/tag/js/gpt.js";
      var node = document.getElementsByTagName("script")[0];
      node.parentNode.insertBefore(gads, node);
   })();
</script>
				
<script type='text/javascript'>
googletag.cmd.push(function() {
   googletag.defineSlot('/90577858/OxDemoStandard_7289BTF', [728, 90], 
     'div-gpt-ad-1478110158052-0').addService(googletag.pubads());
   googletag.defineSlot('/90577858/OxDemoStandard_7289', [728, 90], 
     'div-gpt-ad-1478110158052-1').addService(googletag.pubads());
   googletag.defineSlot('/90577858/OxDemoStandard_3002BTF', [300, 250], 
     'div-gpt-ad-1478110158052-2').addService(googletag.pubads());
   googletag.defineSlot('/90577858/OxDemoStandard_3002', [300, 250], 
     'div-gpt-ad-1478110158052-3').addService(googletag.pubads());
   googletag.defineSlot('/90577858/OxDemoStandard_1606RR', [160, 600], 
     'div-gpt-ad-1478110158052-4').addService(googletag.pubads());
   googletag.defineSlot('/90577858/OxDemoStandard_1606LR', [160, 600], 
     'div-gpt-ad-1478110158052-5').addService(googletag.pubads());
   googletag.pubads().enableSingleRequest();
   googletag.enableServices();
});
</script>
</head>
		

Feedback form