prebid.js 5.16.0 → 5.20.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 (182) hide show
  1. package/.devcontainer/Dockerfile +11 -0
  2. package/.devcontainer/devcontainer.json +27 -0
  3. package/.devcontainer/postCreate.sh +6 -0
  4. package/browsers.json +1 -0
  5. package/integrationExamples/gpt/akamaidap_segments_example.html +132 -0
  6. package/modules/.submodules.json +1 -0
  7. package/modules/adfBidAdapter.js +21 -16
  8. package/modules/adgenerationBidAdapter.js +28 -4
  9. package/modules/adkernelBidAdapter.js +3 -1
  10. package/modules/admixerBidAdapter.js +11 -0
  11. package/modules/adnuntiusBidAdapter.js +1 -0
  12. package/modules/adtelligentBidAdapter.js +2 -1
  13. package/modules/airgridRtdProvider.js +1 -1
  14. package/modules/akamaiDapRtdProvider.js +474 -0
  15. package/modules/akamaiDapRtdProvider.md +47 -0
  16. package/modules/aolBidAdapter.js +2 -1
  17. package/modules/appnexusBidAdapter.js +5 -3
  18. package/modules/atsAnalyticsAdapter.js +89 -63
  19. package/modules/atsAnalyticsAdapter.md +1 -0
  20. package/modules/betweenBidAdapter.js +20 -3
  21. package/modules/bliinkBidAdapter.js +58 -32
  22. package/modules/bliinkBidAdapter.md +29 -6
  23. package/modules/browsiRtdProvider.js +106 -18
  24. package/modules/cleanioRtdProvider.js +192 -0
  25. package/modules/cleanioRtdProvider.md +59 -0
  26. package/modules/codefuelBidAdapter.js +183 -0
  27. package/modules/codefuelBidAdapter.md +111 -0
  28. package/modules/connectIdSystem.js +104 -0
  29. package/modules/connectIdSystem.md +33 -0
  30. package/modules/cwireBidAdapter.js +272 -0
  31. package/modules/cwireBidAdapter.md +43 -0
  32. package/modules/deepintentBidAdapter.js +106 -9
  33. package/modules/deepintentBidAdapter.md +36 -1
  34. package/modules/deltaprojectsBidAdapter.js +252 -0
  35. package/modules/deltaprojectsBidAdapter.md +32 -0
  36. package/modules/dgkeywordRtdProvider.js +0 -1
  37. package/modules/engageyaBidAdapter.js +157 -0
  38. package/modules/glimpseBidAdapter.js +160 -48
  39. package/modules/glimpseBidAdapter.md +11 -74
  40. package/modules/gridBidAdapter.js +1 -0
  41. package/modules/gridNMBidAdapter.js +7 -6
  42. package/modules/gumgumBidAdapter.js +16 -2
  43. package/modules/iasRtdProvider.js +83 -67
  44. package/modules/inskinBidAdapter.js +7 -3
  45. package/modules/ixBidAdapter.js +8 -1
  46. package/modules/jixieBidAdapter.js +8 -2
  47. package/modules/justpremiumBidAdapter.js +6 -1
  48. package/modules/kargoBidAdapter.js +14 -7
  49. package/modules/kargoBidAdapter.md +20 -0
  50. package/modules/limelightDigitalBidAdapter.js +22 -2
  51. package/modules/livewrappedAnalyticsAdapter.js +53 -3
  52. package/modules/mediakeysBidAdapter.js +405 -14
  53. package/modules/mediakeysBidAdapter.md +108 -0
  54. package/modules/multibid/index.js +3 -3
  55. package/modules/mytargetBidAdapter.js +112 -0
  56. package/modules/nativoBidAdapter.js +48 -29
  57. package/modules/nativoBidAdapter.md +0 -1
  58. package/modules/nextMillenniumBidAdapter.js +12 -3
  59. package/modules/nextrollBidAdapter.js +375 -0
  60. package/modules/nobidBidAdapter.js +2 -1
  61. package/modules/oguryBidAdapter.js +36 -7
  62. package/modules/openxBidAdapter.js +34 -22
  63. package/modules/operaadsBidAdapter.js +21 -1
  64. package/modules/otmBidAdapter.js +146 -0
  65. package/modules/otmBidAdapter.md +27 -26
  66. package/modules/outbrainBidAdapter.js +5 -0
  67. package/modules/pixfutureBidAdapter.js +24 -4
  68. package/modules/pixfutureBidAdapter.md +127 -0
  69. package/modules/playwireBidAdapter.md +61 -0
  70. package/modules/prebidServerBidAdapter/index.js +1 -1
  71. package/modules/proxistoreBidAdapter.js +4 -6
  72. package/modules/publinkIdSystem.js +17 -7
  73. package/modules/publinkIdSystem.md +7 -2
  74. package/modules/pubmaticBidAdapter.js +22 -6
  75. package/modules/pubmaticBidAdapter.md +1 -1
  76. package/modules/relaidoBidAdapter.js +8 -2
  77. package/modules/rtdModule/index.js +2 -2
  78. package/modules/sharethroughBidAdapter.js +12 -19
  79. package/modules/slimcutBidAdapter.js +121 -0
  80. package/modules/sonobiBidAdapter.js +7 -0
  81. package/modules/sortableBidAdapter.js +1 -0
  82. package/modules/spotxBidAdapter.js +15 -1
  83. package/modules/sspBCBidAdapter.js +207 -12
  84. package/modules/sspBCBidAdapter.md +1 -1
  85. package/modules/talkadsBidAdapter.js +129 -0
  86. package/modules/talkadsBidAdapter.md +60 -0
  87. package/modules/tappxBidAdapter.js +6 -5
  88. package/modules/teadsBidAdapter.js +3 -0
  89. package/modules/tripleliftBidAdapter.js +22 -5
  90. package/modules/trustxBidAdapter.js +17 -11
  91. package/modules/undertoneBidAdapter.js +9 -5
  92. package/modules/undertoneBidAdapter.md +5 -1
  93. package/modules/unicornBidAdapter.js +3 -3
  94. package/modules/userId/eids.js +18 -0
  95. package/modules/userId/eids.md +7 -0
  96. package/modules/userId/userId.md +12 -0
  97. package/modules/ventesBidAdapter.js +370 -0
  98. package/modules/ventesBidAdapter.md +94 -0
  99. package/modules/videobyteBidAdapter.js +13 -6
  100. package/modules/videobyteBidAdapter.md +49 -0
  101. package/modules/vidoomyBidAdapter.js +20 -12
  102. package/modules/visxBidAdapter.js +15 -22
  103. package/modules/yahoosspBidAdapter.js +637 -0
  104. package/modules/yahoosspBidAdapter.md +795 -0
  105. package/modules/yieldlabBidAdapter.js +48 -3
  106. package/modules/yieldlabBidAdapter.md +16 -1
  107. package/modules/yieldmoBidAdapter.js +20 -6
  108. package/modules/yieldmoSyntheticInventoryModule.js +46 -0
  109. package/modules/yieldmoSyntheticInventoryModule.md +68 -0
  110. package/package.json +1 -1
  111. package/src/adapterManager.js +5 -0
  112. package/src/adapters/bidderFactory.js +4 -3
  113. package/src/auction.js +11 -11
  114. package/src/constants.json +1 -0
  115. package/src/secureCreatives.js +6 -7
  116. package/src/targeting.js +11 -9
  117. package/test/.eslintrc.js +2 -1
  118. package/test/spec/modules/adfBidAdapter_spec.js +83 -29
  119. package/test/spec/modules/adgenerationBidAdapter_spec.js +121 -50
  120. package/test/spec/modules/adnuntiusBidAdapter_spec.js +68 -0
  121. package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
  122. package/test/spec/modules/akamaiDapRtdProvider_spec.js +246 -0
  123. package/test/spec/modules/appnexusBidAdapter_spec.js +2 -1
  124. package/test/spec/modules/atsAnalyticsAdapter_spec.js +77 -9
  125. package/test/spec/modules/betweenBidAdapter_spec.js +41 -0
  126. package/test/spec/modules/bliinkBidAdapter_spec.js +87 -36
  127. package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
  128. package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
  129. package/test/spec/modules/codefuelBidAdapter_spec.js +316 -0
  130. package/test/spec/modules/connectIdSystem_spec.js +189 -0
  131. package/test/spec/modules/cwireBidAdapter_spec.js +246 -0
  132. package/test/spec/modules/deepintentBidAdapter_spec.js +153 -3
  133. package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
  134. package/test/spec/modules/engageyaBidAdapter_spec.js +286 -0
  135. package/test/spec/modules/glimpseBidAdapter_spec.js +302 -204
  136. package/test/spec/modules/gridNMBidAdapter_spec.js +40 -1
  137. package/test/spec/modules/gumgumBidAdapter_spec.js +23 -6
  138. package/test/spec/modules/iasRtdProvider_spec.js +71 -6
  139. package/test/spec/modules/ixBidAdapter_spec.js +13 -3
  140. package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
  141. package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
  142. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +155 -1
  143. package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +67 -12
  144. package/test/spec/modules/mediakeysBidAdapter_spec.js +406 -51
  145. package/test/spec/modules/multibid_spec.js +31 -31
  146. package/test/spec/modules/mytargetBidAdapter_spec.js +199 -0
  147. package/test/spec/modules/nativoBidAdapter_spec.js +50 -3
  148. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +13 -1
  149. package/test/spec/modules/nextrollBidAdapter_spec.js +290 -0
  150. package/test/spec/modules/nobidBidAdapter_spec.js +65 -1
  151. package/test/spec/modules/oguryBidAdapter_spec.js +125 -37
  152. package/test/spec/modules/openxBidAdapter_spec.js +85 -13
  153. package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
  154. package/test/spec/modules/otmBidAdapter_spec.js +67 -0
  155. package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
  156. package/test/spec/modules/publinkIdSystem_spec.js +34 -15
  157. package/test/spec/modules/pubmaticBidAdapter_spec.js +217 -1
  158. package/test/spec/modules/relaidoBidAdapter_spec.js +21 -20
  159. package/test/spec/modules/sharethroughBidAdapter_spec.js +156 -136
  160. package/test/spec/modules/slimcutBidAdapter_spec.js +200 -0
  161. package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
  162. package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
  163. package/test/spec/modules/spotxBidAdapter_spec.js +36 -0
  164. package/test/spec/modules/sspBCBidAdapter_spec.js +210 -62
  165. package/test/spec/modules/talkadsBidAdapter_spec.js +231 -0
  166. package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
  167. package/test/spec/modules/tripleliftBidAdapter_spec.js +128 -0
  168. package/test/spec/modules/trustxBidAdapter_spec.js +38 -5
  169. package/test/spec/modules/undertoneBidAdapter_spec.js +52 -0
  170. package/test/spec/modules/unicornBidAdapter_spec.js +4 -4
  171. package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
  172. package/test/spec/modules/videobyteBidAdapter_spec.js +2 -2
  173. package/test/spec/modules/visxBidAdapter_spec.js +48 -4
  174. package/test/spec/modules/yahoosspBidAdapter_spec.js +1332 -0
  175. package/test/spec/modules/yieldlabBidAdapter_spec.js +65 -1
  176. package/test/spec/modules/yieldmoBidAdapter_spec.js +30 -9
  177. package/test/spec/modules/yieldmoSyntheticInventoryModule_spec.js +89 -0
  178. package/test/spec/unit/core/adapterManager_spec.js +32 -0
  179. package/test/spec/unit/core/bidderFactory_spec.js +61 -1
  180. package/test/spec/unit/pbjs_api_spec.js +37 -2
  181. package/test/spec/unit/secureCreatives_spec.js +54 -25
  182. package/modules/turktelekomBidAdapter.md +0 -49
@@ -1,7 +1,9 @@
1
- import { iasSubModule } from 'modules/iasRtdProvider.js';
1
+ import { iasSubModule, iasTargeting } from 'modules/iasRtdProvider.js';
2
2
  import { expect } from 'chai';
3
3
  import { server } from 'test/mocks/xhr.js';
4
4
 
5
+ const responseHeader = { 'Content-Type': 'application/json' };
6
+
5
7
  describe('iasRtdProvider is a RTD provider that', function () {
6
8
  it('has the correct module name', function () {
7
9
  expect(iasSubModule.name).to.equal('ias');
@@ -10,8 +12,33 @@ describe('iasRtdProvider is a RTD provider that', function () {
10
12
  it('exists', function () {
11
13
  expect(iasSubModule.init).to.be.a('function');
12
14
  });
13
- it('returns true', function () {
14
- expect(iasSubModule.init()).to.equal(true);
15
+ it('returns false missing config params', function () {
16
+ const config = {
17
+ name: 'ias',
18
+ waitForIt: true,
19
+ };
20
+ const value = iasSubModule.init(config);
21
+ expect(value).to.equal(false);
22
+ });
23
+ it('returns false missing pubId param', function () {
24
+ const config = {
25
+ name: 'ias',
26
+ waitForIt: true,
27
+ params: {}
28
+ };
29
+ const value = iasSubModule.init(config);
30
+ expect(value).to.equal(false);
31
+ });
32
+ it('returns false missing pubId param', function () {
33
+ const config = {
34
+ name: 'ias',
35
+ waitForIt: true,
36
+ params: {
37
+ pubId: '123456'
38
+ }
39
+ };
40
+ const value = iasSubModule.init(config);
41
+ expect(value).to.equal(true);
15
42
  });
16
43
  });
17
44
  describe('has a method `getBidRequestData` that', function () {
@@ -30,10 +57,17 @@ describe('iasRtdProvider is a RTD provider that', function () {
30
57
  const adUnitsOriginal = adUnits;
31
58
  iasSubModule.getBidRequestData({ adUnits: adUnits }, callback, config);
32
59
  request = server.requests[0];
33
- server.respond();
60
+ request.respond(200, responseHeader, JSON.stringify(data));
34
61
  expect(request.url).to.be.include(`https://pixel.adsafeprotected.com/services/pub?anId=1234`);
35
62
  expect(adUnits).to.length(2);
36
63
  expect(adUnits[0]).to.be.eq(adUnitsOriginal[0]);
64
+ const targetingKeys = Object.keys(iasTargeting);
65
+ const dataKeys = Object.keys(data);
66
+ expect(targetingKeys.length).to.equal(dataKeys.length);
67
+ expect(targetingKeys['fr']).to.be.eq(dataKeys['fr']);
68
+ expect(targetingKeys['brandSafety']).to.be.eq(dataKeys['brandSafety']);
69
+ expect(targetingKeys['ias-kw']).to.be.eq(dataKeys['ias-kw']);
70
+ expect(targetingKeys['slots']).to.be.eq(dataKeys['slots']);
37
71
  });
38
72
  });
39
73
 
@@ -42,10 +76,32 @@ describe('iasRtdProvider is a RTD provider that', function () {
42
76
  expect(iasSubModule.getTargetingData).to.be.a('function');
43
77
  });
44
78
  it('invoke method', function () {
45
- const targeting = iasSubModule.getTargetingData(adUnits, config);
46
- expect(adUnits).to.length(2);
79
+ const targeting = iasSubModule.getTargetingData(adUnitsCode, config);
80
+ expect(adUnitsCode).to.length(2);
47
81
  expect(targeting).to.be.not.null;
48
82
  expect(targeting).to.be.not.empty;
83
+ expect(targeting['one-div-id']).to.be.not.null;
84
+ const targetingKeys = Object.keys(targeting['one-div-id']);
85
+ expect(targetingKeys.length).to.equal(10);
86
+ expect(targetingKeys['adt']).to.be.not.null;
87
+ expect(targetingKeys['alc']).to.be.not.null;
88
+ expect(targetingKeys['dlm']).to.be.not.null;
89
+ expect(targetingKeys['drg']).to.be.not.null;
90
+ expect(targetingKeys['hat']).to.be.not.null;
91
+ expect(targetingKeys['off']).to.be.not.null;
92
+ expect(targetingKeys['vio']).to.be.not.null;
93
+ expect(targetingKeys['fr']).to.be.not.null;
94
+ expect(targetingKeys['ias-kw']).to.be.not.null;
95
+ expect(targetingKeys['id']).to.be.not.null;
96
+ expect(targeting['one-div-id']['adt']).to.be.eq('veryLow');
97
+ expect(targeting['one-div-id']['alc']).to.be.eq('veryLow');
98
+ expect(targeting['one-div-id']['dlm']).to.be.eq('veryLow');
99
+ expect(targeting['one-div-id']['drg']).to.be.eq('veryLow');
100
+ expect(targeting['one-div-id']['hat']).to.be.eq('veryLow');
101
+ expect(targeting['one-div-id']['off']).to.be.eq('veryLow');
102
+ expect(targeting['one-div-id']['vio']).to.be.eq('veryLow');
103
+ expect(targeting['one-div-id']['fr']).to.be.eq('false');
104
+ expect(targeting['one-div-id']['id']).to.be.eq('4813f7a2-1f22-11ec-9bfd-0a1107f94461');
49
105
  });
50
106
  });
51
107
  });
@@ -58,6 +114,8 @@ const config = {
58
114
  }
59
115
  };
60
116
 
117
+ const adUnitsCode = ['one-div-id', 'two-div-id'];
118
+
61
119
  const adUnits = [
62
120
  {
63
121
  code: 'one-div-id',
@@ -87,3 +145,10 @@ const adUnits = [
87
145
  }
88
146
  }]
89
147
  }];
148
+
149
+ const data = {
150
+ brandSafety: { adt: 'veryLow', alc: 'veryLow', dlm: 'veryLow', drg: 'veryLow', hat: 'veryLow', off: 'veryLow', vio: 'veryLow' },
151
+ custom: { 'ias-kw': ['IAS_5995_KW', 'IAS_7066_KW', 'IAS_7232_KW', 'IAS_7364_KW', 'IAS_3894_KW', 'IAS_6535_KW', 'IAS_6153_KW', 'IAS_5238_KW', 'IAS_7393_KW', 'IAS_1499_KW', 'IAS_7376_KW', 'IAS_1035_KW', 'IAS_6566_KW', 'IAS_1058_KW', 'IAS_11338_724_KW', 'IAS_7301_KW', 'IAS_15969_725_KW', 'IAS_6358_KW', 'IAS_710_KW', 'IAS_5445_KW', 'IAS_3822_KW', 'IAS_4901_KW', 'IAS_5806_KW', 'IAS_460_KW', 'IAS_11461_702_KW', 'IAS_5681_KW', 'IAS_17609_1240_KW', 'IAS_6634_KW', 'IAS_5597_KW'] },
152
+ fr: 'false',
153
+ slots: { 'one-div-id': { id: '4813f7a2-1f22-11ec-9bfd-0a1107f94461' } }
154
+ };
@@ -1377,6 +1377,11 @@ describe('IndexexchangeAdapter', function () {
1377
1377
  expect(requestUrl).to.equal(IX_SECURE_ENDPOINT);
1378
1378
  });
1379
1379
 
1380
+ it('auction type should be set correctly', function () {
1381
+ const at = JSON.parse(query.r).at;
1382
+ expect(at).to.equal(1);
1383
+ })
1384
+
1380
1385
  it('query object (version, siteID and request) should be correct', function () {
1381
1386
  expect(query.v).to.equal(BANNER_ENDPOINT_VERSION);
1382
1387
  expect(query.s).to.equal(DEFAULT_BANNER_VALID_BID[0].params.siteId);
@@ -1400,16 +1405,16 @@ describe('IndexexchangeAdapter', function () {
1400
1405
  }
1401
1406
  };
1402
1407
  const requests = spec.buildRequests(validBids, DEFAULT_OPTION);
1403
- const { dfp_ad_unit_code } = JSON.parse(requests[0].data.r).imp[0].banner.format[0].ext;
1408
+ const { ext: { dfp_ad_unit_code } } = JSON.parse(requests[0].data.r).imp[0];
1404
1409
  expect(dfp_ad_unit_code).to.equal(AD_UNIT_CODE);
1405
1410
  });
1406
1411
 
1407
1412
  it('should not send dfp_adunit_code in request if ortb2Imp.ext.data.adserver.adslot does not exists', function () {
1408
1413
  const validBids = utils.deepClone(DEFAULT_BANNER_VALID_BID);
1409
1414
  const requests = spec.buildRequests(validBids, DEFAULT_OPTION);
1410
- const { dfp_ad_unit_code } = JSON.parse(requests[0].data.r).imp[0].banner.format[0].ext;
1415
+ const { ext } = JSON.parse(requests[0].data.r).imp[0];
1411
1416
 
1412
- expect(dfp_ad_unit_code).to.not.exist;
1417
+ expect(ext).to.not.exist;
1413
1418
  });
1414
1419
 
1415
1420
  it('payload should have correct format and value', function () {
@@ -1929,6 +1934,11 @@ describe('IndexexchangeAdapter', function () {
1929
1934
  expect(query.nf).to.equal(1);
1930
1935
  });
1931
1936
 
1937
+ it('auction type should be set correctly', function () {
1938
+ const at = JSON.parse(query.r).at;
1939
+ expect(at).to.equal(1);
1940
+ })
1941
+
1932
1942
  it('impression should have correct format and value', function () {
1933
1943
  const impression = JSON.parse(query.r).imp[0];
1934
1944
  const sidValue = utils.parseGPTSingleSizeArray(DEFAULT_VIDEO_VALID_BID[0].params.size);
@@ -9,6 +9,7 @@ describe('jixie Adapter', function () {
9
9
  const device_ = 'desktop';
10
10
  const timeout_ = 1000;
11
11
  const currency_ = 'USD';
12
+ const keywords_ = '';
12
13
 
13
14
  /**
14
15
  * Basic
@@ -212,7 +213,7 @@ describe('jixie Adapter', function () {
212
213
  );
213
214
  let miscDimsStub = sinon.stub(jixieaux, 'getMiscDims');
214
215
  miscDimsStub
215
- .returns({ device: device_, pageurl: pageurl_, domain: domain_ });
216
+ .returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ });
216
217
 
217
218
  // actual api call:
218
219
  const request = spec.buildRequests(bidRequests_, bidderRequest_);
@@ -229,6 +230,7 @@ describe('jixie Adapter', function () {
229
230
  expect(payload).to.have.property('device', device_);
230
231
  expect(payload).to.have.property('domain', domain_);
231
232
  expect(payload).to.have.property('pageurl', pageurl_);
233
+ expect(payload).to.have.property('mkeywords', keywords_);
232
234
  expect(payload).to.have.property('timeout', timeout_);
233
235
  expect(payload).to.have.property('currency', currency_);
234
236
  expect(payload).to.have.property('bids').that.deep.equals(refBids_);
@@ -243,15 +245,15 @@ describe('jixie Adapter', function () {
243
245
  /**
244
246
  * interpretResponse:
245
247
  */
246
- const JX_OTHER_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.io/dummyscript.js';
247
- const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.io/jxhboutstream.js';
248
+ const JX_OTHER_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.media/dummyscript.js';
249
+ const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.media/jxhbrenderer.1.1.min.js';
248
250
 
249
- const mockVastXml_ = `<?xml version="1.0" encoding="UTF-8"?><VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd" version="3.0"><Ad id="JXAD521"><InLine><AdSystem>JXADSERVER</AdSystem><AdTitle>Alway%20Live%20Prebid%20Creative</AdTitle><Description>Hybrid in-stream</Description><Error><![CDATA[https://demo.com?action=error&errorcode=[ERRORCODE]&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Error><Impression><![CDATA[https://demo.com?action=impression&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Impression><Creatives><Creative id="JXAD521" sequence="1"><Linear><Duration>00:00:10</Duration><TrackingEvents><Tracking event="start"><![CDATA[https://demo.com?action=start&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="firstQuartile"><![CDATA[https://demo.com?action=firstQuartile&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="midpoint"><![CDATA[https://demo.com?action=midpoint&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="thirdQuartile"><![CDATA[https://demo.com?action=thirdQuartile&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="complete"><![CDATA[https://demo.com?action=complete&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="mute"><![CDATA[https://demo.com?action=mute&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="unmute"><![CDATA[https://demo.com?action=unmute&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="rewind"><![CDATA[https://demo.com?action=rewind&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="pause"><![CDATA[https://demo.com?action=pause&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="resume"><![CDATA[https://demo.com?action=resume&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="fullscreen"><![CDATA[https://demo.com?action=fullscreen&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="creativeView"><![CDATA[https://demo.com?action=creativeView&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking></TrackingEvents><VideoClicks><ClickThrough><![CDATA[https://toko-iot.com/search/?q=Sonos&utm_source=ivs&utm_medium=video&utm_campaign=promo&utm_content=sonos_category]]></ClickThrough><ClickTracking id="521"><![CDATA[https://demo.com?action=click&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></ClickTracking></VideoClicks><MediaFiles><MediaFile apiFramework="VPAID" type="application/javascript"><![CDATA[https://creatives.b-cdn.net/js/jxvpaid_1_0.min.js]]></MediaFile></MediaFiles><AdParameters><![CDATA[{"embed":true,"videos":[{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_240.mp4","bitrate":186,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_360.mp4","bitrate":229,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_480.mp4","bitrate":279,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_720.mp4","bitrate":325,"mimetype":"video/mp4"}],"countpos":"left","hotspots":[{"type":"direct_url","start":0,"duration":10,"position":"top-right","direct_url":"https://toko-iot.com/catalogue/category/audio_8/?utm_source=ivs&utm_medium=banner&utm_campaign=promo&utm_content=audio_category","thumbnail_url":"https://creatives.ivideosmart.com/hotspots/TokoIOT_1.gif","thumbnail_style":"full-height"}],"clickthru":"https://toko-iot.com/search/?q=Sonos&utm_source=ivs&utm_medium=video&utm_campaign=promo&utm_content=sonos_category","reporting":{},"skipoffset":5}]]></AdParameters><Icons><Icon program="AdChoices" width="20" height="20" xPosition="right" yPosition="top" offset="00:00:02"><StaticResource creativeType="image/png"><![CDATA[https://creatives.jixie.io/jxadchoice.png]]></StaticResource><IconClicks><IconClickThrough><![CDATA[https://www.jixie.io/privacy-policy]]></IconClickThrough></IconClicks></Icon></Icons></Linear></Creative><Creative sequence="1"/></Creatives></InLine></Ad></VAST>`;
251
+ const mockVastXml_ = `<?xml version="1.0" encoding="UTF-8"?><VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd" version="3.0"><Ad id="JXAD521"><InLine><AdSystem>JXADSERVER</AdSystem><AdTitle>Alway%20Live%20Prebid%20Creative</AdTitle><Description>Hybrid in-stream</Description><Error><![CDATA[https://demo.com?action=error&errorcode=[ERRORCODE]&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Error><Impression><![CDATA[https://demo.com?action=impression&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Impression><Creatives><Creative id="JXAD521" sequence="1"><Linear><Duration>00:00:10</Duration><TrackingEvents><Tracking event="start"><![CDATA[https://demo.com?action=start&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="firstQuartile"><![CDATA[https://demo.com?action=firstQuartile&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="midpoint"><![CDATA[https://demo.com?action=midpoint&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="thirdQuartile"><![CDATA[https://demo.com?action=thirdQuartile&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="complete"><![CDATA[https://demo.com?action=complete&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="mute"><![CDATA[https://demo.com?action=mute&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="unmute"><![CDATA[https://demo.com?action=unmute&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="rewind"><![CDATA[https://demo.com?action=rewind&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="pause"><![CDATA[https://demo.com?action=pause&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="resume"><![CDATA[https://demo.com?action=resume&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="fullscreen"><![CDATA[https://demo.com?action=fullscreen&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="creativeView"><![CDATA[https://demo.com?action=creativeView&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking></TrackingEvents><VideoClicks><ClickThrough><![CDATA[https://toko-iot.com/search/?q=Sonos&utm_source=ivs&utm_medium=video&utm_campaign=promo&utm_content=sonos_category]]></ClickThrough><ClickTracking id="521"><![CDATA[https://demo.com?action=click&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></ClickTracking></VideoClicks><MediaFiles><MediaFile apiFramework="VPAID" type="application/javascript"><![CDATA[https://creatives.b-cdn.net/js/jxvpaid_1_0.min.js]]></MediaFile></MediaFiles><AdParameters><![CDATA[{"embed":true,"videos":[{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_240.mp4","bitrate":186,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_360.mp4","bitrate":229,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_480.mp4","bitrate":279,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_720.mp4","bitrate":325,"mimetype":"video/mp4"}],"countpos":"left","hotspots":[{"type":"direct_url","start":0,"duration":10,"position":"top-right","direct_url":"https://toko-iot.com/catalogue/category/audio_8/?utm_source=ivs&utm_medium=banner&utm_campaign=promo&utm_content=audio_category","thumbnail_url":"https://creatives.ivideosmart.com/hotspots/TokoIOT_1.gif","thumbnail_style":"full-height"}],"clickthru":"https://toko-iot.com/search/?q=Sonos&utm_source=ivs&utm_medium=video&utm_campaign=promo&utm_content=sonos_category","reporting":{},"skipoffset":5}]]></AdParameters><Icons><Icon program="AdChoices" width="20" height="20" xPosition="right" yPosition="top" offset="00:00:02"><StaticResource creativeType="image/png"><![CDATA[https://creatives.jixie.media/jxadchoice.png]]></StaticResource><IconClicks><IconClickThrough><![CDATA[https://www.jixie.io/privacy-policy]]></IconClickThrough></IconClicks></Icon></Icons></Linear></Creative><Creative sequence="1"/></Creatives></InLine></Ad></VAST>`;
250
252
  const responseBody_ = {
251
253
  'bids': [
252
254
  // video (vast tag url) returned here
253
255
  {
254
- 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?',
256
+ 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?',
255
257
  'jxBidId': '62847e4c696edcb-028d5dee-2c83-44e3-bed1-b75002475cdf',
256
258
  'requestId': '62847e4c696edcb',
257
259
  'cpm': 2.19,
@@ -284,7 +286,7 @@ describe('jixie Adapter', function () {
284
286
  // display ad returned here: This one there is advertiserDomains
285
287
  // in the response . Will be checked in the unit tests below
286
288
  {
287
- 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?',
289
+ 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?',
288
290
  'jxBidId': '600c9ae6fda1acb-028d5dee-2c83-44e3-bed1-b75002475cdf',
289
291
  'requestId': '600c9ae6fda1acb',
290
292
  'cpm': 1.999,
@@ -317,11 +319,11 @@ describe('jixie Adapter', function () {
317
319
  ],
318
320
  'mediaType': 'BANNER'
319
321
  },
320
- 'ad': '<div id="jxoutstream" style="width: 100%;"> <script type="text/javascript" src="https://scripts.jixie.io/jxfriendly.1.3.min.js" defer=""></script> <script> var p ={ responsive: 1, nested: 1, maxwidth: 640, container: "jxoutstream", creativeid: 520}; function jxdefer(p) { if (window.jxuniversal) { window.jxuniversal.init(p); } else { setTimeout(function() { jxdefer(p) }, 100); } } jxdefer(p); </script> </div>'
322
+ 'ad': '<div id="jxoutstream" style="width: 100%;"> <script type="text/javascript" src="https://scripts.jixie.media/jxfriendly.1.3.min.js" defer=""></script> <script> var p ={ responsive: 1, nested: 1, maxwidth: 640, container: "jxoutstream", creativeid: 520}; function jxdefer(p) { if (window.jxuniversal) { window.jxuniversal.init(p); } else { setTimeout(function() { jxdefer(p) }, 100); } } jxdefer(p); </script> </div>'
321
323
  },
322
324
  // outstream, jx non-default renderer specified:
323
325
  {
324
- 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?',
326
+ 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?',
325
327
  'jxBidId': '99bc539c81b00ce-028d5dee-2c83-44e3-bed1-b75002475cdf',
326
328
  'requestId': '99bc539c81b00ce',
327
329
  'cpm': 2.99,
@@ -340,7 +342,7 @@ describe('jixie Adapter', function () {
340
342
  },
341
343
  // outstream, jx default renderer:
342
344
  {
343
- 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?',
345
+ 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?',
344
346
  'jxBidId': '61bc539c81b00ce-028d5dee-2c83-44e3-bed1-b75002475cdf',
345
347
  'requestId': '61bc539c81b00ce',
346
348
  'cpm': 1.99,
@@ -475,7 +477,7 @@ describe('jixie Adapter', function () {
475
477
  ajaxStub = sinon.stub(jixieaux, 'ajax');
476
478
 
477
479
  miscDimsStub
478
- .returns({ device: device_, pageurl: pageurl_, domain: domain_ });
480
+ .returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ });
479
481
  })
480
482
 
481
483
  afterEach(function() {
@@ -537,7 +539,7 @@ describe('jixie Adapter', function () {
537
539
  ajaxStub = sinon.stub(jixieaux, 'ajax');
538
540
  miscDimsStub = sinon.stub(jixieaux, 'getMiscDims');
539
541
  miscDimsStub
540
- .returns({ device: device_, pageurl: pageurl_, domain: domain_ });
542
+ .returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ });
541
543
  })
542
544
 
543
545
  afterEach(function() {
@@ -97,7 +97,7 @@ describe('justpremium adapter', function () {
97
97
  expect(jpxRequest.id).to.equal(adUnits[0].params.zone)
98
98
  expect(jpxRequest.mediaTypes && jpxRequest.mediaTypes.banner && jpxRequest.mediaTypes.banner.sizes).to.not.equal('undefined')
99
99
  expect(jpxRequest.version.prebid).to.equal('$prebid.version$')
100
- expect(jpxRequest.version.jp_adapter).to.equal('1.8')
100
+ expect(jpxRequest.version.jp_adapter).to.equal('1.8.1')
101
101
  expect(jpxRequest.pubcid).to.equal('0000000')
102
102
  expect(jpxRequest.uids.tdid).to.equal('1111111')
103
103
  expect(jpxRequest.uids.id5id.uid).to.equal('2222222')
@@ -118,7 +118,10 @@ describe('justpremium adapter', function () {
118
118
  'price': 0.52,
119
119
  'format': 'lb',
120
120
  'adm': 'creative code',
121
- 'adomain': ['justpremium.com']
121
+ 'adomain': ['justpremium.com'],
122
+ 'ext': {
123
+ 'pg': true
124
+ }
122
125
  }]
123
126
  },
124
127
  'pass': {
@@ -142,6 +145,9 @@ describe('justpremium adapter', function () {
142
145
  meta: {
143
146
  advertiserDomains: ['justpremium.com']
144
147
  },
148
+ adserverTargeting: {
149
+ 'hb_deal_justpremium': 'jp_pg'
150
+ }
145
151
  }
146
152
  ]
147
153
 
@@ -159,6 +165,7 @@ describe('justpremium adapter', function () {
159
165
  expect(result[0].netRevenue).to.equal(true)
160
166
  expect(result[0].format).to.equal('lb')
161
167
  expect(result[0].meta.advertiserDomains[0]).to.equal('justpremium.com')
168
+ expect(result[0].adserverTargeting).to.deep.equal({'hb_deal_justpremium': 'jp_pg'})
162
169
  })
163
170
 
164
171
  it('Verify wrong server response', function () {
@@ -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
  }