prebid.js 5.18.0 → 6.1.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/.babelrc.js +1 -10
- package/README.md +3 -1
- package/browsers.json +1 -8
- package/gulpfile.js +1 -0
- package/integrationExamples/gpt/akamaidap_segments_example.html +132 -0
- package/modules/.submodules.json +1 -0
- package/modules/adfBidAdapter.js +21 -16
- package/modules/adheseBidAdapter.js +7 -2
- package/modules/adkernelBidAdapter.js +1 -0
- package/modules/adlivetechBidAdapter.md +61 -0
- package/modules/adomikAnalyticsAdapter.js +10 -4
- package/modules/adtelligentBidAdapter.js +2 -1
- package/modules/airgridRtdProvider.js +1 -1
- package/modules/akamaiDapRtdProvider.js +474 -0
- package/modules/akamaiDapRtdProvider.md +47 -0
- package/modules/appnexusBidAdapter.js +9 -3
- package/modules/atsAnalyticsAdapter.js +67 -46
- package/modules/atsAnalyticsAdapter.md +1 -0
- package/modules/betweenBidAdapter.js +20 -3
- package/modules/browsiRtdProvider.js +106 -18
- package/modules/cleanioRtdProvider.js +192 -0
- package/modules/cleanioRtdProvider.md +59 -0
- package/modules/codefuelBidAdapter.js +181 -0
- package/modules/codefuelBidAdapter.md +111 -0
- package/modules/connectIdSystem.js +104 -0
- package/modules/connectIdSystem.md +33 -0
- package/modules/datablocksBidAdapter.js +3 -3
- package/modules/deepintentBidAdapter.js +107 -10
- package/modules/deepintentBidAdapter.md +36 -1
- package/modules/deltaprojectsBidAdapter.js +252 -0
- package/modules/deltaprojectsBidAdapter.md +32 -0
- package/modules/engageyaBidAdapter.js +171 -0
- package/modules/glimpseBidAdapter.js +31 -16
- package/modules/gptPreAuction.js +11 -5
- package/modules/gridBidAdapter.js +1 -0
- package/modules/gumgumBidAdapter.js +8 -0
- package/modules/id5IdSystem.md +6 -6
- package/modules/imRtdProvider.js +31 -0
- package/modules/inskinBidAdapter.js +7 -3
- package/modules/ixBidAdapter.js +174 -22
- package/modules/jixieBidAdapter.js +8 -2
- package/modules/justpremiumBidAdapter.js +6 -1
- package/modules/limelightDigitalBidAdapter.js +22 -2
- package/modules/livewrappedAnalyticsAdapter.js +49 -1
- package/modules/merkleIdSystem.js +5 -0
- package/modules/multibid/index.js +3 -3
- package/modules/nativoBidAdapter.js +32 -2
- package/modules/nextMillenniumBidAdapter.js +12 -3
- package/modules/oguryBidAdapter.js +16 -2
- package/modules/openxBidAdapter.js +40 -23
- package/modules/operaadsBidAdapter.js +21 -1
- package/modules/otmBidAdapter.js +146 -0
- package/modules/otmBidAdapter.md +27 -26
- package/modules/outbrainBidAdapter.js +5 -0
- package/modules/playwireBidAdapter.md +61 -0
- package/modules/prebidServerBidAdapter/index.js +3 -3
- package/modules/publinkIdSystem.js +11 -6
- package/modules/pubmaticBidAdapter.js +2 -0
- package/modules/rtdModule/index.js +2 -2
- package/modules/saambaaBidAdapter.js +420 -0
- package/modules/saambaaBidAdapter.md +65 -68
- package/modules/seedtagBidAdapter.js +6 -0
- package/modules/smaatoBidAdapter.js +6 -1
- package/modules/sonobiBidAdapter.js +7 -0
- package/modules/sortableBidAdapter.js +1 -0
- package/modules/sspBCBidAdapter.js +34 -3
- package/modules/teadsBidAdapter.js +3 -0
- package/modules/tripleliftBidAdapter.js +22 -5
- package/modules/trustxBidAdapter.js +18 -7
- package/modules/undertoneBidAdapter.js +9 -5
- package/modules/undertoneBidAdapter.md +5 -1
- package/modules/userId/eids.js +18 -0
- package/modules/userId/eids.md +7 -0
- package/modules/userId/userId.md +12 -0
- package/modules/ventesBidAdapter.js +370 -0
- package/modules/ventesBidAdapter.md +94 -0
- package/modules/videobyteBidAdapter.js +13 -6
- package/modules/videobyteBidAdapter.md +49 -0
- package/modules/vidoomyBidAdapter.js +51 -100
- package/modules/visxBidAdapter.js +1 -1
- package/modules/yahoosspBidAdapter.js +6 -6
- package/modules/yieldlabBidAdapter.js +41 -10
- package/modules/yieldlabBidAdapter.md +91 -48
- package/modules/yieldmoSyntheticInventoryModule.js +46 -0
- package/modules/yieldmoSyntheticInventoryModule.md +68 -0
- package/package.json +6 -1
- package/src/adapterManager.js +19 -8
- package/src/adapters/bidderFactory.js +4 -3
- package/src/auction.js +11 -11
- package/src/constants.json +1 -0
- package/src/secureCreatives.js +6 -7
- package/src/targeting.js +11 -9
- package/test/spec/modules/adfBidAdapter_spec.js +83 -29
- package/test/spec/modules/adheseBidAdapter_spec.js +27 -1
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +3 -1
- package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
- package/test/spec/modules/akamaiDapRtdProvider_spec.js +246 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +16 -1
- package/test/spec/modules/atsAnalyticsAdapter_spec.js +42 -9
- package/test/spec/modules/betweenBidAdapter_spec.js +41 -0
- package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
- package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
- package/test/spec/modules/codefuelBidAdapter_spec.js +316 -0
- package/test/spec/modules/connectIdSystem_spec.js +189 -0
- package/test/spec/modules/datablocksBidAdapter_spec.js +3 -3
- package/test/spec/modules/deepintentBidAdapter_spec.js +153 -3
- package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
- package/test/spec/modules/engageyaBidAdapter_spec.js +422 -0
- package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
- package/test/spec/modules/glimpseBidAdapter_spec.js +33 -0
- package/test/spec/modules/gptPreAuction_spec.js +58 -4
- package/test/spec/modules/gumgumBidAdapter_spec.js +5 -1
- package/test/spec/modules/imRtdProvider_spec.js +25 -0
- package/test/spec/modules/ixBidAdapter_spec.js +298 -5
- package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
- package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
- package/test/spec/modules/konduitWrapper_spec.js +0 -1
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +155 -1
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +52 -7
- package/test/spec/modules/merkleIdSystem_spec.js +18 -0
- package/test/spec/modules/multibid_spec.js +31 -31
- package/test/spec/modules/nativoBidAdapter_spec.js +35 -18
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +13 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +66 -23
- package/test/spec/modules/openxBidAdapter_spec.js +90 -13
- package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
- package/test/spec/modules/otmBidAdapter_spec.js +67 -0
- package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
- package/test/spec/modules/prebidServerBidAdapter_spec.js +19 -2
- package/test/spec/modules/publinkIdSystem_spec.js +6 -6
- package/test/spec/modules/seedtagBidAdapter_spec.js +3 -0
- package/test/spec/modules/smaatoBidAdapter_spec.js +30 -0
- package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
- package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
- package/test/spec/modules/sspBCBidAdapter_spec.js +33 -3
- package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +128 -0
- package/test/spec/modules/trustxBidAdapter_spec.js +45 -3
- package/test/spec/modules/undertoneBidAdapter_spec.js +52 -0
- package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
- package/test/spec/modules/videobyteBidAdapter_spec.js +2 -2
- package/test/spec/modules/vidoomyBidAdapter_spec.js +32 -13
- package/test/spec/modules/visxBidAdapter_spec.js +1 -1
- package/test/spec/modules/yieldlabBidAdapter_spec.js +81 -0
- package/test/spec/modules/yieldmoSyntheticInventoryModule_spec.js +89 -0
- package/test/spec/unit/core/adapterManager_spec.js +56 -6
- package/test/spec/unit/core/bidderFactory_spec.js +61 -1
- package/test/spec/unit/pbjs_api_spec.js +37 -2
- package/test/spec/unit/secureCreatives_spec.js +54 -25
- package/wdio.conf.js +1 -1
|
@@ -299,6 +299,160 @@ describe('limelightDigitalAdapter', function () {
|
|
|
299
299
|
expect(spec.interpretResponse(bidResponses)).to.deep.equal([ resObject ]);
|
|
300
300
|
});
|
|
301
301
|
});
|
|
302
|
+
describe('getUserSyncs', function () {
|
|
303
|
+
const serverResponses = [
|
|
304
|
+
{
|
|
305
|
+
body: [
|
|
306
|
+
{
|
|
307
|
+
ext: {
|
|
308
|
+
sync: {
|
|
309
|
+
iframe: 'iframeUrl',
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
ext: {
|
|
315
|
+
sync: {
|
|
316
|
+
pixel: 'pixelUrl'
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
{},
|
|
321
|
+
{
|
|
322
|
+
ext: {}
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
ext: {
|
|
326
|
+
sync: {}
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
ext: {
|
|
331
|
+
sync: {
|
|
332
|
+
iframe: 'iframeUrl2',
|
|
333
|
+
pixel: 'pixelUrl3'
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
]
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
body: [
|
|
341
|
+
{
|
|
342
|
+
ext: {
|
|
343
|
+
sync: {
|
|
344
|
+
iframe: 'iframeUrl2',
|
|
345
|
+
pixel: 'pixelUrl2'
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
ext: {
|
|
351
|
+
sync: {
|
|
352
|
+
iframe: 'iframeUrl3',
|
|
353
|
+
pixel: 'pixelUrl3'
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
]
|
|
358
|
+
}
|
|
359
|
+
];
|
|
360
|
+
it('should return empty array if server responses do not contain sync urls', function () {
|
|
361
|
+
const syncOptions = {
|
|
362
|
+
iframeEnabled: true,
|
|
363
|
+
pixelEnabled: true
|
|
364
|
+
};
|
|
365
|
+
const serverResponsesWithoutSyncUrls = serverResponses.map(serverResponse => {
|
|
366
|
+
const serverResponseWithoutSyncUrls = Object.assign({}, serverResponse);
|
|
367
|
+
serverResponseWithoutSyncUrls.body = serverResponse.body.map(serverResponseBody => {
|
|
368
|
+
const serverResponseBodyWithoutSyncUrls = Object.assign({}, serverResponseBody);
|
|
369
|
+
delete serverResponseBodyWithoutSyncUrls.ext;
|
|
370
|
+
return serverResponseBodyWithoutSyncUrls;
|
|
371
|
+
});
|
|
372
|
+
return serverResponseWithoutSyncUrls;
|
|
373
|
+
});
|
|
374
|
+
expect(spec.getUserSyncs(syncOptions, serverResponsesWithoutSyncUrls)).to.be.an('array').that.is.empty;
|
|
375
|
+
});
|
|
376
|
+
it('should return empty array if all sync types are disabled', function () {
|
|
377
|
+
const syncOptions = {
|
|
378
|
+
iframeEnabled: false,
|
|
379
|
+
pixelEnabled: false
|
|
380
|
+
};
|
|
381
|
+
expect(spec.getUserSyncs(syncOptions, serverResponses)).to.be.an('array').that.is.empty;
|
|
382
|
+
});
|
|
383
|
+
it('should return iframe sync urls if iframe sync is enabled', function () {
|
|
384
|
+
const syncOptions = {
|
|
385
|
+
iframeEnabled: true,
|
|
386
|
+
pixelEnabled: false
|
|
387
|
+
};
|
|
388
|
+
expect(spec.getUserSyncs(syncOptions, serverResponses)).to.deep.equal([
|
|
389
|
+
{
|
|
390
|
+
type: 'iframe',
|
|
391
|
+
url: 'iframeUrl'
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
type: 'iframe',
|
|
395
|
+
url: 'iframeUrl2'
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
type: 'iframe',
|
|
399
|
+
url: 'iframeUrl3'
|
|
400
|
+
}
|
|
401
|
+
]);
|
|
402
|
+
});
|
|
403
|
+
it('should return image sync urls if pixel sync is enabled', function () {
|
|
404
|
+
const syncOptions = {
|
|
405
|
+
iframeEnabled: false,
|
|
406
|
+
pixelEnabled: true
|
|
407
|
+
};
|
|
408
|
+
expect(spec.getUserSyncs(syncOptions, serverResponses)).to.deep.equal([
|
|
409
|
+
{
|
|
410
|
+
type: 'image',
|
|
411
|
+
url: 'pixelUrl'
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
type: 'image',
|
|
415
|
+
url: 'pixelUrl3'
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
type: 'image',
|
|
419
|
+
url: 'pixelUrl2'
|
|
420
|
+
}
|
|
421
|
+
]);
|
|
422
|
+
});
|
|
423
|
+
it('should return all sync urls if all sync types are enabled', function () {
|
|
424
|
+
const syncOptions = {
|
|
425
|
+
iframeEnabled: true,
|
|
426
|
+
pixelEnabled: true
|
|
427
|
+
}
|
|
428
|
+
expect(spec.getUserSyncs(syncOptions, serverResponses)).to.deep.equal([
|
|
429
|
+
{
|
|
430
|
+
type: 'iframe',
|
|
431
|
+
url: 'iframeUrl'
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
type: 'iframe',
|
|
435
|
+
url: 'iframeUrl2'
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
type: 'iframe',
|
|
439
|
+
url: 'iframeUrl3'
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
type: 'image',
|
|
443
|
+
url: 'pixelUrl'
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
type: 'image',
|
|
447
|
+
url: 'pixelUrl3'
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
type: 'image',
|
|
451
|
+
url: 'pixelUrl2'
|
|
452
|
+
}
|
|
453
|
+
]);
|
|
454
|
+
});
|
|
455
|
+
});
|
|
302
456
|
});
|
|
303
457
|
|
|
304
458
|
function validateAdUnit(adUnit, bid) {
|
|
@@ -323,5 +477,5 @@ function validateAdUnit(adUnit, bid) {
|
|
|
323
477
|
width: size[0],
|
|
324
478
|
height: size[1]
|
|
325
479
|
}
|
|
326
|
-
}))
|
|
480
|
+
}));
|
|
327
481
|
}
|
|
@@ -2,6 +2,7 @@ import livewrappedAnalyticsAdapter, { BID_WON_TIMEOUT } from 'modules/livewrappe
|
|
|
2
2
|
import CONSTANTS from 'src/constants.json';
|
|
3
3
|
import { config } from 'src/config.js';
|
|
4
4
|
import { server } from 'test/mocks/xhr.js';
|
|
5
|
+
import { setConfig } from 'modules/currency.js';
|
|
5
6
|
|
|
6
7
|
let events = require('src/events');
|
|
7
8
|
let utils = require('src/utils');
|
|
@@ -16,7 +17,8 @@ const {
|
|
|
16
17
|
BIDDER_DONE,
|
|
17
18
|
BID_WON,
|
|
18
19
|
BID_TIMEOUT,
|
|
19
|
-
SET_TARGETING
|
|
20
|
+
SET_TARGETING,
|
|
21
|
+
AD_RENDER_FAILED
|
|
20
22
|
},
|
|
21
23
|
STATUS: {
|
|
22
24
|
GOOD
|
|
@@ -27,6 +29,9 @@ const BID1 = {
|
|
|
27
29
|
width: 980,
|
|
28
30
|
height: 240,
|
|
29
31
|
cpm: 1.1,
|
|
32
|
+
originalCpm: 12.0,
|
|
33
|
+
currency: 'USD',
|
|
34
|
+
originalCurrency: 'FOO',
|
|
30
35
|
timeToRespond: 200,
|
|
31
36
|
bidId: '2ecff0db240757',
|
|
32
37
|
requestId: '2ecff0db240757',
|
|
@@ -42,6 +47,9 @@ const BID2 = Object.assign({}, BID1, {
|
|
|
42
47
|
width: 300,
|
|
43
48
|
height: 250,
|
|
44
49
|
cpm: 2.2,
|
|
50
|
+
originalCpm: 23.0,
|
|
51
|
+
currency: 'USD',
|
|
52
|
+
originalCurrency: 'FOO',
|
|
45
53
|
timeToRespond: 300,
|
|
46
54
|
bidId: '3ecff0db240757',
|
|
47
55
|
requestId: '3ecff0db240757',
|
|
@@ -115,6 +123,14 @@ const MOCK = {
|
|
|
115
123
|
'bidId': '2ecff0db240757',
|
|
116
124
|
'auctionId': '25c6d7f5-699a-4bfc-87c9-996f915341fa'
|
|
117
125
|
}
|
|
126
|
+
],
|
|
127
|
+
AD_RENDER_FAILED: [
|
|
128
|
+
{
|
|
129
|
+
'bidId': '2ecff0db240757',
|
|
130
|
+
'reason': CONSTANTS.AD_RENDER_FAILED_REASON.CANNOT_FIND_AD,
|
|
131
|
+
'message': 'message',
|
|
132
|
+
'bid': BID1
|
|
133
|
+
}
|
|
118
134
|
]
|
|
119
135
|
};
|
|
120
136
|
|
|
@@ -169,6 +185,7 @@ const ANALYTICS_MESSAGE = {
|
|
|
169
185
|
width: 980,
|
|
170
186
|
height: 240,
|
|
171
187
|
cpm: 1.1,
|
|
188
|
+
orgCpm: 120,
|
|
172
189
|
ttr: 200,
|
|
173
190
|
IsBid: true,
|
|
174
191
|
mediaType: 1,
|
|
@@ -183,6 +200,7 @@ const ANALYTICS_MESSAGE = {
|
|
|
183
200
|
width: 300,
|
|
184
201
|
height: 250,
|
|
185
202
|
cpm: 2.2,
|
|
203
|
+
orgCpm: 230,
|
|
186
204
|
ttr: 300,
|
|
187
205
|
IsBid: true,
|
|
188
206
|
mediaType: 1,
|
|
@@ -210,6 +228,7 @@ const ANALYTICS_MESSAGE = {
|
|
|
210
228
|
width: 980,
|
|
211
229
|
height: 240,
|
|
212
230
|
cpm: 1.1,
|
|
231
|
+
orgCpm: 120,
|
|
213
232
|
mediaType: 1,
|
|
214
233
|
gdpr: 0,
|
|
215
234
|
auctionId: 0
|
|
@@ -222,10 +241,22 @@ const ANALYTICS_MESSAGE = {
|
|
|
222
241
|
width: 300,
|
|
223
242
|
height: 250,
|
|
224
243
|
cpm: 2.2,
|
|
244
|
+
orgCpm: 230,
|
|
225
245
|
mediaType: 1,
|
|
226
246
|
gdpr: 0,
|
|
227
247
|
auctionId: 0
|
|
228
248
|
}
|
|
249
|
+
],
|
|
250
|
+
rf: [
|
|
251
|
+
{
|
|
252
|
+
timeStamp: 1519149562216,
|
|
253
|
+
adUnit: 'panorama_d_1',
|
|
254
|
+
adUnitId: 'adunitid',
|
|
255
|
+
bidder: 'livewrapped',
|
|
256
|
+
auctionId: 0,
|
|
257
|
+
rsn: CONSTANTS.AD_RENDER_FAILED_REASON.CANNOT_FIND_AD,
|
|
258
|
+
msg: 'message'
|
|
259
|
+
},
|
|
229
260
|
]
|
|
230
261
|
};
|
|
231
262
|
|
|
@@ -239,6 +270,7 @@ function performStandardAuction() {
|
|
|
239
270
|
events.emit(SET_TARGETING, MOCK.SET_TARGETING);
|
|
240
271
|
events.emit(BID_WON, MOCK.BID_WON[0]);
|
|
241
272
|
events.emit(BID_WON, MOCK.BID_WON[1]);
|
|
273
|
+
events.emit(AD_RENDER_FAILED, MOCK.AD_RENDER_FAILED[0]);
|
|
242
274
|
}
|
|
243
275
|
|
|
244
276
|
describe('Livewrapped analytics adapter', function () {
|
|
@@ -258,6 +290,14 @@ describe('Livewrapped analytics adapter', function () {
|
|
|
258
290
|
sandbox.stub(document, 'getElementById').returns(element);
|
|
259
291
|
|
|
260
292
|
clock = sandbox.useFakeTimers(1519767013781);
|
|
293
|
+
setConfig({
|
|
294
|
+
adServerCurrency: 'USD',
|
|
295
|
+
rates: {
|
|
296
|
+
USD: {
|
|
297
|
+
FOO: 0.1
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
});
|
|
261
301
|
});
|
|
262
302
|
|
|
263
303
|
afterEach(function () {
|
|
@@ -300,7 +340,7 @@ describe('Livewrapped analytics adapter', function () {
|
|
|
300
340
|
expect(message).to.deep.equal(ANALYTICS_MESSAGE);
|
|
301
341
|
});
|
|
302
342
|
|
|
303
|
-
it('should send batched message without BID_WON if necessary and further BID_WON events individually', function () {
|
|
343
|
+
it('should send batched message without BID_WON AND AD_RENDER_FAILED if necessary and further BID_WON and AD_RENDER_FAILED events individually', function () {
|
|
304
344
|
events.emit(AUCTION_INIT, MOCK.AUCTION_INIT);
|
|
305
345
|
events.emit(BID_REQUESTED, MOCK.BID_REQUESTED);
|
|
306
346
|
events.emit(BID_RESPONSE, MOCK.BID_RESPONSE[0]);
|
|
@@ -313,8 +353,9 @@ describe('Livewrapped analytics adapter', function () {
|
|
|
313
353
|
clock.tick(BID_WON_TIMEOUT + 1000);
|
|
314
354
|
|
|
315
355
|
events.emit(BID_WON, MOCK.BID_WON[1]);
|
|
356
|
+
events.emit(AD_RENDER_FAILED, MOCK.AD_RENDER_FAILED[0]);
|
|
316
357
|
|
|
317
|
-
expect(server.requests.length).to.equal(
|
|
358
|
+
expect(server.requests.length).to.equal(3);
|
|
318
359
|
|
|
319
360
|
let message = JSON.parse(server.requests[0].requestBody);
|
|
320
361
|
expect(message.wins.length).to.equal(1);
|
|
@@ -324,6 +365,10 @@ describe('Livewrapped analytics adapter', function () {
|
|
|
324
365
|
message = JSON.parse(server.requests[1].requestBody);
|
|
325
366
|
expect(message.wins.length).to.equal(1);
|
|
326
367
|
expect(message.wins[0]).to.deep.equal(ANALYTICS_MESSAGE.wins[1]);
|
|
368
|
+
|
|
369
|
+
message = JSON.parse(server.requests[2].requestBody);
|
|
370
|
+
expect(message.rf.length).to.equal(1);
|
|
371
|
+
expect(message.rf[0]).to.deep.equal(ANALYTICS_MESSAGE.rf[0]);
|
|
327
372
|
});
|
|
328
373
|
|
|
329
374
|
it('should properly mark bids as timed out', function () {
|
|
@@ -427,7 +472,7 @@ describe('Livewrapped analytics adapter', function () {
|
|
|
427
472
|
{
|
|
428
473
|
'floorData': {
|
|
429
474
|
'floorValue': 1.1,
|
|
430
|
-
'floorCurrency': '
|
|
475
|
+
'floorCurrency': 'FOO'
|
|
431
476
|
}
|
|
432
477
|
}));
|
|
433
478
|
events.emit(BID_WON, Object.assign({},
|
|
@@ -435,7 +480,7 @@ describe('Livewrapped analytics adapter', function () {
|
|
|
435
480
|
{
|
|
436
481
|
'floorData': {
|
|
437
482
|
'floorValue': 1.1,
|
|
438
|
-
'floorCurrency': '
|
|
483
|
+
'floorCurrency': 'FOO'
|
|
439
484
|
}
|
|
440
485
|
}));
|
|
441
486
|
events.emit(AUCTION_END, MOCK.AUCTION_END);
|
|
@@ -450,11 +495,11 @@ describe('Livewrapped analytics adapter', function () {
|
|
|
450
495
|
|
|
451
496
|
expect(message.responses.length).to.equal(1);
|
|
452
497
|
expect(message.responses[0].floor).to.equal(1.1);
|
|
453
|
-
expect(message.responses[0].floorCur).to.equal('
|
|
498
|
+
expect(message.responses[0].floorCur).to.equal('FOO');
|
|
454
499
|
|
|
455
500
|
expect(message.wins.length).to.equal(1);
|
|
456
501
|
expect(message.wins[0].floor).to.equal(1.1);
|
|
457
|
-
expect(message.wins[0].floorCur).to.equal('
|
|
502
|
+
expect(message.wins[0].floorCur).to.equal('FOO');
|
|
458
503
|
});
|
|
459
504
|
|
|
460
505
|
it('should forward Livewrapped floor data', function () {
|
|
@@ -192,6 +192,24 @@ describe('Merkle System', function () {
|
|
|
192
192
|
|
|
193
193
|
expect(id.id).to.exist.and.to.equal(storedId);
|
|
194
194
|
});
|
|
195
|
+
it('extendId() should warn on missing endpoint', function () {
|
|
196
|
+
let config = {
|
|
197
|
+
params: {
|
|
198
|
+
...CONFIG_PARAMS,
|
|
199
|
+
endpoint: undefined
|
|
200
|
+
},
|
|
201
|
+
storage: STORAGE_PARAMS
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
let yesterday = new Date(Date.now() - 86400000).toUTCString();
|
|
205
|
+
let storedId = {value: 'Merkle_Stored_ID', date: yesterday};
|
|
206
|
+
|
|
207
|
+
let submoduleCallback = merkleIdSubmodule.extendId(config, undefined,
|
|
208
|
+
storedId).callback;
|
|
209
|
+
submoduleCallback(callbackSpy);
|
|
210
|
+
expect(callbackSpy.calledOnce).to.be.true;
|
|
211
|
+
expect(utils.logWarn.args[0][0]).to.exist.and.to.equal('User ID - merkleId submodule endpoint string is not defined');
|
|
212
|
+
});
|
|
195
213
|
|
|
196
214
|
it('extendId() callback on configured storageParam.refreshInSeconds', function () {
|
|
197
215
|
let config = {
|
|
@@ -82,7 +82,7 @@ describe('multibid adapter', function () {
|
|
|
82
82
|
'sizes': [[300, 250]]
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
'adUnitCode': 'test
|
|
85
|
+
'adUnitCode': 'test.div',
|
|
86
86
|
'transactionId': 'c153f3da-84f0-4be8-95cb-0647c458bc60',
|
|
87
87
|
'sizes': [[300, 250]],
|
|
88
88
|
'bidId': '2408ef83b84c9d',
|
|
@@ -106,7 +106,7 @@ describe('multibid adapter', function () {
|
|
|
106
106
|
'sizes': [[300, 250]]
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
|
-
'adUnitCode': 'test
|
|
109
|
+
'adUnitCode': 'test.div',
|
|
110
110
|
'transactionId': 'c153f3da-84f0-4be8-95cb-0647c458bc60',
|
|
111
111
|
'sizes': [[300, 250]],
|
|
112
112
|
'bidId': '2408ef83b84c9d',
|
|
@@ -197,14 +197,14 @@ describe('multibid adapter', function () {
|
|
|
197
197
|
});
|
|
198
198
|
|
|
199
199
|
it('adds original bids and does not modify', function () {
|
|
200
|
-
let adUnitCode = 'test
|
|
200
|
+
let adUnitCode = 'test.div';
|
|
201
201
|
let bids = [{...bidArray[0]}, {...bidArray[1]}];
|
|
202
202
|
|
|
203
203
|
addBidResponseHook(callbackFn, adUnitCode, {...bids[0]});
|
|
204
204
|
|
|
205
205
|
expect(result).to.not.equal(null);
|
|
206
206
|
expect(result.adUnitCode).to.not.equal(null);
|
|
207
|
-
expect(result.adUnitCode).to.equal('test
|
|
207
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
208
208
|
expect(result.bid).to.not.equal(null);
|
|
209
209
|
expect(result.bid).to.deep.equal(bids[0]);
|
|
210
210
|
|
|
@@ -214,13 +214,13 @@ describe('multibid adapter', function () {
|
|
|
214
214
|
|
|
215
215
|
expect(result).to.not.equal(null);
|
|
216
216
|
expect(result.adUnitCode).to.not.equal(null);
|
|
217
|
-
expect(result.adUnitCode).to.equal('test
|
|
217
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
218
218
|
expect(result.bid).to.not.equal(null);
|
|
219
219
|
expect(result.bid).to.deep.equal(bids[1]);
|
|
220
220
|
});
|
|
221
221
|
|
|
222
222
|
it('modifies and adds both bids based on multibid configuration', function () {
|
|
223
|
-
let adUnitCode = 'test
|
|
223
|
+
let adUnitCode = 'test.div';
|
|
224
224
|
let bids = [{...bidArray[0]}, {...bidArray[1]}];
|
|
225
225
|
|
|
226
226
|
config.setConfig({multibid: [{bidder: 'bidderA', maxBids: 2, targetBiddercodePrefix: 'bidA'}]});
|
|
@@ -232,7 +232,7 @@ describe('multibid adapter', function () {
|
|
|
232
232
|
|
|
233
233
|
expect(result).to.not.equal(null);
|
|
234
234
|
expect(result.adUnitCode).to.not.equal(null);
|
|
235
|
-
expect(result.adUnitCode).to.equal('test
|
|
235
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
236
236
|
expect(result.bid).to.not.equal(null);
|
|
237
237
|
expect(result.bid).to.deep.equal(bids[0]);
|
|
238
238
|
|
|
@@ -250,13 +250,13 @@ describe('multibid adapter', function () {
|
|
|
250
250
|
|
|
251
251
|
expect(result).to.not.equal(null);
|
|
252
252
|
expect(result.adUnitCode).to.not.equal(null);
|
|
253
|
-
expect(result.adUnitCode).to.equal('test
|
|
253
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
254
254
|
expect(result.bid).to.not.equal(null);
|
|
255
255
|
expect(result.bid).to.deep.equal(bids[1]);
|
|
256
256
|
});
|
|
257
257
|
|
|
258
258
|
it('only modifies bids defined in the multibid configuration', function () {
|
|
259
|
-
let adUnitCode = 'test
|
|
259
|
+
let adUnitCode = 'test.div';
|
|
260
260
|
let bids = [{...bidArray[0]}, {...bidArray[1]}];
|
|
261
261
|
|
|
262
262
|
bids.push({
|
|
@@ -276,7 +276,7 @@ describe('multibid adapter', function () {
|
|
|
276
276
|
|
|
277
277
|
expect(result).to.not.equal(null);
|
|
278
278
|
expect(result.adUnitCode).to.not.equal(null);
|
|
279
|
-
expect(result.adUnitCode).to.equal('test
|
|
279
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
280
280
|
expect(result.bid).to.not.equal(null);
|
|
281
281
|
expect(result.bid).to.deep.equal(bids[0]);
|
|
282
282
|
|
|
@@ -292,7 +292,7 @@ describe('multibid adapter', function () {
|
|
|
292
292
|
|
|
293
293
|
expect(result).to.not.equal(null);
|
|
294
294
|
expect(result.adUnitCode).to.not.equal(null);
|
|
295
|
-
expect(result.adUnitCode).to.equal('test
|
|
295
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
296
296
|
expect(result.bid).to.not.equal(null);
|
|
297
297
|
expect(result.bid).to.deep.equal(bids[1]);
|
|
298
298
|
|
|
@@ -302,13 +302,13 @@ describe('multibid adapter', function () {
|
|
|
302
302
|
|
|
303
303
|
expect(result).to.not.equal(null);
|
|
304
304
|
expect(result.adUnitCode).to.not.equal(null);
|
|
305
|
-
expect(result.adUnitCode).to.equal('test
|
|
305
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
306
306
|
expect(result.bid).to.not.equal(null);
|
|
307
307
|
expect(result.bid).to.deep.equal(bids[2]);
|
|
308
308
|
});
|
|
309
309
|
|
|
310
310
|
it('only modifies and returns bids under limit for a specifc bidder in the multibid configuration', function () {
|
|
311
|
-
let adUnitCode = 'test
|
|
311
|
+
let adUnitCode = 'test.div';
|
|
312
312
|
let bids = [{...bidArray[0]}, {...bidArray[1]}];
|
|
313
313
|
|
|
314
314
|
bids.push({
|
|
@@ -328,7 +328,7 @@ describe('multibid adapter', function () {
|
|
|
328
328
|
|
|
329
329
|
expect(result).to.not.equal(null);
|
|
330
330
|
expect(result.adUnitCode).to.not.equal(null);
|
|
331
|
-
expect(result.adUnitCode).to.equal('test
|
|
331
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
332
332
|
expect(result.bid).to.not.equal(null);
|
|
333
333
|
expect(result.bid).to.deep.equal(bids[0]);
|
|
334
334
|
|
|
@@ -344,7 +344,7 @@ describe('multibid adapter', function () {
|
|
|
344
344
|
|
|
345
345
|
expect(result).to.not.equal(null);
|
|
346
346
|
expect(result.adUnitCode).to.not.equal(null);
|
|
347
|
-
expect(result.adUnitCode).to.equal('test
|
|
347
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
348
348
|
expect(result.bid).to.not.equal(null);
|
|
349
349
|
expect(result.bid).to.deep.equal(bids[1]);
|
|
350
350
|
|
|
@@ -356,7 +356,7 @@ describe('multibid adapter', function () {
|
|
|
356
356
|
});
|
|
357
357
|
|
|
358
358
|
it('if no prefix in multibid configuration, modifies and returns bids under limit without preifx property', function () {
|
|
359
|
-
let adUnitCode = 'test
|
|
359
|
+
let adUnitCode = 'test.div';
|
|
360
360
|
let bids = [{...bidArray[0]}, {...bidArray[1]}];
|
|
361
361
|
|
|
362
362
|
bids.push({
|
|
@@ -375,7 +375,7 @@ describe('multibid adapter', function () {
|
|
|
375
375
|
|
|
376
376
|
expect(result).to.not.equal(null);
|
|
377
377
|
expect(result.adUnitCode).to.not.equal(null);
|
|
378
|
-
expect(result.adUnitCode).to.equal('test
|
|
378
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
379
379
|
expect(result.bid).to.not.equal(null);
|
|
380
380
|
expect(result.bid).to.deep.equal(bids[0]);
|
|
381
381
|
|
|
@@ -389,7 +389,7 @@ describe('multibid adapter', function () {
|
|
|
389
389
|
|
|
390
390
|
expect(result).to.not.equal(null);
|
|
391
391
|
expect(result.adUnitCode).to.not.equal(null);
|
|
392
|
-
expect(result.adUnitCode).to.equal('test
|
|
392
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
393
393
|
expect(result.bid).to.not.equal(null);
|
|
394
394
|
expect(result.bid).to.deep.equal(bids[1]);
|
|
395
395
|
|
|
@@ -401,7 +401,7 @@ describe('multibid adapter', function () {
|
|
|
401
401
|
});
|
|
402
402
|
|
|
403
403
|
it('does not include extra bids if cpm is less than floor value', function () {
|
|
404
|
-
let adUnitCode = 'test
|
|
404
|
+
let adUnitCode = 'test.div';
|
|
405
405
|
let bids = [{...bidArrayAlt[1]}, {...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}];
|
|
406
406
|
|
|
407
407
|
bids.map(bid => {
|
|
@@ -418,7 +418,7 @@ describe('multibid adapter', function () {
|
|
|
418
418
|
floorRuleValue: 65,
|
|
419
419
|
floorValue: 65,
|
|
420
420
|
matchedFields: {
|
|
421
|
-
gptSlot: 'test
|
|
421
|
+
gptSlot: 'test.div',
|
|
422
422
|
mediaType: 'banner'
|
|
423
423
|
}
|
|
424
424
|
}
|
|
@@ -435,7 +435,7 @@ describe('multibid adapter', function () {
|
|
|
435
435
|
|
|
436
436
|
expect(result).to.not.equal(null);
|
|
437
437
|
expect(result.adUnitCode).to.not.equal(null);
|
|
438
|
-
expect(result.adUnitCode).to.equal('test
|
|
438
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
439
439
|
expect(result.bid).to.not.equal(null);
|
|
440
440
|
expect(result.bid.bidder).to.equal('bidderA');
|
|
441
441
|
expect(result.bid.targetingBidder).to.equal(undefined);
|
|
@@ -452,7 +452,7 @@ describe('multibid adapter', function () {
|
|
|
452
452
|
|
|
453
453
|
expect(result).to.not.equal(null);
|
|
454
454
|
expect(result.adUnitCode).to.not.equal(null);
|
|
455
|
-
expect(result.adUnitCode).to.equal('test
|
|
455
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
456
456
|
expect(result.bid).to.not.equal(null);
|
|
457
457
|
expect(result.bid.bidder).to.equal('bidderB');
|
|
458
458
|
expect(result.bid.targetingBidder).to.equal(undefined);
|
|
@@ -463,14 +463,14 @@ describe('multibid adapter', function () {
|
|
|
463
463
|
|
|
464
464
|
expect(result).to.not.equal(null);
|
|
465
465
|
expect(result.adUnitCode).to.not.equal(null);
|
|
466
|
-
expect(result.adUnitCode).to.equal('test
|
|
466
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
467
467
|
expect(result.bid).to.not.equal(null);
|
|
468
468
|
expect(result.bid.bidder).to.equal('bidderC');
|
|
469
469
|
expect(result.bid.targetingBidder).to.equal(undefined);
|
|
470
470
|
});
|
|
471
471
|
|
|
472
472
|
it('does include extra bids if cpm is not less than floor value', function () {
|
|
473
|
-
let adUnitCode = 'test
|
|
473
|
+
let adUnitCode = 'test.div';
|
|
474
474
|
let bids = [{...bidArrayAlt[1]}, {...bidArrayAlt[0]}];
|
|
475
475
|
|
|
476
476
|
bids.map(bid => {
|
|
@@ -487,7 +487,7 @@ describe('multibid adapter', function () {
|
|
|
487
487
|
floorRuleValue: 25,
|
|
488
488
|
floorValue: 25,
|
|
489
489
|
matchedFields: {
|
|
490
|
-
gptSlot: 'test
|
|
490
|
+
gptSlot: 'test.div',
|
|
491
491
|
mediaType: 'banner'
|
|
492
492
|
}
|
|
493
493
|
}
|
|
@@ -504,7 +504,7 @@ describe('multibid adapter', function () {
|
|
|
504
504
|
|
|
505
505
|
expect(result).to.not.equal(null);
|
|
506
506
|
expect(result.adUnitCode).to.not.equal(null);
|
|
507
|
-
expect(result.adUnitCode).to.equal('test
|
|
507
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
508
508
|
expect(result.bid).to.not.equal(null);
|
|
509
509
|
expect(result.bid.bidder).to.equal('bidderA');
|
|
510
510
|
expect(result.bid.targetingBidder).to.equal(undefined);
|
|
@@ -518,7 +518,7 @@ describe('multibid adapter', function () {
|
|
|
518
518
|
|
|
519
519
|
expect(result).to.not.equal(null);
|
|
520
520
|
expect(result.adUnitCode).to.not.equal(null);
|
|
521
|
-
expect(result.adUnitCode).to.equal('test
|
|
521
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
522
522
|
expect(result.bid).to.not.equal(null);
|
|
523
523
|
expect(result.bid.bidder).to.equal('bidderA');
|
|
524
524
|
expect(result.bid.targetingBidder).to.equal('bidA2');
|
|
@@ -578,7 +578,7 @@ describe('multibid adapter', function () {
|
|
|
578
578
|
|
|
579
579
|
it('it sorts and creates dynamic alias on bidsReceived if multibid configuration found with prefix', function () {
|
|
580
580
|
let modifiedBids = [{...bidArray[1]}, {...bidArray[0]}].map(bid => {
|
|
581
|
-
addBidResponseHook(bidResponseCallback, 'test
|
|
581
|
+
addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
|
|
582
582
|
|
|
583
583
|
return bidResult;
|
|
584
584
|
});
|
|
@@ -603,7 +603,7 @@ describe('multibid adapter', function () {
|
|
|
603
603
|
|
|
604
604
|
it('it sorts by cpm treating dynamic alias as unique bid when no bid limit defined', function () {
|
|
605
605
|
let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
|
|
606
|
-
addBidResponseHook(bidResponseCallback, 'test
|
|
606
|
+
addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
|
|
607
607
|
|
|
608
608
|
return bidResult;
|
|
609
609
|
});
|
|
@@ -636,7 +636,7 @@ describe('multibid adapter', function () {
|
|
|
636
636
|
|
|
637
637
|
it('it should filter out dynamic bid when bid limit is less than unique bid pool', function () {
|
|
638
638
|
let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
|
|
639
|
-
addBidResponseHook(bidResponseCallback, 'test
|
|
639
|
+
addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
|
|
640
640
|
|
|
641
641
|
return bidResult;
|
|
642
642
|
});
|
|
@@ -662,7 +662,7 @@ describe('multibid adapter', function () {
|
|
|
662
662
|
config.setConfig({ multibid: [{bidder: 'bidderA', maxBids: 2, targetBiddercodePrefix: 'bidA'}] });
|
|
663
663
|
|
|
664
664
|
let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
|
|
665
|
-
addBidResponseHook(bidResponseCallback, 'test
|
|
665
|
+
addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
|
|
666
666
|
|
|
667
667
|
return bidResult;
|
|
668
668
|
});
|