Option 1: on Prebid.js website. Go to prebid.org/download.html , choose BetweenDigital's adapter, press the button «Get Prebid.js!» at the bottom of the page.
Option 2: from Github. Go to github and build sources according to instructions.
The parameters are used as an example:
- s: 3649326 — Between section id
- cur: Optional parameter, denotes the currency in which the ssp server will send bids. Accepts 'EUR', 'USD' and 'RUB' Default values are 'RUB'.
- code: div-gpt-ad-1576579925364-0 — id of a div element showing prebid ads
- /21757675864/240_400 — slot's id in Google DFP
You can also specify several sizes in the
mediaTypes.banner.sizes
parameter, for example:mediaTypes: { banner: { sizes: [[240, 400], [300, 250], [300,600]], } },
<head>
builded prebid.js: <script src="prebid.js></script>
<head>
following code:
<body>
following code:
You can choose in which currency the SSP server will send cpm: 'RUB', 'USD' or 'EUR'. Default is 'RUB'.
To do this, in the params
field of our adapter you need to add the cur
field, which takes
one of the values: 'RUB'
, 'USD'
or 'EUR'
.
For example, you want cpm to be sent in dollars. Then the code of our adapter settings will look like this:
{
bidder: 'between',
params: {
s: BETWEEN_SECTION_ID,
cur: 'USD'
}
}
If you specify several sizes in the AdUnits
settings in the mediaTypes.banner.sizes
field,
our SSP server will hold an auction with each size and respond with a bid with the maximum CPM.
For example, your ad-slot
supports three sizes: 970x250, 728x90 and 468x60.
Then the AdUnits
code will look like this:
var adUnits = [{
code: 'ad-slot',
mediaTypes: {
banner: {
sizes: [[970, 250], [728, 90], [468, 60]]
}
},
bids: [
{
bidder: 'between',
params: {
s: BETWEEN_SECTION_ID,
}
}
]
}];
<!DOCTYPE html>
<html lang="ru">
<head>
<script type="text/javascript"
src="https://cdnit1.img.sputniknews.com/min/js/libs/prebid.js?270f2d7ce">
</script>
<script>
var PREBID_TIMEOUT = 1000;
var adUnits = [{
code: 'div-gpt-ad-1576579925364-0',
sizes: [[240, 400]],
bids: [
{
bidder: 'between',
params: {
s: 3649326,
cur: 'EUR'
}
}
]
}];
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
pbjs.que.push(function() {
pbjs.setConfig({
priceGranularity: {
"buckets": [{
"precision": 2,
"min": 0,
"max": 10,
"increment": 5.00
}, {
"precision": 2,
"min": 10,
"max": 20,
"increment": 10.00
}, {
"precision": 2,
"min": 20,
"max": 100,
"increment": 20.00
},{
"precision": 2,
"min": 100,
"max": 200,
"increment": 50.00
}, {
"precision": 2,
"min": 200,
"max": 600,
"increment": 200.00
}]
}
});
});
</script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
googletag.pubads().disableInitialLoad();
});
pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest
});
});
function sendAdserverRequest() {
if (pbjs.adserverRequestSent) return;
pbjs.adserverRequestSent = true;
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
});
}
setTimeout(function() {
sendAdserverRequest();
}, PREBID_TIMEOUT);
</script>
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
<script>
window.googletag = window.googletag || {cmd: []};
googletag.cmd.push(function() {
googletag.defineSlot('/21757675864/240_400', [240, 400], 'div-gpt-ad-1576579925364-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</head>
<body>
<div id='div-gpt-ad-1576579925364-0' style='width: 240px; height: 400px;'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1576579925364-0'); });
</script>
</div>
</body>
</html>