prebid.js 6.2.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gulpfile.js +0 -8
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +23 -14
- package/modules/33acrossBidAdapter.js +189 -102
- package/modules/adagioBidAdapter.js +1 -1
- package/modules/addefendBidAdapter.js +1 -0
- package/modules/admanBidAdapter.js +1 -0
- package/modules/admixerBidAdapter.js +1 -1
- package/modules/adnuntiusBidAdapter.js +3 -1
- package/modules/adxcgBidAdapter.js +311 -359
- package/modules/adxcgBidAdapter.md +22 -21
- package/modules/appnexusBidAdapter.js +0 -1
- package/modules/beopBidAdapter.js +5 -3
- package/modules/colossussspBidAdapter.js +7 -0
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/cwireBidAdapter.js +3 -0
- package/modules/dspxBidAdapter.js +1 -1
- package/modules/futureads.md +48 -0
- package/modules/glimpseBidAdapter.js +16 -3
- package/modules/gumgumBidAdapter.js +2 -2
- package/modules/kinessoIdSystem.js +1 -1
- package/modules/lotamePanoramaIdSystem.js +80 -8
- package/modules/mediasquareBidAdapter.js +1 -9
- package/modules/nextMillenniumBidAdapter.js +29 -1
- package/modules/prebidServerBidAdapter/index.js +16 -12
- package/modules/richaudienceBidAdapter.js +1 -2
- package/modules/rtdModule/index.js +48 -18
- package/modules/rubiconBidAdapter.js +10 -8
- package/modules/sharedIdSystem.js +27 -1
- package/modules/targetVideoBidAdapter.js +187 -0
- package/modules/targetVideoBidAdapter.md +34 -0
- package/modules/vidoomyBidAdapter.js +16 -10
- package/modules/weboramaRtdProvider.js +288 -73
- package/modules/weboramaRtdProvider.md +27 -10
- package/modules/yahoosspBidAdapter.js +5 -1
- package/modules/zetaSspBidAdapter.md +33 -1
- package/modules/zeta_global_sspBidAdapter.js +22 -1
- package/package.json +1 -1
- package/plugins/pbjsGlobals.js +28 -1
- package/src/prebid.js +1 -2
- package/src/targeting.js +22 -1
- package/src/utils.js +34 -7
- package/test/spec/modules/33acrossBidAdapter_spec.js +300 -78
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +17 -0
- package/test/spec/modules/adxcgBidAdapter_spec.js +820 -571
- package/test/spec/modules/colossussspBidAdapter_spec.js +9 -0
- package/test/spec/modules/cwireBidAdapter_spec.js +10 -8
- package/test/spec/modules/lotamePanoramaIdSystem_spec.js +227 -0
- package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -4
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +18 -0
- package/test/spec/modules/prebidServerBidAdapter_spec.js +43 -0
- package/test/spec/modules/realTimeDataModule_spec.js +135 -49
- package/test/spec/modules/richaudienceBidAdapter_spec.js +2 -2
- package/test/spec/modules/rubiconBidAdapter_spec.js +17 -0
- package/test/spec/modules/sharedIdSystem_spec.js +52 -6
- package/test/spec/modules/targetVideoBidAdapter_spec.js +96 -0
- package/test/spec/modules/weboramaRtdProvider_spec.js +408 -214
- package/test/spec/modules/yahoosspBidAdapter_spec.js +28 -1
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +33 -1
- package/test/spec/unit/core/targeting_spec.js +72 -0
- package/test/spec/utils_spec.js +38 -0
package/gulpfile.js
CHANGED
|
@@ -141,12 +141,6 @@ function watch(done) {
|
|
|
141
141
|
done();
|
|
142
142
|
};
|
|
143
143
|
|
|
144
|
-
function makeModuleList(modules) {
|
|
145
|
-
return modules.map(module => {
|
|
146
|
-
return '"' + module + '"'
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
|
|
150
144
|
function makeDevpackPkg() {
|
|
151
145
|
var cloned = _.cloneDeep(webpackConfig);
|
|
152
146
|
cloned.devtool = 'source-map';
|
|
@@ -158,7 +152,6 @@ function makeDevpackPkg() {
|
|
|
158
152
|
return gulp.src([].concat(moduleSources, analyticsSources, 'src/prebid.js'))
|
|
159
153
|
.pipe(helpers.nameModules(externalModules))
|
|
160
154
|
.pipe(webpackStream(cloned, webpack))
|
|
161
|
-
.pipe(replace(/('|")v\$prebid\.modulesList\$('|")/g, makeModuleList(externalModules)))
|
|
162
155
|
.pipe(gulp.dest('build/dev'))
|
|
163
156
|
.pipe(connect.reload());
|
|
164
157
|
}
|
|
@@ -176,7 +169,6 @@ function makeWebpackPkg() {
|
|
|
176
169
|
.pipe(helpers.nameModules(externalModules))
|
|
177
170
|
.pipe(webpackStream(cloned, webpack))
|
|
178
171
|
.pipe(terser())
|
|
179
|
-
.pipe(replace(/('|")v\$prebid\.modulesList\$('|")/g, makeModuleList(externalModules)))
|
|
180
172
|
.pipe(gulpif(file => file.basename === 'prebid-core.js', header(banner, { prebid: prebid })))
|
|
181
173
|
.pipe(gulp.dest('build/dist'));
|
|
182
174
|
}
|
|
@@ -17,22 +17,31 @@
|
|
|
17
17
|
debug: true,
|
|
18
18
|
realTimeData: {
|
|
19
19
|
auctionDelay: 1000,
|
|
20
|
-
dataProviders: [
|
|
21
|
-
{
|
|
20
|
+
dataProviders: [{
|
|
22
21
|
name: "weborama",
|
|
23
22
|
waitForIt: true,
|
|
24
23
|
params: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
weboCtxConf: {
|
|
25
|
+
token: "to-be-defined", // mandatory
|
|
26
|
+
targetURL: "https://prebid.org", // default is document.URL
|
|
27
|
+
setPrebidTargeting: true, // default
|
|
28
|
+
sendToBidders: true, // default
|
|
29
|
+
defaultProfile: { // optional
|
|
30
|
+
webo_ctx: ['moon'],
|
|
31
|
+
webo_ds: ['bar']
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
weboUserDataConf: {
|
|
35
|
+
setPrebidTargeting: true, // default
|
|
36
|
+
sendToBidders: true, // default
|
|
37
|
+
defaultProfile: { // optional
|
|
38
|
+
webo_cs: ['Red'],
|
|
39
|
+
webo_audiences: ['bam']
|
|
40
|
+
},
|
|
41
|
+
localStorageProfileKey: 'webo_wam2gam_entry' // default
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}]
|
|
36
45
|
}
|
|
37
46
|
});
|
|
38
47
|
});
|
|
@@ -54,7 +63,7 @@
|
|
|
54
63
|
}
|
|
55
64
|
},
|
|
56
65
|
bids: [{
|
|
57
|
-
bidder: '
|
|
66
|
+
bidder: 'smartadserver',
|
|
58
67
|
params: {
|
|
59
68
|
placementId: 1
|
|
60
69
|
}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
2
2
|
import { config } from '../src/config.js';
|
|
3
3
|
import {
|
|
4
|
-
deepAccess,
|
|
5
|
-
|
|
4
|
+
deepAccess,
|
|
5
|
+
uniques,
|
|
6
|
+
isArray,
|
|
7
|
+
getWindowTop,
|
|
8
|
+
isGptPubadsDefined,
|
|
9
|
+
isSlotMatchingAdUnitCode,
|
|
10
|
+
logInfo,
|
|
11
|
+
logWarn,
|
|
12
|
+
getWindowSelf,
|
|
13
|
+
mergeDeep,
|
|
6
14
|
} from '../src/utils.js';
|
|
7
|
-
import {BANNER, VIDEO} from '../src/mediaTypes.js';
|
|
15
|
+
import { BANNER, VIDEO } from '../src/mediaTypes.js';
|
|
8
16
|
|
|
17
|
+
// **************************** UTILS *************************** //
|
|
9
18
|
const BIDDER_CODE = '33across';
|
|
10
19
|
const END_POINT = 'https://ssc.33across.com/api/v1/hb';
|
|
11
20
|
const SYNC_ENDPOINT = 'https://ssc-cms.33across.com/ps/?m=xch&rt=html&ru=deb';
|
|
@@ -42,6 +51,14 @@ const adapterState = {
|
|
|
42
51
|
|
|
43
52
|
const NON_MEASURABLE = 'nm';
|
|
44
53
|
|
|
54
|
+
function getTTXConfig() {
|
|
55
|
+
const ttxSettings = Object.assign({},
|
|
56
|
+
config.getConfig('ttxSettings')
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
return ttxSettings;
|
|
60
|
+
}
|
|
61
|
+
|
|
45
62
|
// **************************** VALIDATION *************************** //
|
|
46
63
|
function isBidRequestValid(bid) {
|
|
47
64
|
return (
|
|
@@ -74,6 +91,7 @@ function _validateGUID(bid) {
|
|
|
74
91
|
|
|
75
92
|
function _validateBanner(bid) {
|
|
76
93
|
const banner = deepAccess(bid, 'mediaTypes.banner');
|
|
94
|
+
|
|
77
95
|
// If there's no banner no need to validate against banner rules
|
|
78
96
|
if (banner === undefined) {
|
|
79
97
|
return true;
|
|
@@ -140,91 +158,125 @@ function _validateVideo(bid) {
|
|
|
140
158
|
// NOTE: With regards to gdrp consent data, the server will independently
|
|
141
159
|
// infer the gdpr applicability therefore, setting the default value to false
|
|
142
160
|
function buildRequests(bidRequests, bidderRequest) {
|
|
161
|
+
const {
|
|
162
|
+
ttxSettings,
|
|
163
|
+
gdprConsent,
|
|
164
|
+
uspConsent,
|
|
165
|
+
pageUrl
|
|
166
|
+
} = _buildRequestParams(bidRequests, bidderRequest);
|
|
167
|
+
|
|
168
|
+
const groupedRequests = _buildRequestGroups(ttxSettings, bidRequests);
|
|
169
|
+
|
|
170
|
+
const serverRequests = [];
|
|
171
|
+
|
|
172
|
+
for (const key in groupedRequests) {
|
|
173
|
+
serverRequests.push(
|
|
174
|
+
_createServerRequest({
|
|
175
|
+
bidRequests: groupedRequests[key],
|
|
176
|
+
gdprConsent,
|
|
177
|
+
uspConsent,
|
|
178
|
+
pageUrl,
|
|
179
|
+
ttxSettings
|
|
180
|
+
})
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return serverRequests;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function _buildRequestParams(bidRequests, bidderRequest) {
|
|
188
|
+
const ttxSettings = getTTXConfig();
|
|
189
|
+
|
|
143
190
|
const gdprConsent = Object.assign({
|
|
144
191
|
consentString: undefined,
|
|
145
192
|
gdprApplies: false
|
|
146
193
|
}, bidderRequest && bidderRequest.gdprConsent);
|
|
147
194
|
|
|
148
195
|
const uspConsent = bidderRequest && bidderRequest.uspConsent;
|
|
196
|
+
|
|
149
197
|
const pageUrl = (bidderRequest && bidderRequest.refererInfo) ? (bidderRequest.refererInfo.referer) : (undefined);
|
|
150
198
|
|
|
151
199
|
adapterState.uniqueSiteIds = bidRequests.map(req => req.params.siteId).filter(uniques);
|
|
152
200
|
|
|
153
|
-
return
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
201
|
+
return {
|
|
202
|
+
ttxSettings,
|
|
203
|
+
gdprConsent,
|
|
204
|
+
uspConsent,
|
|
205
|
+
pageUrl
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function _buildRequestGroups(ttxSettings, bidRequests) {
|
|
210
|
+
const bidRequestsComplete = bidRequests.map(_inferProduct);
|
|
211
|
+
const enableSRAMode = ttxSettings && ttxSettings.enableSRAMode;
|
|
212
|
+
const keyFunc = (enableSRAMode === true) ? _getSRAKey : _getMRAKey;
|
|
213
|
+
|
|
214
|
+
return _groupBidRequests(bidRequestsComplete, keyFunc);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function _groupBidRequests(bidRequests, keyFunc) {
|
|
218
|
+
const groupedRequests = {};
|
|
219
|
+
|
|
220
|
+
bidRequests.forEach((req) => {
|
|
221
|
+
const key = keyFunc(req);
|
|
222
|
+
|
|
223
|
+
groupedRequests[key] = groupedRequests[key] || [];
|
|
224
|
+
groupedRequests[key].push(req);
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
return groupedRequests;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function _getSRAKey(bidRequest) {
|
|
231
|
+
return `${bidRequest.params.siteId}:${bidRequest.params.productId}`;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function _getMRAKey(bidRequest) {
|
|
235
|
+
return `${bidRequest.bidId}`;
|
|
161
236
|
}
|
|
162
237
|
|
|
163
238
|
// Infer the necessary data from valid bid for a minimal ttxRequest and create HTTP request
|
|
164
|
-
|
|
165
|
-
function _createServerRequest({bidRequest, gdprConsent = {}, uspConsent, pageUrl}) {
|
|
239
|
+
function _createServerRequest({ bidRequests, gdprConsent = {}, uspConsent, pageUrl, ttxSettings }) {
|
|
166
240
|
const ttxRequest = {};
|
|
167
|
-
const
|
|
241
|
+
const { siteId, test } = bidRequests[0].params;
|
|
168
242
|
|
|
169
243
|
/*
|
|
170
244
|
* Infer data for the request payload
|
|
171
245
|
*/
|
|
172
|
-
ttxRequest.imp = [
|
|
246
|
+
ttxRequest.imp = [];
|
|
173
247
|
|
|
174
|
-
|
|
175
|
-
ttxRequest.imp
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
if (deepAccess(bidRequest, 'mediaTypes.video')) {
|
|
181
|
-
ttxRequest.imp[0].video = _buildVideoORTB(bidRequest);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
ttxRequest.imp[0].ext = {
|
|
185
|
-
ttx: {
|
|
186
|
-
prod: _getProduct(bidRequest)
|
|
187
|
-
}
|
|
188
|
-
};
|
|
248
|
+
bidRequests.forEach((req) => {
|
|
249
|
+
ttxRequest.imp.push(_buildImpORTB(req));
|
|
250
|
+
});
|
|
189
251
|
|
|
190
|
-
ttxRequest.site = { id:
|
|
252
|
+
ttxRequest.site = { id: siteId };
|
|
191
253
|
|
|
192
254
|
if (pageUrl) {
|
|
193
255
|
ttxRequest.site.page = pageUrl;
|
|
194
256
|
}
|
|
195
257
|
|
|
196
|
-
|
|
197
|
-
// therefore in ad targetting process
|
|
198
|
-
ttxRequest.id = bidRequest.bidId;
|
|
258
|
+
ttxRequest.id = bidRequests[0].auctionId;
|
|
199
259
|
|
|
200
260
|
if (gdprConsent.consentString) {
|
|
201
|
-
ttxRequest.user =
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
gdprConsent.consentString
|
|
205
|
-
)
|
|
261
|
+
ttxRequest.user = setExtensions(ttxRequest.user, {
|
|
262
|
+
'consent': gdprConsent.consentString
|
|
263
|
+
});
|
|
206
264
|
}
|
|
207
265
|
|
|
208
|
-
if (Array.isArray(
|
|
209
|
-
ttxRequest.user =
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
bidRequest.userIdAsEids
|
|
213
|
-
)
|
|
266
|
+
if (Array.isArray(bidRequests[0].userIdAsEids) && bidRequests[0].userIdAsEids.length > 0) {
|
|
267
|
+
ttxRequest.user = setExtensions(ttxRequest.user, {
|
|
268
|
+
'eids': bidRequests[0].userIdAsEids
|
|
269
|
+
});
|
|
214
270
|
}
|
|
215
271
|
|
|
216
|
-
ttxRequest.regs =
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
Number(gdprConsent.gdprApplies)
|
|
220
|
-
);
|
|
272
|
+
ttxRequest.regs = setExtensions(ttxRequest.regs, {
|
|
273
|
+
'gdpr': Number(gdprConsent.gdprApplies)
|
|
274
|
+
});
|
|
221
275
|
|
|
222
276
|
if (uspConsent) {
|
|
223
|
-
ttxRequest.regs =
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
uspConsent
|
|
227
|
-
)
|
|
277
|
+
ttxRequest.regs = setExtensions(ttxRequest.regs, {
|
|
278
|
+
'us_privacy': uspConsent
|
|
279
|
+
});
|
|
228
280
|
}
|
|
229
281
|
|
|
230
282
|
ttxRequest.ext = {
|
|
@@ -237,16 +289,14 @@ function _createServerRequest({bidRequest, gdprConsent = {}, uspConsent, pageUrl
|
|
|
237
289
|
}
|
|
238
290
|
};
|
|
239
291
|
|
|
240
|
-
if (
|
|
241
|
-
ttxRequest.source =
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
bidRequest.schain
|
|
245
|
-
)
|
|
292
|
+
if (bidRequests[0].schain) {
|
|
293
|
+
ttxRequest.source = setExtensions(ttxRequest.source, {
|
|
294
|
+
'schain': bidRequests[0].schain
|
|
295
|
+
});
|
|
246
296
|
}
|
|
247
297
|
|
|
248
298
|
// Finally, set the openRTB 'test' param if this is to be a test bid
|
|
249
|
-
if (
|
|
299
|
+
if (test === 1) {
|
|
250
300
|
ttxRequest.test = 1;
|
|
251
301
|
}
|
|
252
302
|
|
|
@@ -259,8 +309,7 @@ function _createServerRequest({bidRequest, gdprConsent = {}, uspConsent, pageUrl
|
|
|
259
309
|
};
|
|
260
310
|
|
|
261
311
|
// Allow the ability to configure the HB endpoint for testing purposes.
|
|
262
|
-
const
|
|
263
|
-
const url = (ttxSettings && ttxSettings.url) || `${END_POINT}?guid=${params.siteId}`;
|
|
312
|
+
const url = (ttxSettings && ttxSettings.url) || `${END_POINT}?guid=${siteId}`;
|
|
264
313
|
|
|
265
314
|
// Return the server request
|
|
266
315
|
return {
|
|
@@ -272,14 +321,36 @@ function _createServerRequest({bidRequest, gdprConsent = {}, uspConsent, pageUrl
|
|
|
272
321
|
}
|
|
273
322
|
|
|
274
323
|
// BUILD REQUESTS: SET EXTENSIONS
|
|
275
|
-
function
|
|
276
|
-
return
|
|
277
|
-
ext:
|
|
278
|
-
[key]: value
|
|
279
|
-
})
|
|
324
|
+
function setExtensions(obj = {}, extFields) {
|
|
325
|
+
return mergeDeep({}, obj, {
|
|
326
|
+
'ext': extFields
|
|
280
327
|
});
|
|
281
328
|
}
|
|
282
329
|
|
|
330
|
+
// BUILD REQUESTS: IMP
|
|
331
|
+
function _buildImpORTB(bidRequest) {
|
|
332
|
+
const imp = {
|
|
333
|
+
id: bidRequest.bidId,
|
|
334
|
+
ext: {
|
|
335
|
+
ttx: {
|
|
336
|
+
prod: deepAccess(bidRequest, 'params.productId')
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
if (deepAccess(bidRequest, 'mediaTypes.banner')) {
|
|
342
|
+
imp.banner = {
|
|
343
|
+
..._buildBannerORTB(bidRequest)
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (deepAccess(bidRequest, 'mediaTypes.video')) {
|
|
348
|
+
imp.video = _buildVideoORTB(bidRequest);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
return imp;
|
|
352
|
+
}
|
|
353
|
+
|
|
283
354
|
// BUILD REQUESTS: SIZE INFERENCE
|
|
284
355
|
function _transformSizes(sizes) {
|
|
285
356
|
if (isArray(sizes) && sizes.length === 2 && !isArray(sizes[0])) {
|
|
@@ -297,6 +368,14 @@ function _getSize(size) {
|
|
|
297
368
|
}
|
|
298
369
|
|
|
299
370
|
// BUILD REQUESTS: PRODUCT INFERENCE
|
|
371
|
+
function _inferProduct(bidRequest) {
|
|
372
|
+
return mergeDeep({}, bidRequest, {
|
|
373
|
+
params: {
|
|
374
|
+
productId: _getProduct(bidRequest)
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
|
|
300
379
|
function _getProduct(bidRequest) {
|
|
301
380
|
const { params, mediaTypes } = bidRequest;
|
|
302
381
|
|
|
@@ -367,7 +446,7 @@ function _buildVideoORTB(bidRequest) {
|
|
|
367
446
|
|
|
368
447
|
const video = {}
|
|
369
448
|
|
|
370
|
-
const {w, h} = _getSize(videoParams.playerSize[0]);
|
|
449
|
+
const { w, h } = _getSize(videoParams.playerSize[0]);
|
|
371
450
|
video.w = w;
|
|
372
451
|
video.h = h;
|
|
373
452
|
|
|
@@ -388,11 +467,11 @@ function _buildVideoORTB(bidRequest) {
|
|
|
388
467
|
if (product === PRODUCT.INSTREAM) {
|
|
389
468
|
video.startdelay = video.startdelay || 0;
|
|
390
469
|
video.placement = 1;
|
|
391
|
-
}
|
|
470
|
+
}
|
|
392
471
|
|
|
393
472
|
// bidfloors
|
|
394
473
|
if (typeof bidRequest.getFloor === 'function') {
|
|
395
|
-
const bidfloors = _getBidFloors(bidRequest, {w: video.w, h: video.h}, VIDEO);
|
|
474
|
+
const bidfloors = _getBidFloors(bidRequest, { w: video.w, h: video.h }, VIDEO);
|
|
396
475
|
|
|
397
476
|
if (bidfloors) {
|
|
398
477
|
Object.assign(video, {
|
|
@@ -404,6 +483,7 @@ function _buildVideoORTB(bidRequest) {
|
|
|
404
483
|
});
|
|
405
484
|
}
|
|
406
485
|
}
|
|
486
|
+
|
|
407
487
|
return video;
|
|
408
488
|
}
|
|
409
489
|
|
|
@@ -556,54 +636,61 @@ function _isIframe() {
|
|
|
556
636
|
}
|
|
557
637
|
|
|
558
638
|
// **************************** INTERPRET RESPONSE ******************************** //
|
|
559
|
-
// NOTE: At this point, the response from 33exchange will only ever contain one bid
|
|
560
|
-
// i.e. the highest bid
|
|
561
639
|
function interpretResponse(serverResponse, bidRequest) {
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
640
|
+
const { seatbid, cur = 'USD' } = serverResponse.body;
|
|
641
|
+
|
|
642
|
+
if (!isArray(seatbid)) {
|
|
643
|
+
return [];
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
// Pick seats with valid bids and convert them into an Array of responses
|
|
647
|
+
// in format expected by Prebid Core
|
|
648
|
+
return seatbid
|
|
649
|
+
.filter((seat) => (
|
|
650
|
+
isArray(seat.bid) &&
|
|
651
|
+
seat.bid.length > 0
|
|
652
|
+
))
|
|
653
|
+
.reduce((acc, seat) => {
|
|
654
|
+
return acc.concat(
|
|
655
|
+
seat.bid.map((bid) => _createBidResponse(bid, cur))
|
|
656
|
+
);
|
|
657
|
+
}, []);
|
|
570
658
|
}
|
|
571
659
|
|
|
572
|
-
|
|
573
|
-
function _createBidResponse(response) {
|
|
660
|
+
function _createBidResponse(bid, cur) {
|
|
574
661
|
const isADomainPresent =
|
|
575
|
-
|
|
576
|
-
const
|
|
577
|
-
requestId:
|
|
662
|
+
bid.adomain && bid.adomain.length;
|
|
663
|
+
const bidResponse = {
|
|
664
|
+
requestId: bid.impid,
|
|
578
665
|
bidderCode: BIDDER_CODE,
|
|
579
|
-
cpm:
|
|
580
|
-
width:
|
|
581
|
-
height:
|
|
582
|
-
ad:
|
|
583
|
-
ttl:
|
|
584
|
-
creativeId:
|
|
585
|
-
mediaType: deepAccess(
|
|
586
|
-
currency:
|
|
666
|
+
cpm: bid.price,
|
|
667
|
+
width: bid.w,
|
|
668
|
+
height: bid.h,
|
|
669
|
+
ad: bid.adm,
|
|
670
|
+
ttl: bid.ttl || 60,
|
|
671
|
+
creativeId: bid.crid,
|
|
672
|
+
mediaType: deepAccess(bid, 'ext.ttx.mediaType', BANNER),
|
|
673
|
+
currency: cur,
|
|
587
674
|
netRevenue: true
|
|
588
675
|
}
|
|
589
676
|
|
|
590
677
|
if (isADomainPresent) {
|
|
591
|
-
|
|
592
|
-
advertiserDomains:
|
|
678
|
+
bidResponse.meta = {
|
|
679
|
+
advertiserDomains: bid.adomain
|
|
593
680
|
};
|
|
594
681
|
}
|
|
595
682
|
|
|
596
|
-
if (
|
|
597
|
-
const vastType = deepAccess(
|
|
683
|
+
if (bidResponse.mediaType === VIDEO) {
|
|
684
|
+
const vastType = deepAccess(bid, 'ext.ttx.vastType', 'xml');
|
|
598
685
|
|
|
599
686
|
if (vastType === 'xml') {
|
|
600
|
-
|
|
687
|
+
bidResponse.vastXml = bidResponse.ad;
|
|
601
688
|
} else {
|
|
602
|
-
|
|
689
|
+
bidResponse.vastUrl = bidResponse.ad;
|
|
603
690
|
}
|
|
604
691
|
}
|
|
605
692
|
|
|
606
|
-
return
|
|
693
|
+
return bidResponse;
|
|
607
694
|
}
|
|
608
695
|
|
|
609
696
|
// **************************** USER SYNC *************************** //
|
|
@@ -308,7 +308,7 @@ function getElementFromTopWindow(element, currentWindow) {
|
|
|
308
308
|
function autoDetectAdUnitElementIdFromGpt(adUnitCode) {
|
|
309
309
|
const autoDetectedAdUnit = getGptSlotInfoForAdUnitCode(adUnitCode);
|
|
310
310
|
|
|
311
|
-
if (autoDetectedAdUnit
|
|
311
|
+
if (autoDetectedAdUnit.divId) {
|
|
312
312
|
return autoDetectedAdUnit.divId;
|
|
313
313
|
}
|
|
314
314
|
};
|
|
@@ -19,6 +19,7 @@ export const spec = {
|
|
|
19
19
|
v: $$PREBID_GLOBAL$$.version,
|
|
20
20
|
auctionId: false,
|
|
21
21
|
pageId: false,
|
|
22
|
+
gdpr_applies: bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies ? bidderRequest.gdprConsent.gdprApplies : 'true',
|
|
22
23
|
gdpr_consent: bidderRequest.gdprConsent && bidderRequest.gdprConsent.consentString ? bidderRequest.gdprConsent.consentString : '',
|
|
23
24
|
referer: bidderRequest.refererInfo.referer,
|
|
24
25
|
bids: [],
|
|
@@ -108,6 +108,7 @@ export const spec = {
|
|
|
108
108
|
}
|
|
109
109
|
if (bid.userId) {
|
|
110
110
|
getUserId(placement.eids, bid.userId.uid2 && bid.userId.uid2.id, 'uidapi.com');
|
|
111
|
+
getUserId(placement.eids, bid.userId.lotamePanoramaId, 'lotame.com');
|
|
111
112
|
}
|
|
112
113
|
if (traff === VIDEO) {
|
|
113
114
|
placement.playerSize = bid.mediaTypes[VIDEO].playerSize;
|
|
@@ -4,7 +4,7 @@ import {config} from '../src/config.js';
|
|
|
4
4
|
import {BANNER, VIDEO, NATIVE} from '../src/mediaTypes.js';
|
|
5
5
|
|
|
6
6
|
const BIDDER_CODE = 'admixer';
|
|
7
|
-
const ALIASES = ['go2net', 'adblender', 'adsyield'];
|
|
7
|
+
const ALIASES = ['go2net', 'adblender', 'adsyield', 'futureads'];
|
|
8
8
|
const ENDPOINT_URL = 'https://inv-nets.admixer.net/prebid.1.2.aspx';
|
|
9
9
|
export const spec = {
|
|
10
10
|
code: BIDDER_CODE,
|
|
@@ -56,6 +56,8 @@ export const spec = {
|
|
|
56
56
|
const requests = [];
|
|
57
57
|
const request = [];
|
|
58
58
|
const ortb2 = config.getConfig('ortb2');
|
|
59
|
+
const bidderConfig = config.getConfig();
|
|
60
|
+
|
|
59
61
|
const adnMeta = handleMeta()
|
|
60
62
|
const usi = getUsi(adnMeta, ortb2, bidderRequest)
|
|
61
63
|
const segments = getSegmentsFromOrtb(ortb2);
|
|
@@ -68,7 +70,7 @@ export const spec = {
|
|
|
68
70
|
if (gdprApplies !== undefined) request.push('consentString=' + consentString);
|
|
69
71
|
if (segments.length > 0) request.push('segments=' + segments.join(','));
|
|
70
72
|
if (usi) request.push('userId=' + usi);
|
|
71
|
-
|
|
73
|
+
if (bidderConfig.useCookie === false) request.push('noCookies=true')
|
|
72
74
|
for (var i = 0; i < validBidRequests.length; i++) {
|
|
73
75
|
const bid = validBidRequests[i]
|
|
74
76
|
const network = bid.params.network || 'network';
|