This repository has been archived by the owner on Feb 13, 2021. It is now read-only.
forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request prebid#121 in AOLP_ADS_JS/prebid.js from release/1…
….28.0 to aolgithub-master * commit '4d9ade3df767750743f8888ed9efd6c77f8d0050': (26 commits) Added changelog entry. Added new aol partners ids. Prebid 0.28.0 Release Revert "Upgrade sinon to 3.x (prebid#1491)" (prebid#1563) add () for correct order of operations in scaling increments for currency (prebid#1559) AppnexusAst adapter update: Added source and version to request payload (prebid#1555) remove unnecessary spread operator (prebid#1561) Adxcg adapter (prebid#1554) Upgrade sinon to 3.x (prebid#1491) Rename vastPayload to vastXml (prebid#1556) Single-size sizes array now can be taken, too (prebid#1535) Updated the istanbul-instrumenter-loader (prebid#1550) Add AerServ Adapter (prebid#1538) Fixed imports and made adform support aliasing (prebid#1518) Custom granularity fix (prebid#1546) Fix `documentation lint` issues (prebid#1544) Yieldbot adunit bidder params slot name usage fix (prebid#1394) Update serverbid adapter to use smartsync (prebid#1324) Add improvedigitalBidAdapter (prebid#1381) Fix prebid#1533 spring server typo (prebid#1542) ...
- Loading branch information
Showing
43 changed files
with
3,329 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
<html> | ||
<head> | ||
<script> | ||
var PREBID_TIMEOUT = 1000; | ||
|
||
var googletag = googletag || {}; | ||
googletag.cmd = googletag.cmd || []; | ||
|
||
function initAdserver() { | ||
if (pbjs.initAdserverSet) return; | ||
(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); | ||
})(); | ||
pbjs.initAdserverSet = true; | ||
}; | ||
setTimeout(initAdserver, PREBID_TIMEOUT); | ||
|
||
var pbjs = pbjs || {}; | ||
pbjs.que = pbjs.que || []; | ||
(function() { | ||
var pbjsEl = document.createElement("script"); | ||
pbjsEl.type = "text/javascript"; | ||
pbjsEl.async = true; | ||
pbjsEl.src = "/build/dev/prebid.js"; | ||
var pbjsTargetEl = document.getElementsByTagName("head")[0]; | ||
pbjsTargetEl.insertBefore(pbjsEl, pbjsTargetEl.firstChild); | ||
})(); | ||
|
||
pbjs.que.push(function() { | ||
var adUnits = [ | ||
{ | ||
code: 'div-gpt-ad-1438287399331-0', | ||
sizes: [[728, 90]], | ||
bids: [ | ||
{ | ||
bidder: 'appnexus', | ||
params: { placementId: '10433394' } | ||
}, | ||
{ | ||
bidder: 'yieldbot', | ||
params: { | ||
psn: '1234', | ||
slot: 'leaderboard' | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
code: 'div-gpt-ad-1438287399331-1', | ||
sizes: [[300, 250], [300, 600]], | ||
bids: [ | ||
{ | ||
bidder: 'appnexus', | ||
params: { placementId: '10433394' } | ||
}, | ||
{ | ||
bidder: 'yieldbot', | ||
params: { | ||
psn: '1234', | ||
slot: 'test_slot' | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
code: 'div-gpt-ad-1438287399331-2', | ||
sizes: [[300, 250]], | ||
bids: [ | ||
{ | ||
bidder: 'appnexus', | ||
params: { placementId: '10433394' } | ||
}, | ||
{ | ||
bidder: 'yieldbot', | ||
params: { | ||
psn: '1234', | ||
slot: 'test_slot' | ||
} | ||
} | ||
] | ||
} | ||
]; | ||
pbjs.addAdUnits(adUnits); | ||
|
||
pbjs.requestBids({ | ||
bidsBackHandler: function(bidResponses) { | ||
initAdserver(); | ||
} | ||
}) | ||
}); | ||
</script> | ||
|
||
<script> | ||
var topSlot; | ||
var rightSlot; | ||
var leftSlot; | ||
|
||
googletag.cmd.push(function() { | ||
topSlot = googletag.defineSlot('/2476204/leaderboard', [[728, 90]], 'div-gpt-ad-1438287399331-0').addService(googletag.pubads()); | ||
|
||
rightSlot = googletag.defineSlot('/2476204/multi-size', [[300, 250], [300, 600]], 'div-gpt-ad-1438287399331-1').addService(googletag.pubads()); | ||
|
||
leftSlot = googletag.defineSlot('/2476204/multi-size', [[300, 250], [300,600]], 'div-gpt-ad-1438287399331-2').addService(googletag.pubads()); | ||
|
||
pbjs.que.push(function() { | ||
pbjs.setTargetingForGPTAsync(); | ||
}); | ||
|
||
googletag.pubads().collapseEmptyDivs(true); | ||
googletag.pubads().enableSingleRequest(); | ||
googletag.enableServices(); | ||
}); | ||
|
||
function refreshBid0() { | ||
pbjs.que.push(function() { | ||
pbjs.requestBids({ | ||
timeout: PREBID_TIMEOUT, | ||
adUnitCodes: ['div-gpt-ad-1438287399331-0'], | ||
bidsBackHandler: function() { | ||
pbjs.setTargetingForGPTAsync(['div-gpt-ad-1438287399331-0']); | ||
googletag.pubads().refresh([topSlot]); | ||
} | ||
}); | ||
}); | ||
} | ||
|
||
function refreshBid1() { | ||
pbjs.que.push(function() { | ||
pbjs.requestBids({ | ||
timeout: PREBID_TIMEOUT, | ||
adUnitCodes: ['div-gpt-ad-1438287399331-1'], | ||
bidsBackHandler: function() { | ||
pbjs.setTargetingForGPTAsync(['div-gpt-ad-1438287399331-1']); | ||
googletag.pubads().refresh([rightSlot]); | ||
} | ||
}); | ||
}); | ||
} | ||
|
||
function refreshBid2() { | ||
pbjs.que.push(function() { | ||
pbjs.requestBids({ | ||
timeout: PREBID_TIMEOUT, | ||
adUnitCodes: ['div-gpt-ad-1438287399331-2'], | ||
bidsBackHandler: function() { | ||
pbjs.setTargetingForGPTAsync(['div-gpt-ad-1438287399331-2']); | ||
googletag.pubads().refresh([leftSlot]); | ||
} | ||
}); | ||
}); | ||
} | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<h2>Prebid.js Yieldbot Adapter Basic Example</h2> | ||
Use the links below to enable and disable Yieldbot test bids.<br> | ||
<br> | ||
<b><em>Note:</em></b> | ||
<br> | ||
The "<b><a href="#enable" target="_self">Enable - Yieldbot Test Bids</a></b>" link below will set a cookie to force Yieldbot bid requests to return static test creative: the cookie expires in 24 hrs. | ||
<br> | ||
<ul><li>Use the "<b><a href="#enable" target="_self">Disable - Yieldbot Test Bids</a></b>" link when testing is complete to re-enable live bids.</li></ul> | ||
<ol> | ||
<li><a id="enable" href="http://i.yldbt.com/m/start-testing" target="_blank">Enable - Yieldbot Test Bids</a></li> | ||
<li><a id="disable" href="http://i.yldbt.com/m/stop-testing" target="_blank">Disable - Yieldbot Test Bids</a></li> | ||
</ol> | ||
<h5>Div-0, 728x90</h5> | ||
<button onclick="refreshBid0()">Refresh 728x90 Ad Unit</button> | ||
<div id='div-gpt-ad-1438287399331-0'> | ||
<script type='text/javascript'> | ||
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1438287399331-0'); }); | ||
</script> | ||
</div> | ||
<h5>Div-1, 300x250 or 300x600</h5> | ||
<button onclick="refreshBid1()">Refresh 300x250, 300x600 Ad Unit</button> | ||
<div id='div-gpt-ad-1438287399331-1'> | ||
<script type='text/javascript'> | ||
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1438287399331-1'); }); | ||
</script> | ||
</div> | ||
<h5>Div-2, 300x250 or 300x600</h5> | ||
The bid for the <code>300x250 | 300x600</code> slot is shown under <b><em>Div-1</em></b> above. | ||
<ul> | ||
<li>Refresh this slot after initial page view and you should see the Yieldbot test creative.</li> | ||
</ul> | ||
<button onclick="refreshBid2()">Refresh 300x250, 300x600 Ad Unit</button> | ||
<div id='div-gpt-ad-1438287399331-2'> | ||
<script type='text/javascript'> | ||
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1438287399331-2'); }); | ||
</script> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.