UNPKG

mk9-prebid

Version:

Header Bidding Management Library

126 lines (110 loc) 3.78 kB
<html> <head> <script> var testHaloId = "030tstezbb07jv2yg08xizqr0bwpa0c0evvmq00eivtcg0nc9v970ntek210qskvk40trr7270wqxik90zq3u2d12pa5j3137rx2918nmsj905vat8b1elzfjf1hl5r1i1kkc2jl"; window.localStorage.setItem('auHaloId', testHaloId); </script> <script> var FAILSAFE_TIMEOUT = 2000; var adUnits = [ { code: 'test-div', mediaTypes: { banner: { sizes: [[300,250],[300,600],[728,90]] } }, bids: [ { bidder: 'appnexus', params: { placementId: 13144370 } } ] } ]; var pbjs = pbjs || {}; pbjs.que = pbjs.que || []; </script> <script src="../../build/dev/prebid.js" async></script> <script> var googletag = googletag || {}; var testAuctionDelay = 2000; googletag.cmd = googletag.cmd || []; googletag.cmd.push(function() { googletag.pubads().disableInitialLoad(); }); pbjs.que.push(function() { pbjs.setConfig({ debug: true, realTimeData: { auctionDelay: testAuctionDelay, // lower in real scenario to meet publisher spec dataProviders: [ { name: "halo", waitForIt: true, params: { segmentCache: false, requestParams: { publisherId: 0 } } } ] } }); pbjs.addAdUnits(adUnits); pbjs.requestBids({bidsBackHandler: sendAdserverRequest}); }); function sendAdserverRequest() { document.getElementById('audigent_segments').innerHTML = window.localStorage.getItem('auHaloRtd'); document.getElementById('halo_id').innerHTML = testHaloId; if (pbjs.adserverRequestSent) return; pbjs.adserverRequestSent = true; googletag.cmd.push(function() { pbjs.que.push(function() { pbjs.setTargetingForGPTAsync(); googletag.pubads().refresh(); }); }); } setTimeout(function() { sendAdserverRequest(); }, FAILSAFE_TIMEOUT); </script> <script> (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> googletag.cmd.push(function() { googletag.defineSlot('/112115922/FL_PB_MedRect', [[300, 250],[300,600]], 'test-div').addService(googletag.pubads()); googletag.pubads().enableSingleRequest(); googletag.enableServices(); }); </script> </head> <body> <h2>Halo RTD Prebid</h2> <div id='test-div'> <script> googletag.cmd.push(function() { googletag.display('test-div'); }); </script> </div> Halo Id: <div id='halo_id'> </div> Halo Real-Time Data: <div id='audigent_segments'> </div> </body> </html>