prebid.js 6.2.0 → 6.6.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.
Files changed (169) hide show
  1. package/.circleci/config.yml +1 -1
  2. package/gulpfile.js +87 -82
  3. package/integrationExamples/gpt/weboramaRtdProvider_example.html +23 -14
  4. package/karma.conf.maker.js +1 -1
  5. package/modules/.submodules.json +2 -1
  6. package/modules/33acrossBidAdapter.js +189 -102
  7. package/modules/adagioBidAdapter.js +1 -1
  8. package/modules/addefendBidAdapter.js +1 -0
  9. package/modules/adkernelBidAdapter.js +148 -62
  10. package/modules/adlooxAdServerVideo.js +2 -2
  11. package/modules/adlooxAnalyticsAdapter.js +4 -4
  12. package/modules/admanBidAdapter.js +11 -4
  13. package/modules/admixerBidAdapter.js +1 -1
  14. package/modules/adnuntiusBidAdapter.js +3 -1
  15. package/modules/adomikAnalyticsAdapter.js +27 -9
  16. package/modules/adqueryIdSystem.js +103 -0
  17. package/modules/adqueryIdSystem.md +35 -0
  18. package/modules/adxcgBidAdapter.js +311 -359
  19. package/modules/adxcgBidAdapter.md +22 -21
  20. package/modules/adyoulikeBidAdapter.js +13 -9
  21. package/modules/aniviewBidAdapter.js +1 -1
  22. package/modules/appnexusBidAdapter.js +0 -1
  23. package/modules/beopBidAdapter.js +6 -4
  24. package/modules/bidViewability.js +3 -3
  25. package/modules/bidViewabilityIO.js +3 -3
  26. package/modules/bliinkBidAdapter.js +3 -2
  27. package/modules/colossussspBidAdapter.js +7 -0
  28. package/modules/compassBidAdapter.js +208 -0
  29. package/modules/compassBidAdapter.md +79 -0
  30. package/modules/consentManagement.js +7 -1
  31. package/modules/criteoBidAdapter.js +1 -1
  32. package/modules/criteoIdSystem.js +29 -7
  33. package/modules/currency.js +2 -2
  34. package/modules/cwireBidAdapter.js +3 -0
  35. package/modules/dailyhuntBidAdapter.js +435 -0
  36. package/modules/dailyhuntBidAdapter.md +4 -0
  37. package/modules/docereeBidAdapter.js +10 -1
  38. package/modules/docereeBidAdapter.md +2 -0
  39. package/modules/dspxBidAdapter.js +1 -1
  40. package/modules/engageyaBidAdapter.js +1 -1
  41. package/modules/feedadBidAdapter.js +2 -2
  42. package/modules/feedadBidAdapter.md +4 -2
  43. package/modules/futureads.md +48 -0
  44. package/modules/glimpseBidAdapter.js +82 -47
  45. package/modules/gptPreAuction.js +55 -7
  46. package/modules/gridBidAdapter.js +4 -3
  47. package/modules/gumgumBidAdapter.js +2 -2
  48. package/modules/idImportLibrary.js +45 -8
  49. package/modules/idImportLibrary.md +4 -0
  50. package/modules/improvedigitalBidAdapter.js +42 -4
  51. package/modules/instreamTracking.js +4 -4
  52. package/modules/invibesBidAdapter.js +49 -5
  53. package/modules/invibesBidAdapter.md +2 -1
  54. package/modules/ixBidAdapter.js +53 -18
  55. package/modules/kinessoIdSystem.js +1 -1
  56. package/modules/limelightDigitalBidAdapter.js +2 -1
  57. package/modules/livewrappedAnalyticsAdapter.js +3 -1
  58. package/modules/livewrappedBidAdapter.js +8 -2
  59. package/modules/loglyliftBidAdapter.js +79 -0
  60. package/modules/loglyliftBidAdapter.md +55 -0
  61. package/modules/lotamePanoramaIdSystem.js +80 -8
  62. package/modules/mediasquareBidAdapter.js +1 -9
  63. package/modules/nextMillenniumBidAdapter.js +39 -7
  64. package/modules/oguryBidAdapter.js +9 -2
  65. package/modules/onetagBidAdapter.js +4 -2
  66. package/modules/optimeraRtdProvider.js +8 -1
  67. package/modules/ozoneBidAdapter.js +21 -64
  68. package/modules/prebidServerBidAdapter/index.js +16 -12
  69. package/modules/proxistoreBidAdapter.js +0 -2
  70. package/modules/pubgeniusBidAdapter.js +1 -1
  71. package/modules/pubmaticAnalyticsAdapter.js +16 -0
  72. package/modules/pubxaiAnalyticsAdapter.js +17 -0
  73. package/modules/richaudienceBidAdapter.js +4 -4
  74. package/modules/riseBidAdapter.js +1 -1
  75. package/modules/rtbhouseBidAdapter.js +14 -4
  76. package/modules/rtdModule/index.js +49 -18
  77. package/modules/rubiconBidAdapter.js +31 -19
  78. package/modules/sharedIdSystem.js +27 -1
  79. package/modules/showheroes-bsBidAdapter.js +13 -2
  80. package/modules/tappxBidAdapter.js +8 -5
  81. package/modules/targetVideoBidAdapter.js +187 -0
  82. package/modules/targetVideoBidAdapter.md +34 -0
  83. package/modules/teadsBidAdapter.js +1 -2
  84. package/modules/telariaBidAdapter.js +2 -2
  85. package/modules/trustxBidAdapter.js +8 -16
  86. package/modules/userId/eids.js +7 -1
  87. package/modules/userId/userId.md +8 -0
  88. package/modules/vidoomyBidAdapter.js +16 -10
  89. package/modules/weboramaRtdProvider.js +288 -73
  90. package/modules/weboramaRtdProvider.md +27 -10
  91. package/modules/welectBidAdapter.js +106 -0
  92. package/modules/yahoosspBidAdapter.js +5 -1
  93. package/modules/yieldmoBidAdapter.js +23 -5
  94. package/modules/zetaSspBidAdapter.md +33 -1
  95. package/modules/zeta_global_sspAnalyticsAdapter.js +97 -0
  96. package/modules/zeta_global_sspAnalyticsAdapter.md +24 -0
  97. package/modules/zeta_global_sspBidAdapter.js +22 -1
  98. package/package.json +1 -1
  99. package/plugins/pbjsGlobals.js +28 -1
  100. package/src/auction.js +2 -2
  101. package/src/config.js +27 -3
  102. package/src/hook.js +5 -1
  103. package/src/prebid.js +21 -6
  104. package/src/targeting.js +22 -1
  105. package/src/utils.js +46 -8
  106. package/test/helpers/prebidGlobal.js +1 -0
  107. package/test/spec/config_spec.js +279 -0
  108. package/test/spec/modules/33acrossBidAdapter_spec.js +300 -78
  109. package/test/spec/modules/adlooxAnalyticsAdapter_spec.js +6 -6
  110. package/test/spec/modules/admanBidAdapter_spec.js +2 -2
  111. package/test/spec/modules/adnuntiusBidAdapter_spec.js +17 -0
  112. package/test/spec/modules/adomikAnalyticsAdapter_spec.js +9 -1
  113. package/test/spec/modules/adqueryIdSystem_spec.js +74 -0
  114. package/test/spec/modules/adxcgBidAdapter_spec.js +820 -571
  115. package/test/spec/modules/adyoulikeBidAdapter_spec.js +49 -0
  116. package/test/spec/modules/beopBidAdapter_spec.js +1 -1
  117. package/test/spec/modules/bidViewabilityIO_spec.js +2 -2
  118. package/test/spec/modules/bidViewability_spec.js +4 -4
  119. package/test/spec/modules/bliinkBidAdapter_spec.js +2 -0
  120. package/test/spec/modules/colossussspBidAdapter_spec.js +9 -0
  121. package/test/spec/modules/compassBidAdapter_spec.js +398 -0
  122. package/test/spec/modules/consentManagement_spec.js +20 -0
  123. package/test/spec/modules/criteoIdSystem_spec.js +6 -3
  124. package/test/spec/modules/cwireBidAdapter_spec.js +10 -8
  125. package/test/spec/modules/dailyhuntBidAdapter_spec.js +404 -0
  126. package/test/spec/modules/docereeBidAdapter_spec.js +9 -1
  127. package/test/spec/modules/eids_spec.js +15 -0
  128. package/test/spec/modules/feedadBidAdapter_spec.js +15 -0
  129. package/test/spec/modules/glimpseBidAdapter_spec.js +0 -18
  130. package/test/spec/modules/gptPreAuction_spec.js +177 -2
  131. package/test/spec/modules/idImportLibrary_spec.js +197 -10
  132. package/test/spec/modules/improvedigitalBidAdapter_spec.js +45 -1
  133. package/test/spec/modules/invibesBidAdapter_spec.js +119 -0
  134. package/test/spec/modules/ixBidAdapter_spec.js +112 -62
  135. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +75 -17
  136. package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +22 -0
  137. package/test/spec/modules/livewrappedBidAdapter_spec.js +31 -0
  138. package/test/spec/modules/loglyliftBidAdapter_spec.js +172 -0
  139. package/test/spec/modules/lotamePanoramaIdSystem_spec.js +227 -0
  140. package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -4
  141. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +26 -1
  142. package/test/spec/modules/oguryBidAdapter_spec.js +10 -2
  143. package/test/spec/modules/optimeraRtdProvider_spec.js +14 -1
  144. package/test/spec/modules/ozoneBidAdapter_spec.js +43 -31
  145. package/test/spec/modules/prebidServerBidAdapter_spec.js +43 -0
  146. package/test/spec/modules/pubgeniusBidAdapter_spec.js +3 -3
  147. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +13 -1
  148. package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +11 -0
  149. package/test/spec/modules/realTimeDataModule_spec.js +147 -48
  150. package/test/spec/modules/richaudienceBidAdapter_spec.js +42 -2
  151. package/test/spec/modules/riseBidAdapter_spec.js +1 -1
  152. package/test/spec/modules/rtbhouseBidAdapter_spec.js +20 -0
  153. package/test/spec/modules/rubiconBidAdapter_spec.js +65 -9
  154. package/test/spec/modules/sharedIdSystem_spec.js +52 -6
  155. package/test/spec/modules/showheroes-bsBidAdapter_spec.js +2 -0
  156. package/test/spec/modules/tappxBidAdapter_spec.js +0 -19
  157. package/test/spec/modules/targetVideoBidAdapter_spec.js +96 -0
  158. package/test/spec/modules/teadsBidAdapter_spec.js +14 -59
  159. package/test/spec/modules/userId_spec.js +68 -19
  160. package/test/spec/modules/weboramaRtdProvider_spec.js +408 -214
  161. package/test/spec/modules/welectBidAdapter_spec.js +211 -0
  162. package/test/spec/modules/yahoosspBidAdapter_spec.js +28 -1
  163. package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +427 -0
  164. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +33 -1
  165. package/test/spec/unit/core/targeting_spec.js +72 -0
  166. package/test/spec/unit/pbjs_api_spec.js +3 -1
  167. package/test/spec/utils_spec.js +38 -0
  168. package/test/test_deps.js +3 -0
  169. package/test/test_index.js +1 -3
@@ -16,20 +16,21 @@ function validateBuiltServerRequest(builtReq, expectedReq) {
16
16
  describe('33acrossBidAdapter:', function () {
17
17
  const BIDDER_CODE = '33across';
18
18
  const SITE_ID = 'sample33xGUID123456789';
19
- const PRODUCT_ID = 'siab';
20
19
  const END_POINT = 'https://ssc.33across.com/api/v1/hb';
21
20
 
22
21
  let element, win;
23
22
  let bidRequests;
24
23
  let sandbox;
25
24
 
26
- function TtxRequestBuilder() {
25
+ function TtxRequestBuilder(siteId = SITE_ID) {
27
26
  const ttxRequest = {
28
- imp: [{}],
27
+ imp: [{
28
+ id: 'b1'
29
+ }],
29
30
  site: {
30
- id: SITE_ID
31
+ id: siteId
31
32
  },
32
- id: 'b1',
33
+ id: 'r1',
33
34
  regs: {
34
35
  ext: {
35
36
  gdpr: 0
@@ -46,66 +47,83 @@ describe('33acrossBidAdapter:', function () {
46
47
  }
47
48
  };
48
49
 
50
+ this.addImp = (id = 'b2') => {
51
+ ttxRequest.imp.push({ id });
52
+
53
+ return this;
54
+ }
55
+
49
56
  this.withBanner = () => {
50
- Object.assign(ttxRequest.imp[0], {
51
- banner: {
52
- format: [
53
- {
54
- w: 300,
55
- h: 250
56
- },
57
- {
58
- w: 728,
59
- h: 90
60
- }
61
- ],
62
- ext: {
63
- ttx: {
64
- viewability: {
65
- amount: 100
57
+ ttxRequest.imp.forEach((imp) => {
58
+ Object.assign(imp, {
59
+ banner: {
60
+ format: [
61
+ {
62
+ w: 300,
63
+ h: 250
64
+ },
65
+ {
66
+ w: 728,
67
+ h: 90
68
+ }
69
+ ],
70
+ ext: {
71
+ ttx: {
72
+ viewability: {
73
+ amount: 100
74
+ }
66
75
  }
67
76
  }
68
77
  }
69
- }
78
+ });
70
79
  });
71
-
72
80
  return this;
73
81
  };
74
82
 
75
83
  this.withBannerSizes = this.withSizes = sizes => {
76
- Object.assign(ttxRequest.imp[0].banner, { format: sizes });
84
+ ttxRequest.imp.forEach((imp) => {
85
+ Object.assign(imp.banner, { format: sizes });
86
+ });
87
+
77
88
  return this;
78
89
  };
79
90
 
80
91
  this.withVideo = (params = {}) => {
81
- Object.assign(ttxRequest.imp[0], {
82
- video: {
83
- w: 300,
84
- h: 250,
85
- placement: 2,
86
- ...params
87
- }
92
+ ttxRequest.imp.forEach((imp) => {
93
+ Object.assign(imp, {
94
+ video: {
95
+ w: 300,
96
+ h: 250,
97
+ placement: 2,
98
+ ...params
99
+ }
100
+ });
88
101
  });
89
102
 
90
103
  return this;
91
104
  };
92
105
 
93
106
  this.withViewability = (viewability, format = 'banner') => {
94
- Object.assign(ttxRequest.imp[0][format], {
95
- ext: {
96
- ttx: { viewability }
97
- }
107
+ ttxRequest.imp.forEach((imp) => {
108
+ Object.assign(imp[format], {
109
+ ext: {
110
+ ttx: { viewability }
111
+ }
112
+ });
98
113
  });
114
+
99
115
  return this;
100
116
  };
101
117
 
102
- this.withProduct = (prod = PRODUCT_ID) => {
103
- Object.assign(ttxRequest.imp[0], {
104
- ext: {
105
- ttx: {
106
- prod
118
+ this.withProduct = (prod = 'siab') => {
119
+ ttxRequest.imp.forEach((imp) => {
120
+ Object.assign(imp, {
121
+ ext: {
122
+ ttx: {
123
+ prod
124
+ }
107
125
  }
108
- }
126
+ });
109
127
  });
110
128
 
111
129
  return this;
@@ -249,7 +267,7 @@ describe('33acrossBidAdapter:', function () {
249
267
  bidderRequestId: 'b1a',
250
268
  params: {
251
269
  siteId: SITE_ID,
252
- productId: PRODUCT_ID
270
+ productId: 'siab'
253
271
  },
254
272
  adUnitCode: 'div-id',
255
273
  auctionId: 'r1',
@@ -258,35 +276,61 @@ describe('33acrossBidAdapter:', function () {
258
276
  }
259
277
  ];
260
278
 
279
+ this.addBid = (bidParams = {}) => {
280
+ bidRequests.push({
281
+ bidId: 'b2',
282
+ bidder: '33across',
283
+ bidderRequestId: 'b1b',
284
+ params: {
285
+ siteId: SITE_ID,
286
+ productId: 'siab'
287
+ },
288
+ adUnitCode: 'div-id',
289
+ auctionId: 'r1',
290
+ mediaTypes: {},
291
+ transactionId: 't2',
292
+ ...bidParams
293
+ });
294
+
295
+ return this;
296
+ };
297
+
261
298
  this.withBanner = () => {
262
- bidRequests[0].mediaTypes.banner = {
263
- sizes: [
264
- [300, 250],
265
- [728, 90]
266
- ]
267
- };
299
+ bidRequests.forEach((bid) => {
300
+ bid.mediaTypes.banner = {
301
+ sizes: [
302
+ [300, 250],
303
+ [728, 90]
304
+ ]
305
+ };
306
+ });
268
307
 
269
308
  return this;
270
309
  };
271
310
 
272
311
  this.withProduct = (prod) => {
273
- bidRequests[0].params.productId = prod;
274
-
312
+ bidRequests.forEach((bid) => {
313
+ bid.params.productId = prod;
314
+ });
275
315
  return this;
276
316
  };
277
317
 
278
318
  this.withVideo = (params) => {
279
- bidRequests[0].mediaTypes.video = {
280
- playerSize: [[300, 250]],
281
- context: 'outstream',
282
- ...params
283
- };
319
+ bidRequests.forEach((bid) => {
320
+ bid.mediaTypes.video = {
321
+ playerSize: [[300, 250]],
322
+ context: 'outstream',
323
+ ...params
324
+ };
325
+ });
284
326
 
285
327
  return this;
286
328
  }
287
329
 
288
330
  this.withUserIds = (eids) => {
289
- bidRequests[0].userIdAsEids = eids;
331
+ bidRequests.forEach((bid) => {
332
+ bid.userIdAsEids = eids;
333
+ });
290
334
 
291
335
  return this;
292
336
  };
@@ -315,6 +359,7 @@ describe('33acrossBidAdapter:', function () {
315
359
  }
316
360
  };
317
361
  win = {
362
+ parent: null,
318
363
  document: {
319
364
  visibilityState: 'visible'
320
365
  },
@@ -331,7 +376,7 @@ describe('33acrossBidAdapter:', function () {
331
376
 
332
377
  sandbox = sinon.sandbox.create();
333
378
  sandbox.stub(Date, 'now').returns(1);
334
- sandbox.stub(document, 'getElementById').withArgs('div-id').returns(element);
379
+ sandbox.stub(document, 'getElementById').returns(element);
335
380
  sandbox.stub(utils, 'getWindowTop').returns(win);
336
381
  sandbox.stub(utils, 'getWindowSelf').returns(win);
337
382
  });
@@ -1376,10 +1421,146 @@ describe('33acrossBidAdapter:', function () {
1376
1421
  });
1377
1422
  });
1378
1423
  });
1424
+
1425
+ context('when SRA mode is enabled', function() {
1426
+ it('builds a single request with multiple imps corresponding to each group {siteId, productId}', function() {
1427
+ sandbox.stub(config, 'getConfig').callsFake(() => {
1428
+ return {
1429
+ enableSRAMode: true
1430
+ }
1431
+ });
1432
+
1433
+ const bidRequests = new BidRequestsBuilder()
1434
+ .addBid()
1435
+ .addBid({
1436
+ bidId: 'b3',
1437
+ adUnitCode: 'div-id',
1438
+ params: {
1439
+ siteId: 'sample33xGUID123456780',
1440
+ productId: 'siab'
1441
+ }
1442
+ })
1443
+ .addBid({
1444
+ bidId: 'b4',
1445
+ adUnitCode: 'div-id',
1446
+ params: {
1447
+ siteId: 'sample33xGUID123456780',
1448
+ productId: 'inview'
1449
+ }
1450
+ })
1451
+ .withBanner()
1452
+ .withVideo({context: 'outstream'})
1453
+ .build();
1454
+
1455
+ const req1 = new TtxRequestBuilder()
1456
+ .addImp()
1457
+ .withProduct('siab')
1458
+ .withBanner()
1459
+ .withVideo()
1460
+ .build();
1461
+
1462
+ const req2 = new TtxRequestBuilder('sample33xGUID123456780')
1463
+ .withProduct('siab')
1464
+ .withBanner()
1465
+ .withVideo()
1466
+ .build();
1467
+
1468
+ req2.imp[0].id = 'b3';
1469
+
1470
+ const req3 = new TtxRequestBuilder('sample33xGUID123456780')
1471
+ .withProduct('inview')
1472
+ .withBanner()
1473
+ .withVideo()
1474
+ .build();
1475
+
1476
+ req3.imp[0].id = 'b4';
1477
+
1478
+ const serverReq1 = new ServerRequestBuilder()
1479
+ .withData(req1)
1480
+ .build();
1481
+
1482
+ const serverReq2 = new ServerRequestBuilder()
1483
+ .withData(req2)
1484
+ .withUrl('https://ssc.33across.com/api/v1/hb?guid=sample33xGUID123456780')
1485
+ .build();
1486
+
1487
+ const serverReq3 = new ServerRequestBuilder()
1488
+ .withData(req3)
1489
+ .withUrl('https://ssc.33across.com/api/v1/hb?guid=sample33xGUID123456780')
1490
+ .build();
1491
+
1492
+ const builtServerRequests = spec.buildRequests(bidRequests, {});
1493
+
1494
+ expect(builtServerRequests).to.deep.equal([serverReq1, serverReq2, serverReq3]);
1495
+ });
1496
+ });
1497
+
1498
+ context('when SRA mode is not enabled', function() {
1499
+ it('builds multiple requests, one corresponding to each Ad Unit', function() {
1500
+ const bidRequests = new BidRequestsBuilder()
1501
+ .addBid()
1502
+ .addBid({
1503
+ bidId: 'b3',
1504
+ adUnitCode: 'div-id',
1505
+ params: {
1506
+ siteId: 'sample33xGUID123456780',
1507
+ productId: 'siab'
1508
+ }
1509
+ })
1510
+ .withBanner()
1511
+ .withVideo({context: 'outstream'})
1512
+ .build();
1513
+
1514
+ const req1 = new TtxRequestBuilder()
1515
+ .withProduct('siab')
1516
+ .withBanner()
1517
+ .withVideo()
1518
+ .build();
1519
+
1520
+ const req2 = new TtxRequestBuilder()
1521
+ .withProduct('siab')
1522
+ .withBanner()
1523
+ .withVideo()
1524
+ .build();
1525
+
1526
+ req2.imp[0].id = 'b2';
1527
+
1528
+ const req3 = new TtxRequestBuilder('sample33xGUID123456780')
1529
+ .withProduct('siab')
1530
+ .withBanner()
1531
+ .withVideo()
1532
+ .build();
1533
+
1534
+ req3.imp[0].id = 'b3';
1535
+
1536
+ const serverReq1 = new ServerRequestBuilder()
1537
+ .withData(req1)
1538
+ .build();
1539
+
1540
+ const serverReq2 = new ServerRequestBuilder()
1541
+ .withData(req2)
1542
+ .build();
1543
+
1544
+ const serverReq3 = new ServerRequestBuilder()
1545
+ .withData(req3)
1546
+ .withUrl('https://ssc.33across.com/api/v1/hb?guid=sample33xGUID123456780')
1547
+ .build();
1548
+
1549
+ const builtServerRequests = spec.buildRequests(bidRequests, {});
1550
+
1551
+ expect(builtServerRequests)
1552
+ .to.deep.equal([
1553
+ serverReq1,
1554
+ serverReq2,
1555
+ serverReq3
1556
+ ]);
1557
+ });
1558
+ });
1379
1559
  });
1380
1560
 
1381
1561
  describe('interpretResponse', function() {
1382
1562
  let ttxRequest, serverRequest;
1563
+ const videoBid = '<VAST version="3.0"><Ad></Ad></VAST>';
1383
1564
 
1384
1565
  beforeEach(function() {
1385
1566
  ttxRequest = new TtxRequestBuilder()
@@ -1390,6 +1571,7 @@ describe('33acrossBidAdapter:', function () {
1390
1571
  page: 'https://test-url.com'
1391
1572
  })
1392
1573
  .build();
1574
+
1393
1575
  serverRequest = new ServerRequestBuilder()
1394
1576
  .withUrl('https://staging-ssc.33across.com/api/v1/hb')
1395
1577
  .withData(ttxRequest)
@@ -1405,11 +1587,12 @@ describe('33acrossBidAdapter:', function () {
1405
1587
  const serverResponse = {
1406
1588
  cur: 'USD',
1407
1589
  ext: {},
1408
- id: 'b1',
1590
+ id: 'r1',
1409
1591
  seatbid: [
1410
1592
  {
1411
1593
  bid: [{
1412
1594
  id: '1',
1595
+ impid: 'b1',
1413
1596
  adm: '<html><h3>I am an ad</h3></html>',
1414
1597
  crid: 1,
1415
1598
  h: 250,
@@ -1441,15 +1624,15 @@ describe('33acrossBidAdapter:', function () {
1441
1624
  });
1442
1625
 
1443
1626
  it('interprets and returns the single video bid response', function() {
1444
- const videoBid = '<VAST version="3.0"><Ad></Ad></VAST>';
1445
1627
  const serverResponse = {
1446
1628
  cur: 'USD',
1447
1629
  ext: {},
1448
- id: 'b1',
1630
+ id: 'r1',
1449
1631
  seatbid: [
1450
1632
  {
1451
1633
  bid: [{
1452
1634
  id: '1',
1635
+ impid: 'b1',
1453
1636
  adm: videoBid,
1454
1637
  ext: {
1455
1638
  ttx: {
@@ -1497,6 +1680,7 @@ describe('33acrossBidAdapter:', function () {
1497
1680
  {
1498
1681
  bid: [{
1499
1682
  id: '1',
1683
+ impid: 'b1',
1500
1684
  adm: '<html><h3>I am an ad</h3></html>',
1501
1685
  crid: 1,
1502
1686
  h: 250,
@@ -1533,7 +1717,7 @@ describe('33acrossBidAdapter:', function () {
1533
1717
  const serverResponse = {
1534
1718
  cur: 'USD',
1535
1719
  ext: {},
1536
- id: 'b1',
1720
+ id: 'r1',
1537
1721
  seatbid: []
1538
1722
  };
1539
1723
 
@@ -1542,15 +1726,16 @@ describe('33acrossBidAdapter:', function () {
1542
1726
  });
1543
1727
 
1544
1728
  context('when more than one bids are returned', function() {
1545
- it('interprets and returns the the first bid of the first seatbid', function() {
1729
+ it('interprets and returns all bids', function() {
1546
1730
  const serverResponse = {
1547
1731
  cur: 'USD',
1548
1732
  ext: {},
1549
- id: 'b1',
1733
+ id: 'r1',
1550
1734
  seatbid: [
1551
1735
  {
1552
1736
  bid: [{
1553
1737
  id: '1',
1738
+ impid: 'b1',
1554
1739
  adm: '<html><h3>I am an ad</h3></html>',
1555
1740
  crid: 1,
1556
1741
  h: 250,
@@ -1559,6 +1744,7 @@ describe('33acrossBidAdapter:', function () {
1559
1744
  },
1560
1745
  {
1561
1746
  id: '2',
1747
+ impid: 'b2',
1562
1748
  adm: '<html><h3>I am an ad</h3></html>',
1563
1749
  crid: 2,
1564
1750
  h: 250,
@@ -1570,7 +1756,14 @@ describe('33acrossBidAdapter:', function () {
1570
1756
  {
1571
1757
  bid: [{
1572
1758
  id: '3',
1573
- adm: '<html><h3>I am an ad</h3></html>',
1759
+ impid: 'b3',
1760
+ adm: videoBid,
1761
+ ext: {
1762
+ ttx: {
1763
+ mediaType: 'video',
1764
+ vastType: 'xml'
1765
+ }
1766
+ },
1574
1767
  crid: 3,
1575
1768
  h: 250,
1576
1769
  w: 300,
@@ -1579,21 +1772,50 @@ describe('33acrossBidAdapter:', function () {
1579
1772
  }
1580
1773
  ]
1581
1774
  };
1582
- const bidResponse = {
1583
- requestId: 'b1',
1584
- bidderCode: BIDDER_CODE,
1585
- cpm: 0.0940,
1586
- width: 300,
1587
- height: 250,
1588
- ad: '<html><h3>I am an ad</h3></html>',
1589
- ttl: 60,
1590
- creativeId: 1,
1591
- mediaType: 'banner',
1592
- currency: 'USD',
1593
- netRevenue: true
1594
- };
1775
+ const bidResponse = [
1776
+ {
1777
+ requestId: 'b1',
1778
+ bidderCode: BIDDER_CODE,
1779
+ cpm: 0.0940,
1780
+ width: 300,
1781
+ height: 250,
1782
+ ad: '<html><h3>I am an ad</h3></html>',
1783
+ ttl: 60,
1784
+ creativeId: 1,
1785
+ mediaType: 'banner',
1786
+ currency: 'USD',
1787
+ netRevenue: true
1788
+ },
1789
+ {
1790
+ requestId: 'b2',
1791
+ bidderCode: BIDDER_CODE,
1792
+ cpm: 0.0938,
1793
+ width: 300,
1794
+ height: 250,
1795
+ ad: '<html><h3>I am an ad</h3></html>',
1796
+ ttl: 60,
1797
+ creativeId: 2,
1798
+ mediaType: 'banner',
1799
+ currency: 'USD',
1800
+ netRevenue: true
1801
+ },
1802
+ {
1803
+ requestId: 'b3',
1804
+ bidderCode: BIDDER_CODE,
1805
+ cpm: 0.0938,
1806
+ width: 300,
1807
+ height: 250,
1808
+ ad: videoBid,
1809
+ vastXml: '<VAST version=\"3.0\"><Ad></Ad></VAST>',
1810
+ ttl: 60,
1811
+ creativeId: 3,
1812
+ mediaType: 'video',
1813
+ currency: 'USD',
1814
+ netRevenue: true
1815
+ }
1816
+ ];
1595
1817
 
1596
- expect(spec.interpretResponse({ body: serverResponse }, serverRequest)).to.deep.equal([bidResponse]);
1818
+ expect(spec.interpretResponse({ body: serverResponse }, serverRequest)).to.deep.equal(bidResponse);
1597
1819
  });
1598
1820
  });
1599
1821
  });
@@ -3,7 +3,7 @@ import analyticsAdapter, { command as analyticsCommand, COMMAND } from 'modules/
3
3
  import { AUCTION_COMPLETED } from 'src/auction.js';
4
4
  import { expect } from 'chai';
5
5
  import events from 'src/events.js';
6
- import { EVENTS } from 'src/constants.json';
6
+ import CONSTANTS from 'src/constants.json';
7
7
  import * as utils from 'src/utils.js';
8
8
  import { loadExternalScriptStub } from 'test/mocks/adloaderStub.js';
9
9
 
@@ -143,10 +143,10 @@ describe('Adloox Analytics Adapter', function () {
143
143
  return arg.tagName === 'LINK' && arg.getAttribute('rel') === 'preload' && arg.getAttribute('as') === 'script' && href_uri.href === uri.href;
144
144
  };
145
145
 
146
- events.emit(EVENTS.AUCTION_END, auctionDetails);
146
+ events.emit(CONSTANTS.EVENTS.AUCTION_END, auctionDetails);
147
147
  expect(insertElementStub.calledWith(sinon.match(isLinkPreloadAsScript))).to.true;
148
148
 
149
- events.emit(EVENTS.AUCTION_END, auctionDetails);
149
+ events.emit(CONSTANTS.EVENTS.AUCTION_END, auctionDetails);
150
150
  expect(insertElementStub.callCount).to.equal(1);
151
151
 
152
152
  done();
@@ -167,7 +167,7 @@ describe('Adloox Analytics Adapter', function () {
167
167
  const querySelectorStub = sandbox.stub(document, 'querySelector');
168
168
  querySelectorStub.withArgs(`#${bid.adUnitCode}`).returns(slot);
169
169
 
170
- events.emit(EVENTS.BID_WON, bid);
170
+ events.emit(CONSTANTS.EVENTS.BID_WON, bid);
171
171
 
172
172
  const [urlInserted, moduleCode] = loadExternalScriptStub.getCall(0).args;
173
173
 
@@ -196,7 +196,7 @@ describe('Adloox Analytics Adapter', function () {
196
196
  const querySelectorStub = sandbox.stub(document, 'querySelector');
197
197
  querySelectorStub.withArgs(`#${bid.adUnitCode}`).returns(slot);
198
198
 
199
- events.emit(EVENTS.BID_WON, bidIgnore);
199
+ events.emit(CONSTANTS.EVENTS.BID_WON, bidIgnore);
200
200
 
201
201
  expect(parent.querySelector('script')).is.null;
202
202
 
@@ -238,7 +238,7 @@ describe('Adloox Analytics Adapter', function () {
238
238
 
239
239
  it('should inject tracking event', function (done) {
240
240
  const data = {
241
- eventType: EVENTS.BID_WON,
241
+ eventType: CONSTANTS.EVENTS.BID_WON,
242
242
  args: bid
243
243
  };
244
244
 
@@ -175,13 +175,13 @@ describe('AdmanAdapter', function () {
175
175
  });
176
176
 
177
177
  describe('getUserSyncs', function () {
178
- let userSync = spec.getUserSyncs();
178
+ let userSync = spec.getUserSyncs({});
179
179
  it('Returns valid URL and type', function () {
180
180
  expect(userSync).to.be.an('array').with.lengthOf(1);
181
181
  expect(userSync[0].type).to.exist;
182
182
  expect(userSync[0].url).to.exist;
183
183
  expect(userSync[0].type).to.be.equal('image');
184
- expect(userSync[0].url).to.be.equal('https://pub.admanmedia.com/?c=o&m=sync');
184
+ expect(userSync[0].url).to.be.equal('https://pub.admanmedia.com/image?pbjs=1&coppa=0');
185
185
  });
186
186
  });
187
187
  });
@@ -19,6 +19,7 @@ describe('adnuntiusBidAdapter', function () {
19
19
  });
20
20
  const tzo = new Date().getTimezoneOffset();
21
21
  const ENDPOINT_URL = `${URL}${tzo}&format=json&userId=${usi}`;
22
+ const ENDPOINT_URL_NOCOOKIE = `${URL}${tzo}&format=json&userId=${usi}&noCookies=true`;
22
23
  const ENDPOINT_URL_SEGMENTS = `${URL}${tzo}&format=json&segments=segment1,segment2,segment3&userId=${usi}`;
23
24
  const ENDPOINT_URL_CONSENT = `${URL}${tzo}&format=json&consentString=consentString&userId=${usi}`;
24
25
  const adapter = newBidder(spec);
@@ -287,6 +288,22 @@ describe('adnuntiusBidAdapter', function () {
287
288
  });
288
289
  });
289
290
 
291
+ describe('use cookie', function () {
292
+ it('should send noCookie in url if set to false.', function () {
293
+ config.setBidderConfig({
294
+ bidders: ['adnuntius'],
295
+ config: {
296
+ useCookie: false
297
+ }
298
+ });
299
+
300
+ const request = config.runWithBidder('adnuntius', () => spec.buildRequests(bidRequests));
301
+ expect(request.length).to.equal(1);
302
+ expect(request[0]).to.have.property('url')
303
+ expect(request[0].url).to.equal(ENDPOINT_URL_NOCOOKIE);
304
+ });
305
+ });
306
+
290
307
  describe('interpretResponse', function () {
291
308
  it('should return valid response when passed valid server response', function () {
292
309
  const interpretedResponse = spec.interpretResponse(serverResponse, singleBidRequest);
@@ -1,5 +1,5 @@
1
1
  import adomikAnalytics from 'modules/adomikAnalyticsAdapter.js';
2
- import {expect} from 'chai';
2
+ import { expect } from 'chai';
3
3
 
4
4
  let events = require('src/events');
5
5
  let adapterManager = require('src/adapterManager').default;
@@ -45,6 +45,8 @@ describe('Adomik Prebid Analytic', function () {
45
45
  const initOptions = {
46
46
  id: '123456',
47
47
  url: 'testurl',
48
+ testId: '12345',
49
+ testValue: '1000'
48
50
  };
49
51
 
50
52
  const bid = {
@@ -71,6 +73,9 @@ describe('Adomik Prebid Analytic', function () {
71
73
  expect(adomikAnalytics.currentContext).to.deep.equal({
72
74
  uid: '123456',
73
75
  url: 'testurl',
76
+ sampling: undefined,
77
+ testId: '12345',
78
+ testValue: '1000',
74
79
  id: '',
75
80
  timeouted: false
76
81
  });
@@ -81,6 +86,9 @@ describe('Adomik Prebid Analytic', function () {
81
86
  expect(adomikAnalytics.currentContext).to.deep.equal({
82
87
  uid: '123456',
83
88
  url: 'testurl',
89
+ sampling: undefined,
90
+ testId: '12345',
91
+ testValue: '1000',
84
92
  id: 'test-test-test',
85
93
  timeouted: false
86
94
  });