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
@@ -4,6 +4,7 @@ import { expect } from 'chai';
4
4
  import { newBidder } from 'src/adapters/bidderFactory.js';
5
5
  import { spec, storage, ERROR_CODES } from '../../../modules/ixBidAdapter.js';
6
6
  import { createEidsArray } from 'modules/userId/eids.js';
7
+ import { deepAccess } from '../../../src/utils.js';
7
8
 
8
9
  describe('IndexexchangeAdapter', function () {
9
10
  const IX_SECURE_ENDPOINT = 'https://htlb.casalemedia.com/cygnus';
@@ -440,7 +441,10 @@ describe('IndexexchangeAdapter', function () {
440
441
  netId: 'testnetid123', // NetId
441
442
  IDP: 'userIDP000', // IDP
442
443
  fabrickId: 'fabrickId9000', // FabrickId
443
- uid2: { id: 'testuid2' } // UID 2.0
444
+ // so structured because when calling createEidsArray, UID2's getValue func takes .id to set in uids
445
+ uid2: { id: 'testuid2' }, // UID 2.0
446
+ // similar to uid2, but id5's getValue takes .uid
447
+ id5id: { uid: 'testid5id' } // ID5
444
448
  };
445
449
 
446
450
  const DEFAULT_USERIDASEIDS_DATA = createEidsArray(DEFAULT_USERID_DATA);
@@ -481,12 +485,16 @@ describe('IndexexchangeAdapter', function () {
481
485
  }, {
482
486
  source: 'uidapi.com',
483
487
  uids: [{
484
- // when calling createEidsArray, UID2's getValue func returns .id, which is then set in uids
485
488
  id: DEFAULT_USERID_DATA.uid2.id,
486
489
  ext: {
487
490
  rtiPartner: 'UID2'
488
491
  }
489
492
  }]
493
+ }, {
494
+ source: 'id5-sync.com',
495
+ uids: [{
496
+ id: DEFAULT_USERID_DATA.id5id.uid
497
+ }]
490
498
  }
491
499
  ];
492
500
 
@@ -753,7 +761,7 @@ describe('IndexexchangeAdapter', function () {
753
761
  const payload = JSON.parse(request[0].data.r);
754
762
  expect(request).to.be.an('array');
755
763
  expect(request).to.have.lengthOf.above(0); // should be 1 or more
756
- expect(payload.user.eids).to.have.lengthOf(5);
764
+ expect(payload.user.eids).to.have.lengthOf(6);
757
765
  expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[0]);
758
766
  });
759
767
  });
@@ -952,12 +960,8 @@ describe('IndexexchangeAdapter', function () {
952
960
  const request = spec.buildRequests(cloneValidBid, DEFAULT_OPTION)[0];
953
961
  const payload = JSON.parse(request.data.r);
954
962
 
955
- expect(payload.user.eids).to.have.lengthOf(5);
956
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[0]);
957
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[1]);
958
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[2]);
959
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[3]);
960
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[4]);
963
+ expect(payload.user.eids).to.have.lengthOf(6);
964
+ expect(payload.user.eids).to.have.deep.members(DEFAULT_USERID_PAYLOAD);
961
965
  });
962
966
 
963
967
  it('IX adapter reads floc id from prebid userId and adds it to eids when there is not other eids', function () {
@@ -977,12 +981,8 @@ describe('IndexexchangeAdapter', function () {
977
981
  const request = spec.buildRequests(cloneValidBid, DEFAULT_OPTION)[0];
978
982
  const payload = JSON.parse(request.data.r);
979
983
 
980
- expect(payload.user.eids).to.have.lengthOf(6);
981
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[0]);
982
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[1]);
983
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[2]);
984
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[3]);
985
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[4]);
984
+ expect(payload.user.eids).to.have.lengthOf(7);
985
+ expect(payload.user.eids).to.deep.include.members(DEFAULT_USERID_PAYLOAD);
986
986
  expect(payload.user.eids).to.deep.include(DEFAULT_FLOC_USERID_PAYLOAD[0]);
987
987
  });
988
988
 
@@ -993,12 +993,8 @@ describe('IndexexchangeAdapter', function () {
993
993
  const request = spec.buildRequests(cloneValidBid, DEFAULT_OPTION)[0];
994
994
  const payload = JSON.parse(request.data.r);
995
995
 
996
- expect(payload.user.eids).to.have.lengthOf(5);
997
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[0]);
998
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[1]);
999
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[2]);
1000
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[3]);
1001
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[4]);
996
+ expect(payload.user.eids).to.have.lengthOf(6);
997
+ expect(payload.user.eids).to.deep.include.members(DEFAULT_USERID_PAYLOAD);
1002
998
  expect(payload.user.eids).should.not.include(DEFAULT_FLOC_USERID_PAYLOAD[0]);
1003
999
  });
1004
1000
 
@@ -1009,12 +1005,8 @@ describe('IndexexchangeAdapter', function () {
1009
1005
  const request = spec.buildRequests(cloneValidBid, DEFAULT_OPTION)[0];
1010
1006
  const payload = JSON.parse(request.data.r);
1011
1007
 
1012
- expect(payload.user.eids).to.have.lengthOf(5);
1013
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[0]);
1014
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[1]);
1015
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[2]);
1016
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[3]);
1017
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[4]);
1008
+ expect(payload.user.eids).to.have.lengthOf(6);
1009
+ expect(payload.user.eids).to.deep.include.members(DEFAULT_USERID_PAYLOAD);
1018
1010
  expect(payload.user.eids).should.not.include(DEFAULT_FLOC_USERID_PAYLOAD[0]);
1019
1011
  });
1020
1012
 
@@ -1025,12 +1017,8 @@ describe('IndexexchangeAdapter', function () {
1025
1017
  const request = spec.buildRequests(cloneValidBid, DEFAULT_OPTION)[0];
1026
1018
  const payload = JSON.parse(request.data.r);
1027
1019
 
1028
- expect(payload.user.eids).to.have.lengthOf(5);
1029
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[0]);
1030
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[1]);
1031
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[2]);
1032
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[3]);
1033
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[4]);
1020
+ expect(payload.user.eids).to.have.lengthOf(6);
1021
+ expect(payload.user.eids).to.deep.include.members(DEFAULT_USERID_PAYLOAD);
1034
1022
  expect(payload.user.eids).should.not.include(DEFAULT_FLOC_USERID_PAYLOAD[0]);
1035
1023
  });
1036
1024
 
@@ -1041,12 +1029,8 @@ describe('IndexexchangeAdapter', function () {
1041
1029
  const request = spec.buildRequests(cloneValidBid, DEFAULT_OPTION)[0];
1042
1030
  const payload = JSON.parse(request.data.r);
1043
1031
 
1044
- expect(payload.user.eids).to.have.lengthOf(5);
1045
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[0]);
1046
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[1]);
1047
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[2]);
1048
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[3]);
1049
- expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[4]);
1032
+ expect(payload.user.eids).to.have.lengthOf(6);
1033
+ expect(payload.user.eids).to.deep.include.members(DEFAULT_USERID_PAYLOAD);
1050
1034
  expect(payload.user.eids).should.not.include(DEFAULT_FLOC_USERID_PAYLOAD[0]);
1051
1035
  });
1052
1036
 
@@ -1179,15 +1163,9 @@ describe('IndexexchangeAdapter', function () {
1179
1163
  })
1180
1164
 
1181
1165
  expect(payload.user).to.exist;
1182
- expect(payload.user.eids).to.have.lengthOf(7);
1166
+ expect(payload.user.eids).to.have.lengthOf(8);
1183
1167
 
1184
- expect(payload.user.eids).to.deep.include(validUserIdPayload[0]);
1185
- expect(payload.user.eids).to.deep.include(validUserIdPayload[1]);
1186
- expect(payload.user.eids).to.deep.include(validUserIdPayload[2]);
1187
- expect(payload.user.eids).to.deep.include(validUserIdPayload[3]);
1188
- expect(payload.user.eids).to.deep.include(validUserIdPayload[4]);
1189
- expect(payload.user.eids).to.deep.include(validUserIdPayload[5]);
1190
- expect(payload.user.eids).to.deep.include(validUserIdPayload[6]);
1168
+ expect(payload.user.eids).to.have.deep.members(validUserIdPayload);
1191
1169
  });
1192
1170
 
1193
1171
  it('IXL and Prebid are mutually exclusive', function () {
@@ -1227,13 +1205,8 @@ describe('IndexexchangeAdapter', function () {
1227
1205
  });
1228
1206
 
1229
1207
  const payload = JSON.parse(request.data.r);
1230
- expect(payload.user.eids).to.have.lengthOf(6);
1231
- expect(payload.user.eids).to.deep.include(validUserIdPayload[0]);
1232
- expect(payload.user.eids).to.deep.include(validUserIdPayload[1]);
1233
- expect(payload.user.eids).to.deep.include(validUserIdPayload[2]);
1234
- expect(payload.user.eids).to.deep.include(validUserIdPayload[3]);
1235
- expect(payload.user.eids).to.deep.include(validUserIdPayload[4]);
1236
- expect(payload.user.eids).to.deep.include(validUserIdPayload[5]);
1208
+ expect(payload.user.eids).to.have.lengthOf(7);
1209
+ expect(payload.user.eids).to.have.deep.members(validUserIdPayload);
1237
1210
  });
1238
1211
  });
1239
1212
 
@@ -1440,12 +1413,69 @@ describe('IndexexchangeAdapter', function () {
1440
1413
  expect(dfp_ad_unit_code).to.equal(AD_UNIT_CODE);
1441
1414
  });
1442
1415
 
1416
+ it('should send gpid in request if ortb2Imp.ext.gpid exists', function () {
1417
+ const GPID = '/19968336/some-adunit-path';
1418
+ const validBids = utils.deepClone(DEFAULT_BANNER_VALID_BID);
1419
+ validBids[0].ortb2Imp = {
1420
+ ext: {
1421
+ gpid: GPID
1422
+ }
1423
+ };
1424
+ const requests = spec.buildRequests(validBids, DEFAULT_OPTION);
1425
+ const { ext: { gpid } } = JSON.parse(requests[0].data.r).imp[0];
1426
+ expect(gpid).to.equal(GPID);
1427
+ });
1428
+
1443
1429
  it('should not send dfp_adunit_code in request if ortb2Imp.ext.data.adserver.adslot does not exists', function () {
1430
+ const GPID = '/19968336/some-adunit-path';
1431
+ const validBids = utils.deepClone(DEFAULT_BANNER_VALID_BID);
1432
+ validBids[0].ortb2Imp = {
1433
+ ext: {
1434
+ gpid: GPID
1435
+ }
1436
+ };
1437
+ const requests = spec.buildRequests(validBids, DEFAULT_OPTION);
1438
+ const imp = JSON.parse(requests[0].data.r).imp[0];
1439
+ expect(deepAccess(imp, 'ext.dfp_ad_unit_code')).to.not.exist;
1440
+ });
1441
+
1442
+ it('should not send gpid in request if ortb2Imp.ext.gpid does not exists', function () {
1443
+ const AD_UNIT_CODE = '/19968336/some-adunit-path';
1444
1444
  const validBids = utils.deepClone(DEFAULT_BANNER_VALID_BID);
1445
+ validBids[0].ortb2Imp = {
1446
+ ext: {
1447
+ data: {
1448
+ adserver: {
1449
+ name: 'gam',
1450
+ adslot: AD_UNIT_CODE
1451
+ }
1452
+ }
1453
+ }
1454
+ };
1445
1455
  const requests = spec.buildRequests(validBids, DEFAULT_OPTION);
1446
- const { ext } = JSON.parse(requests[0].data.r).imp[0];
1456
+ const imp = JSON.parse(requests[0].data.r).imp[0];
1457
+ expect(deepAccess(imp, 'ext.gpid')).to.not.exist;
1458
+ });
1447
1459
 
1448
- expect(ext).to.not.exist;
1460
+ it('should send gpid & dfp_adunit_code if they exist in ortb2Imp.ext', function () {
1461
+ const AD_UNIT_CODE = '/1111/home';
1462
+ const GPID = '/1111/home-left';
1463
+ const validBids = utils.deepClone(DEFAULT_BANNER_VALID_BID);
1464
+ validBids[0].ortb2Imp = {
1465
+ ext: {
1466
+ gpid: GPID,
1467
+ data: {
1468
+ adserver: {
1469
+ name: 'gam',
1470
+ adslot: AD_UNIT_CODE
1471
+ }
1472
+ }
1473
+ }
1474
+ };
1475
+ const requests = spec.buildRequests(validBids, DEFAULT_OPTION);
1476
+ const imp = JSON.parse(requests[0].data.r).imp[0];
1477
+ expect(deepAccess(imp, 'ext.gpid')).to.equal(GPID);
1478
+ expect(deepAccess(imp, 'ext.dfp_ad_unit_code')).to.equal(AD_UNIT_CODE);
1449
1479
  });
1450
1480
 
1451
1481
  it('payload should have correct format and value', function () {
@@ -1502,11 +1532,23 @@ describe('IndexexchangeAdapter', function () {
1502
1532
 
1503
1533
  expect(w).to.equal(size[0]);
1504
1534
  expect(h).to.equal(size[1]);
1505
- expect(ext.siteID).to.equal(DEFAULT_BANNER_VALID_BID[0].params.siteId.toString());
1535
+ expect(ext.siteID).to.equal(DEFAULT_BANNER_VALID_BID[0].params.siteId);
1506
1536
  expect(ext.sid).to.equal(sidValue);
1507
1537
  });
1508
1538
  });
1509
1539
 
1540
+ it('payload should have imp[].banner.format[].ext.siteID as string ', function () {
1541
+ const bid = utils.deepClone(DEFAULT_BANNER_VALID_BID[0]);
1542
+ bid.params.siteId = 1234;
1543
+
1544
+ request = spec.buildRequests([bid], DEFAULT_OPTION)[0];
1545
+
1546
+ const payload = JSON.parse(request.data.r);
1547
+ payload.imp[0].banner.format.forEach((imp) => {
1548
+ expect(imp.ext.siteID).to.be.a('string');
1549
+ });
1550
+ });
1551
+
1510
1552
  describe('build requests with price floors', () => {
1511
1553
  const highFloor = 4.5;
1512
1554
  const lowFloor = 3.5;
@@ -1638,7 +1680,7 @@ describe('IndexexchangeAdapter', function () {
1638
1680
  expect(impression.banner.format[0].w).to.equal(DEFAULT_BANNER_VALID_BID[0].params.size[0]);
1639
1681
  expect(impression.banner.format[0].h).to.equal(DEFAULT_BANNER_VALID_BID[0].params.size[1]);
1640
1682
  expect(impression.banner.topframe).to.be.oneOf([0, 1]);
1641
- expect(impression.banner.format[0].ext.siteID).to.equal(DEFAULT_BANNER_VALID_BID[0].params.siteId.toString());
1683
+ expect(impression.banner.format[0].ext.siteID).to.equal(DEFAULT_BANNER_VALID_BID[0].params.siteId);
1642
1684
  expect(impression.banner.format[0].ext.sid).to.equal('50');
1643
1685
  });
1644
1686
 
@@ -1652,7 +1694,7 @@ describe('IndexexchangeAdapter', function () {
1652
1694
  expect(impression.banner.format[0].w).to.equal(DEFAULT_BANNER_VALID_BID[0].params.size[0]);
1653
1695
  expect(impression.banner.format[0].h).to.equal(DEFAULT_BANNER_VALID_BID[0].params.size[1]);
1654
1696
  expect(impression.banner.topframe).to.be.oneOf([0, 1]);
1655
- expect(impression.banner.format[0].ext.siteID).to.equal(DEFAULT_BANNER_VALID_BID[0].params.siteId.toString());
1697
+ expect(impression.banner.format[0].ext.siteID).to.equal(DEFAULT_BANNER_VALID_BID[0].params.siteId);
1656
1698
  expect(impression.banner.format[0].ext.sid).to.equal('abc');
1657
1699
  });
1658
1700
 
@@ -1750,7 +1792,7 @@ describe('IndexexchangeAdapter', function () {
1750
1792
 
1751
1793
  expect(w).to.equal(size[0]);
1752
1794
  expect(h).to.equal(size[1]);
1753
- expect(ext.siteID).to.equal(DEFAULT_BANNER_VALID_BID[0].params.siteId.toString());
1795
+ expect(ext.siteID).to.equal(DEFAULT_BANNER_VALID_BID[0].params.siteId);
1754
1796
  expect(ext.sid).to.equal(sidValue);
1755
1797
  });
1756
1798
  });
@@ -1915,7 +1957,7 @@ describe('IndexexchangeAdapter', function () {
1915
1957
 
1916
1958
  expect(w).to.equal(size[0]);
1917
1959
  expect(h).to.equal(size[1]);
1918
- expect(ext.siteID).to.equal(bids[impressionIndex].params.siteId.toString());
1960
+ expect(ext.siteID).to.equal(bids[impressionIndex].params.siteId);
1919
1961
  expect(ext.sid).to.equal(sidValue);
1920
1962
  });
1921
1963
  });
@@ -2119,7 +2161,7 @@ describe('IndexexchangeAdapter', function () {
2119
2161
 
2120
2162
  expect(w).to.equal(size[0]);
2121
2163
  expect(h).to.equal(size[1]);
2122
- expect(ext.siteID).to.equal(bid.params.siteId.toString());
2164
+ expect(ext.siteID).to.equal(bid.params.siteId);
2123
2165
  expect(ext.sid).to.equal(sidValue);
2124
2166
  });
2125
2167
  });
@@ -2806,5 +2848,13 @@ describe('IndexexchangeAdapter', function () {
2806
2848
  expect(JSON.parse(localStorageValues[key])[EXPIRED_DATE]).to.be.undefined;
2807
2849
  expect(JSON.parse(localStorageValues[key])).to.deep.equal({ [TODAY]: { '1': 1, '3': 8, '4': 1 } })
2808
2850
  });
2851
+
2852
+ it('should not save error data into localstorage if consent is not given', () => {
2853
+ config.setConfig({ deviceAccess: false });
2854
+ const bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
2855
+ bid.params.size = ['400', 100];
2856
+ expect(spec.isBidRequestValid(bid)).to.be.false;
2857
+ expect(localStorageValues[key]).to.be.undefined;
2858
+ });
2809
2859
  });
2810
2860
  });
@@ -19,7 +19,17 @@ describe('limelightDigitalAdapter', function () {
19
19
  sizes: [[300, 250]]
20
20
  }
21
21
  },
22
- transactionId: '3bb2f6da-87a6-4029-aeb0-bfe951372e62'
22
+ transactionId: '3bb2f6da-87a6-4029-aeb0-bfe951372e62',
23
+ userIdAsEids: [
24
+ {
25
+ source: 'test1.org',
26
+ uids: [
27
+ {
28
+ id: '123',
29
+ }
30
+ ]
31
+ }
32
+ ]
23
33
  }
24
34
  const bid2 = {
25
35
  bidId: '58ee9870c3164a',
@@ -33,7 +43,17 @@ describe('limelightDigitalAdapter', function () {
33
43
  placementCode: 'placement_1',
34
44
  auctionId: '482f88de-29ab-45c8-981a-d25e39454a34',
35
45
  sizes: [[350, 200]],
36
- transactionId: '068867d1-46ec-40bb-9fa0-e24611786fb4'
46
+ transactionId: '068867d1-46ec-40bb-9fa0-e24611786fb4',
47
+ userIdAsEids: [
48
+ {
49
+ source: 'test2.org',
50
+ uids: [
51
+ {
52
+ id: '234',
53
+ }
54
+ ]
55
+ }
56
+ ]
37
57
  }
38
58
  const bid3 = {
39
59
  bidId: '019645c7d69460',
@@ -48,7 +68,20 @@ describe('limelightDigitalAdapter', function () {
48
68
  placementCode: 'placement_2',
49
69
  auctionId: 'e4771143-6aa7-41ec-8824-ced4342c96c8',
50
70
  sizes: [[800, 600]],
51
- transactionId: '738d5915-6651-43b9-9b6b-d50517350917'
71
+ transactionId: '738d5915-6651-43b9-9b6b-d50517350917',
72
+ userIdAsEids: [
73
+ {
74
+ source: 'test3.org',
75
+ uids: [
76
+ {
77
+ id: '345',
78
+ },
79
+ {
80
+ id: '456',
81
+ }
82
+ ]
83
+ }
84
+ ]
52
85
  }
53
86
  const bid4 = {
54
87
  bidId: '019645c7d69460',
@@ -64,7 +97,17 @@ describe('limelightDigitalAdapter', function () {
64
97
  video: {
65
98
  playerSize: [800, 600]
66
99
  },
67
- transactionId: '738d5915-6651-43b9-9b6b-d50517350917'
100
+ transactionId: '738d5915-6651-43b9-9b6b-d50517350917',
101
+ userIdAsEids: [
102
+ {
103
+ source: 'test.org',
104
+ uids: [
105
+ {
106
+ id: '111',
107
+ }
108
+ ]
109
+ }
110
+ ]
68
111
  }
69
112
 
70
113
  describe('buildRequests', function () {
@@ -84,19 +127,33 @@ describe('limelightDigitalAdapter', function () {
84
127
  expect(serverRequest.method).to.equal('POST')
85
128
  })
86
129
  it('Returns valid data if array of bids is valid', function () {
87
- let data = serverRequest.data
88
- expect(data).to.be.an('object')
89
- expect(data).to.have.all.keys('deviceWidth', 'deviceHeight', 'secure', 'adUnits')
90
- expect(data.deviceWidth).to.be.a('number')
91
- expect(data.deviceHeight).to.be.a('number')
92
- expect(data.secure).to.be.a('boolean')
130
+ let data = serverRequest.data;
131
+ expect(data).to.be.an('object');
132
+ expect(data).to.have.all.keys(
133
+ 'deviceWidth',
134
+ 'deviceHeight',
135
+ 'secure',
136
+ 'adUnits'
137
+ );
138
+ expect(data.deviceWidth).to.be.a('number');
139
+ expect(data.deviceHeight).to.be.a('number');
140
+ expect(data.secure).to.be.a('boolean');
93
141
  data.adUnits.forEach(adUnit => {
94
- expect(adUnit).to.have.all.keys('id', 'bidId', 'type', 'sizes', 'transactionId', 'publisherId')
95
- expect(adUnit.id).to.be.a('number')
96
- expect(adUnit.bidId).to.be.a('string')
97
- expect(adUnit.type).to.be.a('string')
98
- expect(adUnit.transactionId).to.be.a('string')
99
- expect(adUnit.sizes).to.be.an('array')
142
+ expect(adUnit).to.have.all.keys(
143
+ 'id',
144
+ 'bidId',
145
+ 'type',
146
+ 'sizes',
147
+ 'transactionId',
148
+ 'publisherId',
149
+ 'userIdAsEids'
150
+ );
151
+ expect(adUnit.id).to.be.a('number');
152
+ expect(adUnit.bidId).to.be.a('string');
153
+ expect(adUnit.type).to.be.a('string');
154
+ expect(adUnit.transactionId).to.be.a('string');
155
+ expect(adUnit.sizes).to.be.an('array');
156
+ expect(adUnit.userIdAsEids).to.be.an('array');
100
157
  })
101
158
  })
102
159
  })
@@ -194,7 +251,7 @@ describe('limelightDigitalAdapter', function () {
194
251
  expect(dataItem.meta.advertiserDomains).to.be.an('array');
195
252
  expect(dataItem.meta.mediaType).to.be.a('string');
196
253
  }
197
- it('Returns an empty array if invalid response is passed', function () {
254
+ it('should return an empty array if invalid response is passed', function () {
198
255
  serverResponses = spec.interpretResponse('invalid_response');
199
256
  expect(serverResponses).to.be.an('array').that.is.empty;
200
257
  });
@@ -481,4 +538,5 @@ function validateAdUnit(adUnit, bid) {
481
538
  }
482
539
  }));
483
540
  expect(adUnit.publisherId).to.equal(bid.params.publisherId);
541
+ expect(adUnit.userIdAsEids).to.deep.equal(bid.userIdAsEids);
484
542
  }
@@ -552,6 +552,28 @@ describe('Livewrapped analytics adapter', function () {
552
552
  expect(message.wins[0].floor).to.equal(1.1);
553
553
  expect(message.wins[1].floor).to.equal(2.2);
554
554
  });
555
+
556
+ it('should forward runner-up data as given by Livewrapped wrapper', function () {
557
+ events.emit(AUCTION_INIT, MOCK.AUCTION_INIT);
558
+ events.emit(BID_REQUESTED, MOCK.BID_REQUESTED);
559
+
560
+ events.emit(BID_RESPONSE, MOCK.BID_RESPONSE[0]);
561
+ events.emit(BID_WON, Object.assign({},
562
+ MOCK.BID_WON[0],
563
+ {
564
+ 'rUp': 'rUpObject'
565
+ }));
566
+ events.emit(AUCTION_END, MOCK.AUCTION_END);
567
+
568
+ clock.tick(BID_WON_TIMEOUT + 1000);
569
+
570
+ expect(server.requests.length).to.equal(1);
571
+ let request = server.requests[0];
572
+ let message = JSON.parse(request.requestBody);
573
+
574
+ expect(message.wins.length).to.equal(1);
575
+ expect(message.wins[0].rUp).to.equal('rUpObject');
576
+ });
555
577
  });
556
578
 
557
579
  describe('when given other endpoint', function () {
@@ -885,6 +885,37 @@ describe('Livewrapped adapter tests', function () {
885
885
  expect(data.rtbData.user.ext.eids).to.deep.equal(testbidRequest.bids[0].userIdAsEids);
886
886
  });
887
887
 
888
+ it('should merge user ids with existing ortb2', function() {
889
+ sandbox.stub(utils, 'isSafariBrowser').callsFake(() => false);
890
+ sandbox.stub(storage, 'cookiesAreEnabled').callsFake(() => true);
891
+
892
+ let origGetConfig = config.getConfig;
893
+ sandbox.stub(config, 'getConfig').callsFake(function (key) {
894
+ if (key === 'ortb2') {
895
+ return {user: {ext: {prop: 'value'}}};
896
+ }
897
+ return origGetConfig.apply(config, arguments);
898
+ });
899
+
900
+ let testbidRequest = clone(bidderRequest);
901
+ delete testbidRequest.bids[0].params.userId;
902
+ testbidRequest.bids[0].userIdAsEids = [
903
+ {
904
+ 'source': 'pubcid.org',
905
+ 'uids': [{
906
+ 'id': 'publisher-common-id',
907
+ 'atype': 1
908
+ }]
909
+ }
910
+ ];
911
+
912
+ let result = spec.buildRequests(testbidRequest.bids, testbidRequest);
913
+ let data = JSON.parse(result.data);
914
+ var expected = {user: {ext: {prop: 'value', eids: testbidRequest.bids[0].userIdAsEids}}}
915
+
916
+ expect(data.rtbData).to.deep.equal(expected);
917
+ });
918
+
888
919
  it('should send schain object if available', function() {
889
920
  sandbox.stub(utils, 'isSafariBrowser').callsFake(() => false);
890
921
  sandbox.stub(storage, 'cookiesAreEnabled').callsFake(() => true);