Skip to content

Commit dcfc9fe

Browse files
authored
Merge branch 'prebid:master' into master
2 parents e6b1672 + d0bb0f5 commit dcfc9fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3585
-2895
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<html>
2+
<head>
3+
<!--
4+
FLEDGE (Protected Audience API) configuration with GPT and FLEDGE-supporting adapter
5+
6+
gulp serve --modules=fledgeForGpt,openxBidAdapter
7+
-->
8+
<script async src="../../build/dev/prebid.js"></script>
9+
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
10+
<script>
11+
var FAILSAFE_TIMEOUT = 3000;
12+
var PREBID_TIMEOUT = 1500;
13+
14+
var pbjs = pbjs || {};
15+
pbjs.que = pbjs.que || [];
16+
17+
var googletag = googletag || {};
18+
googletag.cmd = googletag.cmd || [];
19+
20+
googletag.cmd.push(function() {
21+
googletag.pubads().disableInitialLoad();
22+
});
23+
24+
var adUnits = [{
25+
code: 'div-gpt-ad-1460505748561-0',
26+
mediaTypes: {
27+
banner: {
28+
sizes: [[300, 250]]
29+
}
30+
},
31+
bids: [{
32+
bidder: 'openx',
33+
params: {
34+
platform: '8869ec2c-9d3f-4f16-9d2f-49aaab8978fb',
35+
unit: '111111'
36+
}
37+
}],
38+
ortb2Imp: {
39+
ext: {
40+
ae: 1
41+
}
42+
}
43+
}];
44+
45+
pbjs.que.push(function() {
46+
pbjs.setConfig({
47+
fledgeForGpt: {
48+
enabled: true
49+
}
50+
});
51+
52+
pbjs.setBidderConfig({
53+
bidders: ['openx'],
54+
config: {
55+
fledgeEnabled: true
56+
}
57+
});
58+
59+
pbjs.addAdUnits(adUnits);
60+
61+
pbjs.requestBids({
62+
bidsBackHandler: sendAdserverRequest,
63+
timeout: PREBID_TIMEOUT
64+
});
65+
66+
function sendAdserverRequest() {
67+
if (pbjs.adserverRequestSent) return;
68+
pbjs.adserverRequestSent = true;
69+
googletag.cmd.push(function() {
70+
pbjs.que.push(function() {
71+
pbjs.setTargetingForGPTAsync();
72+
googletag.pubads().refresh();
73+
});
74+
});
75+
}
76+
77+
setTimeout(function() {
78+
sendAdserverRequest();
79+
}, FAILSAFE_TIMEOUT);
80+
});
81+
82+
googletag.cmd.push(function() {
83+
googletag
84+
.defineSlot('/19968336/header-bid-tag-0', adUnits[0].mediaTypes.banner.sizes, 'div-gpt-ad-1460505748561-0')
85+
.addService(googletag.pubads());
86+
87+
googletag.pubads().enableSingleRequest();
88+
googletag.enableServices();
89+
});
90+
</script>
91+
</head>
92+
93+
<body>
94+
<h2>Prebid.js FLEDGE+GPT Example</h2>
95+
96+
<h5>Div-1</h5>
97+
<div id='div-gpt-ad-1460505748561-0'>
98+
<script type='text/javascript'>
99+
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460505748561-0'); });
100+
</script>
101+
</div>
102+
</body>
103+
</html>
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<html>
2+
<head>
3+
<!--
4+
FLEDGE (Protected Audience API) configuration with GPT and Prebid-Server
5+
6+
gulp serve --modules=fledgeForGpt,prebidServerBidAdapter
7+
-->
8+
<script async src="../../build/dev/prebid.js"></script>
9+
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
10+
<script>
11+
var FAILSAFE_TIMEOUT = 3000;
12+
var PREBID_TIMEOUT = 1500;
13+
14+
var pbjs = pbjs || {};
15+
pbjs.que = pbjs.que || [];
16+
17+
var googletag = googletag || {};
18+
googletag.cmd = googletag.cmd || [];
19+
20+
googletag.cmd.push(function() {
21+
googletag.pubads().disableInitialLoad();
22+
});
23+
24+
var adUnits = [{
25+
code: 'div-gpt-ad-1460505748561-0',
26+
mediaTypes: {
27+
banner: {
28+
sizes: [[300, 250]]
29+
}
30+
},
31+
bids: [{
32+
bidder: 'openx',
33+
params: {
34+
platform: '8869ec2c-9d3f-4f16-9d2f-49aaab8978fb',
35+
unit: '111111'
36+
}
37+
}],
38+
ortb2Imp: {
39+
ext: {
40+
ae: 1
41+
}
42+
}
43+
}];
44+
45+
pbjs.que.push(function() {
46+
pbjs.setConfig({
47+
fledgeForGpt: {
48+
enabled: true
49+
},
50+
s2sConfig: [{
51+
accountId : '1',
52+
enabled : true,
53+
defaultVendor: 'appnexus',
54+
bidders : ['openx'],
55+
timeout : 1500,
56+
adapter : 'prebidServer'
57+
}]
58+
});
59+
60+
pbjs.setBidderConfig({
61+
bidders: ['openx'],
62+
config: {
63+
fledgeEnabled: true
64+
}
65+
});
66+
67+
pbjs.addAdUnits(adUnits);
68+
69+
pbjs.requestBids({
70+
bidsBackHandler: sendAdserverRequest,
71+
timeout: PREBID_TIMEOUT
72+
});
73+
74+
function sendAdserverRequest() {
75+
if (pbjs.adserverRequestSent) return;
76+
pbjs.adserverRequestSent = true;
77+
googletag.cmd.push(function() {
78+
pbjs.que.push(function() {
79+
pbjs.setTargetingForGPTAsync();
80+
googletag.pubads().refresh();
81+
});
82+
});
83+
}
84+
85+
setTimeout(function() {
86+
sendAdserverRequest();
87+
}, FAILSAFE_TIMEOUT);
88+
});
89+
90+
googletag.cmd.push(function() {
91+
googletag
92+
.defineSlot('/19968336/header-bid-tag-0', adUnits[0].mediaTypes.banner.sizes, 'div-gpt-ad-1460505748561-0')
93+
.addService(googletag.pubads());
94+
95+
googletag.pubads().enableSingleRequest();
96+
googletag.enableServices();
97+
});
98+
</script>
99+
</head>
100+
101+
<body>
102+
<h2>Prebid.js FLEDGE+GPT Example</h2>
103+
104+
<h5>Div-1</h5>
105+
<div id='div-gpt-ad-1460505748561-0'>
106+
<script type='text/javascript'>
107+
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460505748561-0'); });
108+
</script>
109+
</div>
110+
</body>
111+
</html>

libraries/ortbConverter/processors/video.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {sizesToFormat} from '../lib/sizes.js';
66
const ORTB_VIDEO_PARAMS = new Set([
77
'pos',
88
'placement',
9+
'plcmt',
910
'api',
1011
'mimes',
1112
'protocols',

modules/adnuntiusBidAdapter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { getStorageManager } from '../src/storageManager.js';
66

77
const BIDDER_CODE = 'adnuntius';
88
const ENDPOINT_URL = 'https://ads.adnuntius.delivery/i';
9+
const ENDPOINT_URL_EUROPE = 'https://europe.delivery.adnuntius.com/i';
910
const GVLID = 855;
1011
const DEFAULT_VAST_VERSION = 'vast4'
1112
// const DEFAULT_NATIVE = 'native'
@@ -130,10 +131,11 @@ export const spec = {
130131
const network = networkKeys[j];
131132
const networkRequest = [...request]
132133
if (network.indexOf('_video') > -1) { networkRequest.push('tt=' + DEFAULT_VAST_VERSION) }
134+
const requestURL = gdprApplies ? ENDPOINT_URL_EUROPE : ENDPOINT_URL
133135
// if (network.indexOf('_native') > -1) { networkRequest.push('tt=' + DEFAULT_NATIVE) }
134136
requests.push({
135137
method: 'POST',
136-
url: ENDPOINT_URL + '?' + networkRequest.join('&'),
138+
url: requestURL + '?' + networkRequest.join('&'),
137139
data: JSON.stringify(networks[network]),
138140
bid: bidRequests[network]
139141
});

0 commit comments

Comments
 (0)