forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
134b0eb
commit bbfddb4
Showing
2 changed files
with
159 additions
and
252 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
<html> | ||
|
||
<head> | ||
<link rel="icon" type="image/png" href="/favicon.png"> | ||
<script async src="//www.googletagservices.com/tag/js/gpt.js"></script> | ||
<script type="text/javascript" src="../../build/dev/prebid.js" async></script> | ||
|
||
<script> | ||
var googletag = googletag || {}; | ||
googletag.cmd = googletag.cmd || []; | ||
|
||
var pbjs = pbjs || {}; | ||
pbjs.que = pbjs.que || []; | ||
var PREBID_TIMEOUT = 3000; | ||
|
||
function refreshSlots() { | ||
googletag.cmd.push(function () { | ||
pbjs.que.push(function () { | ||
pbjs.setTargetingForGPTAsync(); | ||
googletag.pubads().refresh(); | ||
}); | ||
}); | ||
} | ||
|
||
// Load GPT when timeout is reached. | ||
// setTimeout(initAdserver, PREBID_TIMEOUT); | ||
|
||
pbjs.que.push(function () { | ||
pbjs.setConfig({ | ||
debug: true, | ||
}); | ||
|
||
var adUnits = [ | ||
{ | ||
code: '/19968336/prebid_native_example_1', | ||
// sizes: [[1, 1]], | ||
mediaTypes: { | ||
native: { | ||
sendTargetingKeys: false, | ||
rendererUrl: "http://localhost:5500/prebid/cardRender.js", | ||
ortb2: { | ||
ver: "1.2", | ||
assets: [ | ||
{ | ||
id: 1, | ||
required: 1, | ||
title: { len: 80 }, | ||
}, | ||
{ | ||
id: 2, | ||
required: 1, | ||
data: { type: 2 } | ||
}, | ||
{ | ||
id: 3, | ||
required: 1, | ||
img: { | ||
type: 3, | ||
w: 150, | ||
h: 50, | ||
} | ||
}, | ||
{ | ||
id: 4, | ||
required: 1, | ||
data: { type: 1 } | ||
}, | ||
{ | ||
id: 5, | ||
required: 0, | ||
img: { | ||
type: 1, | ||
wmin: 20, | ||
hmin: 20, | ||
} | ||
} | ||
], | ||
}, | ||
}, | ||
}, | ||
bids: [{ | ||
bidder: 'pwbid', | ||
params: { | ||
siteId: "xxxxxx", | ||
isTest: true, | ||
} | ||
}] | ||
} | ||
]; | ||
|
||
pbjs.addAdUnits(adUnits); | ||
pbjs.requestBids({ | ||
bidsBackHandler: function (bidResponses) { | ||
refreshSlots(); | ||
} | ||
}); | ||
}); | ||
|
||
</script> | ||
|
||
<script> | ||
// GPT setup | ||
googletag.cmd.push(function () { | ||
// var slot1 = googletag.defineSlot('/19968336/prebid_native_example_1', [[360, 360]], 'div-1').addService(googletag.pubads()); | ||
// var slot2 = googletag.defineSlot('/19968336/prebid_native_example_2', 'fluid', 'div-2').addService(googletag.pubads()); | ||
var slot2 = googletag.defineSlot('/19968336/prebid_native_example_1', ['fluid'], 'div-2').addService(googletag.pubads()); | ||
googletag.pubads().disableInitialLoad(); | ||
googletag.pubads().enableSingleRequest(); | ||
googletag.enableServices(); | ||
}); | ||
|
||
</script> | ||
</head> | ||
|
||
<body> | ||
|
||
<h2>Prebid Native</h2> | ||
<div id='div-1'> | ||
<p>No response</p> | ||
<script type='text/javascript'> | ||
googletag.cmd.push(function () { | ||
// googletag.display('div-1'); | ||
}); | ||
|
||
</script> | ||
</div> | ||
|
||
<br> | ||
<br> | ||
|
||
<div id='div-2' style="width: 400px;height: 500px;"> | ||
<p>No response</p> | ||
<script type='text/javascript'> | ||
googletag.cmd.push(function () { | ||
googletag.display('div-2'); | ||
}); | ||
|
||
</script> | ||
</div> | ||
|
||
</body> | ||
|
||
</html> |
Oops, something went wrong.