prebid.js 6.26.0 → 6.27.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 (188) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/adWMGAnalyticsAdapter.js +1 -1
  3. package/dist/adagioAnalyticsAdapter.js +1 -1
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/adkernelAdnAnalyticsAdapter.js +1 -1
  8. package/dist/adlooxAdServerVideo.js +1 -1
  9. package/dist/adlooxAnalyticsAdapter.js +1 -1
  10. package/dist/adlooxRtdProvider.js +1 -1
  11. package/dist/adomikAnalyticsAdapter.js +1 -1
  12. package/dist/adrelevantisBidAdapter.js +1 -1
  13. package/dist/adxcgAnalyticsAdapter.js +1 -1
  14. package/dist/adxcgBidAdapter.js +1 -1
  15. package/dist/adxpremiumAnalyticsAdapter.js +1 -1
  16. package/dist/ajaBidAdapter.js +1 -1
  17. package/dist/akamaiDapRtdProvider.js +1 -1
  18. package/dist/amxBidAdapter.js +1 -1
  19. package/dist/amxIdSystem.js +1 -1
  20. package/dist/appierAnalyticsAdapter.js +1 -1
  21. package/dist/appnexusAnalyticsAdapter.js +1 -1
  22. package/dist/appnexusBidAdapter.js +1 -1
  23. package/dist/asoBidAdapter.js +1 -1
  24. package/dist/atsAnalyticsAdapter.js +1 -1
  25. package/dist/axonixBidAdapter.js +1 -1
  26. package/dist/bidglassBidAdapter.js +1 -1
  27. package/dist/bidwatchAnalyticsAdapter.js +1 -1
  28. package/dist/big-richmediaBidAdapter.js +1 -1
  29. package/dist/bridgewellBidAdapter.js +1 -1
  30. package/dist/brightMountainMediaBidAdapter.js +1 -1
  31. package/dist/byDataAnalyticsAdapter.js +1 -1
  32. package/dist/colossussspBidAdapter.js +1 -1
  33. package/dist/concertAnalyticsAdapter.js +1 -1
  34. package/dist/concertBidAdapter.js +1 -1
  35. package/dist/connectadBidAdapter.js +1 -1
  36. package/dist/consumableBidAdapter.js +1 -1
  37. package/dist/conversantBidAdapter.js +1 -1
  38. package/dist/craftBidAdapter.js +1 -1
  39. package/dist/criteoBidAdapter.js +1 -1
  40. package/dist/datablocksAnalyticsAdapter.js +1 -1
  41. package/dist/dspxBidAdapter.js +1 -1
  42. package/dist/eplanningAnalyticsAdapter.js +1 -1
  43. package/dist/eplanningBidAdapter.js +1 -1
  44. package/dist/fintezaAnalyticsAdapter.js +1 -1
  45. package/dist/ftrackIdSystem.js +1 -1
  46. package/dist/glimpseBidAdapter.js +1 -1
  47. package/dist/gmosspBidAdapter.js +1 -1
  48. package/dist/goldbachBidAdapter.js +1 -1
  49. package/dist/gridBidAdapter.js +1 -1
  50. package/dist/gridNMBidAdapter.js +1 -1
  51. package/dist/gumgumBidAdapter.js +1 -1
  52. package/dist/h12mediaBidAdapter.js +1 -1
  53. package/dist/hadronAnalyticsAdapter.js +1 -1
  54. package/dist/id5AnalyticsAdapter.js +1 -1
  55. package/dist/id5IdSystem.js +1 -1
  56. package/dist/improvedigitalBidAdapter.js +1 -1
  57. package/dist/inmarBidAdapter.js +1 -1
  58. package/dist/insticatorBidAdapter.js +1 -1
  59. package/dist/invisiblyAnalyticsAdapter.js +1 -1
  60. package/dist/ixBidAdapter.js +1 -1
  61. package/dist/justpremiumBidAdapter.js +1 -1
  62. package/dist/kargoAnalyticsAdapter.js +1 -1
  63. package/dist/koblerBidAdapter.js +1 -1
  64. package/dist/konduitAnalyticsAdapter.js +1 -1
  65. package/dist/livewrappedAnalyticsAdapter.js +1 -1
  66. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  67. package/dist/logicadBidAdapter.js +1 -1
  68. package/dist/loglyliftBidAdapter.js +1 -1
  69. package/dist/malltvAnalyticsAdapter.js +1 -1
  70. package/dist/marsmediaAnalyticsAdapter.js +1 -1
  71. package/dist/marsmediaBidAdapter.js +1 -1
  72. package/dist/mediafuseBidAdapter.js +1 -1
  73. package/dist/medianetAnalyticsAdapter.js +1 -1
  74. package/dist/mediasquareBidAdapter.js +1 -1
  75. package/dist/mgidBidAdapter.js +1 -1
  76. package/dist/minutemediaBidAdapter.js +1 -1
  77. package/dist/naveggIdSystem.js +1 -1
  78. package/dist/not-for-prod/prebid.js +153 -152
  79. package/dist/novatiqIdSystem.js +1 -1
  80. package/dist/oguryBidAdapter.js +1 -1
  81. package/dist/oneVideoBidAdapter.js +1 -1
  82. package/dist/onetagBidAdapter.js +1 -1
  83. package/dist/ooloAnalyticsAdapter.js +1 -1
  84. package/dist/openxAnalyticsAdapter.js +1 -1
  85. package/dist/optimonAnalyticsAdapter.js +1 -1
  86. package/dist/outbrainBidAdapter.js +1 -1
  87. package/dist/parrableIdSystem.js +1 -1
  88. package/dist/pixfutureBidAdapter.js +1 -1
  89. package/dist/prebid-core.js +3 -3
  90. package/dist/prebidmanagerAnalyticsAdapter.js +1 -1
  91. package/dist/publinkIdSystem.js +1 -1
  92. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  93. package/dist/pubmaticBidAdapter.js +1 -1
  94. package/dist/pubperfAnalyticsAdapter.js +1 -1
  95. package/dist/pubstackAnalyticsAdapter.js +1 -1
  96. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  97. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  98. package/dist/pulsepointAnalyticsAdapter.js +1 -1
  99. package/dist/pxyzBidAdapter.js +1 -1
  100. package/dist/quantcastBidAdapter.js +1 -1
  101. package/dist/readpeakBidAdapter.js +1 -1
  102. package/dist/realvuAnalyticsAdapter.js +1 -1
  103. package/dist/relaidoBidAdapter.js +1 -1
  104. package/dist/relevantAnalyticsAdapter.js +1 -1
  105. package/dist/rhythmoneBidAdapter.js +1 -1
  106. package/dist/riseBidAdapter.js +1 -1
  107. package/dist/rivrAnalyticsAdapter.js +1 -1
  108. package/dist/roxotAnalyticsAdapter.js +1 -1
  109. package/dist/rubiconAnalyticsAdapter.js +1 -1
  110. package/dist/rubiconBidAdapter.js +1 -1
  111. package/dist/scaleableAnalyticsAdapter.js +1 -1
  112. package/dist/seedingAllianceBidAdapter.js +1 -1
  113. package/dist/seedtagBidAdapter.js +1 -1
  114. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  115. package/dist/sharethroughBidAdapter.js +1 -1
  116. package/dist/sigmoidAnalyticsAdapter.js +1 -1
  117. package/dist/smaatoBidAdapter.js +1 -1
  118. package/dist/smartadserverBidAdapter.js +1 -1
  119. package/dist/smartxBidAdapter.js +1 -1
  120. package/dist/smilewantedBidAdapter.js +1 -1
  121. package/dist/sonobiAnalyticsAdapter.js +1 -1
  122. package/dist/sonobiBidAdapter.js +1 -1
  123. package/dist/sortableAnalyticsAdapter.js +1 -1
  124. package/dist/sortableBidAdapter.js +1 -1
  125. package/dist/sovrnAnalyticsAdapter.js +1 -1
  126. package/dist/sovrnBidAdapter.js +1 -1
  127. package/dist/sspBCBidAdapter.js +1 -1
  128. package/dist/staqAnalyticsAdapter.js +1 -1
  129. package/dist/sublimeBidAdapter.js +1 -1
  130. package/dist/synacormediaBidAdapter.js +1 -1
  131. package/dist/taboolaBidAdapter.js +1 -0
  132. package/dist/targetVideoBidAdapter.js +1 -1
  133. package/dist/teadsBidAdapter.js +1 -1
  134. package/dist/terceptAnalyticsAdapter.js +1 -1
  135. package/dist/trionBidAdapter.js +1 -1
  136. package/dist/tripleliftBidAdapter.js +1 -1
  137. package/dist/trustxBidAdapter.js +1 -1
  138. package/dist/ttdBidAdapter.js +1 -1
  139. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  140. package/dist/underdogmediaBidAdapter.js +1 -1
  141. package/dist/undertoneBidAdapter.js +1 -1
  142. package/dist/vidazooBidAdapter.js +1 -1
  143. package/dist/videobyteBidAdapter.js +1 -1
  144. package/dist/visxBidAdapter.js +1 -1
  145. package/dist/vuukleBidAdapter.js +1 -1
  146. package/dist/widespaceBidAdapter.js +1 -1
  147. package/dist/winrBidAdapter.js +1 -1
  148. package/dist/yahoosspBidAdapter.js +1 -1
  149. package/dist/yieldmoBidAdapter.js +1 -1
  150. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  151. package/dist/yuktamediaAnalyticsAdapter.js +1 -1
  152. package/dist/zeta_global_sspAnalyticsAdapter.js +1 -1
  153. package/integrationExamples/gpt/akamaidap_segments_example.html +5 -3
  154. package/modules/.submodules.json +1 -0
  155. package/modules/adlooxAnalyticsAdapter.js +9 -5
  156. package/modules/adlooxAnalyticsAdapter.md +3 -3
  157. package/modules/adlooxRtdProvider.js +3 -5
  158. package/modules/adlooxRtdProvider.md +2 -2
  159. package/modules/akamaiDapRtdProvider.js +460 -130
  160. package/modules/akamaiDapRtdProvider.md +5 -3
  161. package/modules/colossussspBidAdapter.js +17 -17
  162. package/modules/conversantBidAdapter.js +2 -2
  163. package/modules/ftrackIdSystem.js +3 -4
  164. package/modules/hadronAnalyticsAdapter.js +5 -1
  165. package/modules/koblerBidAdapter.js +54 -45
  166. package/modules/koblerBidAdapter.md +12 -17
  167. package/modules/naveggIdSystem.js +3 -2
  168. package/modules/novatiqIdSystem.js +6 -1
  169. package/modules/relaidoBidAdapter.js +0 -3
  170. package/modules/taboolaBidAdapter.js +265 -0
  171. package/modules/taboolaBidAdapter.md +49 -0
  172. package/package.json +1 -1
  173. package/src/AnalyticsAdapter.js +5 -1
  174. package/src/adloader.js +2 -1
  175. package/test/mocks/analyticsStub.js +13 -0
  176. package/test/mocks/xhr.js +22 -0
  177. package/test/spec/AnalyticsAdapter_spec.js +4 -0
  178. package/test/spec/modules/akamaiDapRtdProvider_spec.js +402 -108
  179. package/test/spec/modules/conversantBidAdapter_spec.js +36 -5
  180. package/test/spec/modules/datablocksBidAdapter_spec.js +9 -8
  181. package/test/spec/modules/fintezaAnalyticsAdapter_spec.js +4 -4
  182. package/test/spec/modules/ftrackIdSystem_spec.js +1 -9
  183. package/test/spec/modules/koblerBidAdapter_spec.js +160 -124
  184. package/test/spec/modules/naveggIdSystem_spec.js +25 -1
  185. package/test/spec/modules/proxistoreBidAdapter_spec.js +0 -2
  186. package/test/spec/modules/sovrnBidAdapter_spec.js +253 -264
  187. package/test/spec/modules/taboolaBidAdapter_spec.js +455 -0
  188. package/test/test_deps.js +1 -0
@@ -72,6 +72,7 @@ describe('Conversant adapter tests', function() {
72
72
  video: {
73
73
  context: 'instream',
74
74
  playerSize: [632, 499],
75
+ pos: 3
75
76
  }
76
77
  },
77
78
  placementCode: 'pcode003',
@@ -108,12 +109,14 @@ describe('Conversant adapter tests', function() {
108
109
  {
109
110
  bidder: 'conversant',
110
111
  params: {
111
- site_id: siteId
112
+ site_id: siteId,
113
+ position: 2,
112
114
  },
113
115
  mediaTypes: {
114
116
  video: {
115
117
  context: 'instream',
116
- mimes: ['video/mp4', 'video/x-flv']
118
+ mimes: ['video/mp4', 'video/x-flv'],
119
+ pos: 7,
117
120
  }
118
121
  },
119
122
  placementCode: 'pcode005',
@@ -147,6 +150,23 @@ describe('Conversant adapter tests', function() {
147
150
  bidId: 'bid006',
148
151
  bidderRequestId: '117d765b87bed38',
149
152
  auctionId: 'req000'
153
+ },
154
+ {
155
+ bidder: 'conversant',
156
+ params: {
157
+ site_id: siteId
158
+ },
159
+ mediaTypes: {
160
+ banner: {
161
+ sizes: [[728, 90], [468, 60]],
162
+ pos: 5
163
+ }
164
+ },
165
+ placementCode: 'pcode001',
166
+ transactionId: 'tx001',
167
+ bidId: 'bid007',
168
+ bidderRequestId: '117d765b87bed38',
169
+ auctionId: 'req000'
150
170
  }
151
171
  ];
152
172
 
@@ -245,7 +265,7 @@ describe('Conversant adapter tests', function() {
245
265
  expect(payload).to.have.property('id', 'req000');
246
266
  expect(payload).to.have.property('at', 1);
247
267
  expect(payload).to.have.property('imp');
248
- expect(payload.imp).to.be.an('array').with.lengthOf(7);
268
+ expect(payload.imp).to.be.an('array').with.lengthOf(8);
249
269
 
250
270
  expect(payload.imp[0]).to.have.property('id', 'bid000');
251
271
  expect(payload.imp[0]).to.have.property('secure', 1);
@@ -287,7 +307,7 @@ describe('Conversant adapter tests', function() {
287
307
  expect(payload.imp[3]).to.have.property('displaymanagerver').that.matches(versionPattern);
288
308
  expect(payload.imp[3]).to.not.have.property('tagid');
289
309
  expect(payload.imp[3]).to.have.property('video');
290
- expect(payload.imp[3].video).to.not.have.property('pos');
310
+ expect(payload.imp[3].video).to.have.property('pos', 3);
291
311
  expect(payload.imp[3].video).to.have.property('w', 632);
292
312
  expect(payload.imp[3].video).to.have.property('h', 499);
293
313
  expect(payload.imp[3].video).to.have.property('mimes');
@@ -325,7 +345,7 @@ describe('Conversant adapter tests', function() {
325
345
  expect(payload.imp[5]).to.have.property('displaymanagerver').that.matches(versionPattern);
326
346
  expect(payload.imp[5]).to.not.have.property('tagid');
327
347
  expect(payload.imp[5]).to.have.property('video');
328
- expect(payload.imp[5].video).to.not.have.property('pos');
348
+ expect(payload.imp[5].video).to.have.property('pos', 2);
329
349
  expect(payload.imp[5].video).to.not.have.property('w');
330
350
  expect(payload.imp[5].video).to.not.have.property('h');
331
351
  expect(payload.imp[5].video).to.have.property('mimes');
@@ -345,6 +365,17 @@ describe('Conversant adapter tests', function() {
345
365
  expect(payload.imp[6].ext).to.have.property('data');
346
366
  expect(payload.imp[6].ext.data).to.have.property('pbadslot');
347
367
 
368
+ expect(payload.imp[7]).to.have.property('id', 'bid007');
369
+ expect(payload.imp[7]).to.have.property('secure', 1);
370
+ expect(payload.imp[7]).to.have.property('bidfloor', 0);
371
+ expect(payload.imp[7]).to.have.property('displaymanager', 'Prebid.js');
372
+ expect(payload.imp[7]).to.have.property('displaymanagerver').that.matches(versionPattern);
373
+ expect(payload.imp[7]).to.not.have.property('tagid');
374
+ expect(payload.imp[7]).to.have.property('banner');
375
+ expect(payload.imp[7].banner).to.have.property('pos', 5);
376
+ expect(payload.imp[7].banner).to.have.property('format');
377
+ expect(payload.imp[7].banner.format).to.deep.equal([{w: 728, h: 90}, {w: 468, h: 60}]);
378
+
348
379
  expect(payload).to.have.property('site');
349
380
  expect(payload.site).to.have.property('id', siteId);
350
381
  expect(payload.site).to.have.property('mobile').that.is.oneOf([0, 1]);
@@ -305,6 +305,15 @@ let bid_request = {
305
305
  }
306
306
 
307
307
  describe('DatablocksAdapter', function() {
308
+ before(() => {
309
+ // stub out queue metric to avoid it polluting the global xhr mock during other tests
310
+ sinon.stub(spec, 'queue_metric').callsFake(() => null);
311
+ });
312
+
313
+ after(() => {
314
+ spec.queue_metric.restore();
315
+ });
316
+
308
317
  describe('All needed functions are available', function() {
309
318
  it(`isBidRequestValid is present and type function`, function () {
310
319
  expect(spec.isBidRequestValid).to.exist.and.to.be.a('function')
@@ -377,14 +386,6 @@ describe('DatablocksAdapter', function() {
377
386
  });
378
387
  })
379
388
 
380
- describe('queue / send metrics', function() {
381
- it('Should return true', function() {
382
- expect(spec.queue_metric({type: 'test'})).to.be.true;
383
- expect(spec.queue_metric('string')).to.be.false;
384
- expect(spec.send_metrics()).to.be.true;
385
- });
386
- })
387
-
388
389
  describe('get_viewability', function() {
389
390
  it('Should return undefined', function() {
390
391
  expect(spec.get_viewability()).to.equal(undefined);
@@ -51,7 +51,7 @@ describe('finteza analytics adapter', function () {
51
51
 
52
52
  describe('track', () => {
53
53
  describe('bid request', () => {
54
- it('builds and sends data', function () {
54
+ it('builds and sends request data', function () {
55
55
  const bidderCode = 'Bidder789';
56
56
  const pauctionId = '5018eb39-f900-4370-b71e-3bb5b48d324f';
57
57
 
@@ -95,7 +95,7 @@ describe('finteza analytics adapter', function () {
95
95
  });
96
96
 
97
97
  describe('bid response', () => {
98
- it('builds and sends data', function () {
98
+ it('builds and sends response data', function () {
99
99
  const bidderCode = 'Bidder789';
100
100
  const pauctionId = '5018eb39-f900-4370-b71e-3bb5b48d324f';
101
101
 
@@ -154,7 +154,7 @@ describe('finteza analytics adapter', function () {
154
154
  });
155
155
 
156
156
  describe('bid won', () => {
157
- it('builds and sends data', function () {
157
+ it('builds and sends bid won data', function () {
158
158
  const bidderCode = 'Bidder789';
159
159
  const pauctionId = '5018eb39-f900-4370-b71e-3bb5b48d324f';
160
160
 
@@ -194,7 +194,7 @@ describe('finteza analytics adapter', function () {
194
194
  });
195
195
 
196
196
  describe('bid timeout', () => {
197
- it('builds and sends data', function () {
197
+ it('builds and sends timeout data', function () {
198
198
  const bidderCode = 'biDDer789';
199
199
  const pauctionId = '5018eb39-f900-4370-b71e-3bb5b48d324f';
200
200
 
@@ -95,15 +95,7 @@ describe('FTRACK ID System', () => {
95
95
  delete configMock1.params.url;
96
96
 
97
97
  ftrackIdSubmodule.isConfigOk(configMock1);
98
- expect(logWarnStub.args[0][0]).to.equal(`FTRACK - config.params.url is required for ftrack to run. Url should be "https://d9.flashtalking.com/d9core".`);
99
- });
100
-
101
- it(`should be rejected if 'storage.param.url' does not exist or is not 'https://d9.flashtalking.com/d9core'`, () => {
102
- let configMock1 = JSON.parse(JSON.stringify(configMock));
103
- configMock1.params.url = 'https://d9.NOT.flashtalking.com/d9core';
104
-
105
- ftrackIdSubmodule.isConfigOk(configMock1);
106
- expect(logWarnStub.args[0][0]).to.equal(`FTRACK - config.params.url is required for ftrack to run. Url should be "https://d9.flashtalking.com/d9core".`);
98
+ expect(logWarnStub.args[0][0]).to.equal(`FTRACK - config.params.url is required for ftrack to run.`);
107
99
  });
108
100
  });
109
101
 
@@ -16,7 +16,7 @@ function createBidderRequest(auctionId, timeout, pageUrl) {
16
16
  }
17
17
 
18
18
  function createValidBidRequest(params, bidId, sizes) {
19
- return {
19
+ const validBidRequest = {
20
20
  adUnitCode: 'adunit-code',
21
21
  bidId: bidId || '22c4871113f461',
22
22
  bidder: 'kobler',
@@ -28,11 +28,12 @@ function createValidBidRequest(params, bidId, sizes) {
28
28
  sizes: sizes || [[300, 250], [320, 100]]
29
29
  }
30
30
  },
31
- params: params || {
32
- placementId: 'tpw58278'
33
- },
34
31
  transactionTd: '04314114-15bd-4638-8664-bdb8bdc60bff'
35
32
  };
33
+ if (params) {
34
+ validBidRequest.params = params;
35
+ }
36
+ return validBidRequest;
36
37
  }
37
38
 
38
39
  describe('KoblerAdapter', function () {
@@ -56,7 +57,7 @@ describe('KoblerAdapter', function () {
56
57
  expect(result).to.be.false;
57
58
  });
58
59
 
59
- it('should not accept a request without params as valid', function () {
60
+ it('should not accept a request without mediaTypes and sizes as valid', function () {
60
61
  const bid = {
61
62
  bidId: 'e11768e8-3b71-4453-8698-0a2feb866589'
62
63
  };
@@ -66,11 +67,56 @@ describe('KoblerAdapter', function () {
66
67
  expect(result).to.be.false;
67
68
  });
68
69
 
69
- it('should not accept a request without placementId as valid', function () {
70
+ it('should not accept a request without mediaTypes and string sizes as valid', function () {
70
71
  const bid = {
71
72
  bidId: 'e11768e8-3b71-4453-8698-0a2feb866589',
72
- params: {
73
- someParam: 'abc'
73
+ sizes: 'string'
74
+ };
75
+
76
+ const result = spec.isBidRequestValid(bid);
77
+
78
+ expect(result).to.be.false;
79
+ });
80
+
81
+ it('should not accept a request without mediaTypes and empty sizes as valid', function () {
82
+ const bid = {
83
+ bidId: 'e11768e8-3b71-4453-8698-0a2feb866589',
84
+ sizes: []
85
+ };
86
+
87
+ const result = spec.isBidRequestValid(bid);
88
+
89
+ expect(result).to.be.false;
90
+ });
91
+
92
+ it('should not accept a request without mediaTypes.banner and sizes as valid', function () {
93
+ const bid = {
94
+ bidId: 'e11768e8-3b71-4453-8698-0a2feb866589',
95
+ mediaTypes: {}
96
+ };
97
+
98
+ const result = spec.isBidRequestValid(bid);
99
+
100
+ expect(result).to.be.false;
101
+ });
102
+
103
+ it('should not accept a request without mediaTypes.banner and empty sizes as valid', function () {
104
+ const bid = {
105
+ bidId: 'e11768e8-3b71-4453-8698-0a2feb866589',
106
+ sizes: [],
107
+ mediaTypes: {}
108
+ };
109
+
110
+ const result = spec.isBidRequestValid(bid);
111
+
112
+ expect(result).to.be.false;
113
+ });
114
+
115
+ it('should not accept a request without sizes and string mediaTypes.banner as valid', function () {
116
+ const bid = {
117
+ bidId: 'e11768e8-3b71-4453-8698-0a2feb866589',
118
+ mediaTypes: {
119
+ banner: 'string'
74
120
  }
75
121
  };
76
122
 
@@ -79,12 +125,67 @@ describe('KoblerAdapter', function () {
79
125
  expect(result).to.be.false;
80
126
  });
81
127
 
82
- it('should accept a request with bidId and placementId as valid', function () {
128
+ it('should not accept a request without sizes and mediaTypes.banner.sizes as valid', function () {
83
129
  const bid = {
84
130
  bidId: 'e11768e8-3b71-4453-8698-0a2feb866589',
85
- params: {
86
- someParam: 'abc',
87
- placementId: '8bde0923-1409-4253-9594-495b58d931ba'
131
+ mediaTypes: {
132
+ banner: {}
133
+ }
134
+ };
135
+
136
+ const result = spec.isBidRequestValid(bid);
137
+
138
+ expect(result).to.be.false;
139
+ });
140
+
141
+ it('should not accept a request without sizes and string mediaTypes.banner.sizes as valid', function () {
142
+ const bid = {
143
+ bidId: 'e11768e8-3b71-4453-8698-0a2feb866589',
144
+ mediaTypes: {
145
+ banner: {
146
+ sizes: 'string'
147
+ }
148
+ }
149
+ };
150
+
151
+ const result = spec.isBidRequestValid(bid);
152
+
153
+ expect(result).to.be.false;
154
+ });
155
+
156
+ it('should not accept a request without sizes and empty mediaTypes.banner.sizes as valid', function () {
157
+ const bid = {
158
+ bidId: 'e11768e8-3b71-4453-8698-0a2feb866589',
159
+ mediaTypes: {
160
+ banner: {
161
+ sizes: []
162
+ }
163
+ }
164
+ };
165
+
166
+ const result = spec.isBidRequestValid(bid);
167
+
168
+ expect(result).to.be.false;
169
+ });
170
+
171
+ it('should accept a request with bidId and sizes as valid', function () {
172
+ const bid = {
173
+ bidId: 'e11768e8-3b71-4453-8698-0a2feb866589',
174
+ sizes: [[5, 5]]
175
+ };
176
+
177
+ const result = spec.isBidRequestValid(bid);
178
+
179
+ expect(result).to.be.true;
180
+ });
181
+
182
+ it('should accept a request with bidId and mediaTypes.banner.sizes as valid', function () {
183
+ const bid = {
184
+ bidId: 'e11768e8-3b71-4453-8698-0a2feb866589',
185
+ mediaTypes: {
186
+ banner: {
187
+ sizes: [[0, 0]]
188
+ }
88
189
  }
89
190
  };
90
191
 
@@ -114,13 +215,10 @@ describe('KoblerAdapter', function () {
114
215
  const firstSize = [400, 800];
115
216
  const secondSize = [450, 950];
116
217
  const sizes = [firstSize, secondSize];
117
- const placementId = 'tsjs86325';
118
218
  const bidId = '3a56a019-4835-4f75-811c-76fac6853a2c';
119
219
  const validBidRequests = [
120
220
  createValidBidRequest(
121
- {
122
- placementId: placementId
123
- },
221
+ undefined,
124
222
  bidId,
125
223
  sizes
126
224
  )
@@ -132,7 +230,6 @@ describe('KoblerAdapter', function () {
132
230
 
133
231
  expect(openRtbRequest.imp.length).to.be.equal(1);
134
232
  expect(openRtbRequest.imp[0].id).to.be.equal(bidId);
135
- expect(openRtbRequest.imp[0].tagid).to.be.equal(placementId);
136
233
  expect(openRtbRequest.imp[0].banner.w).to.be.equal(firstSize[0]);
137
234
  expect(openRtbRequest.imp[0].banner.h).to.be.equal(firstSize[1]);
138
235
  expect(openRtbRequest.imp[0].banner.format.length).to.be.equal(2);
@@ -163,40 +260,31 @@ describe('KoblerAdapter', function () {
163
260
  expect(openRtbRequest.imp[0].banner.format[0].h).to.be.equal(0);
164
261
  });
165
262
 
166
- it('should use 0 as default position', function () {
167
- const validBidRequests = [createValidBidRequest()];
168
- const bidderRequest = createBidderRequest();
169
-
170
- const result = spec.buildRequests(validBidRequests, bidderRequest);
171
- const openRtbRequest = JSON.parse(result.data);
172
-
173
- expect(openRtbRequest.imp.length).to.be.equal(1);
174
- expect(openRtbRequest.imp[0].banner.ext.kobler.pos).to.be.equal(0);
175
- });
176
-
177
- it('should read zip from valid bid requests', function () {
178
- const zip = '700 02';
263
+ it('should read test from valid bid requests', function () {
179
264
  const validBidRequests = [
180
265
  createValidBidRequest(
181
266
  {
182
- placementId: 'nmah8324234',
183
- zip: zip
267
+ test: true
184
268
  }
185
269
  )
186
270
  ];
187
271
  const bidderRequest = createBidderRequest();
188
272
 
189
273
  const result = spec.buildRequests(validBidRequests, bidderRequest);
190
- const openRtbRequest = JSON.parse(result.data);
274
+ expect(result.url).to.be.equal('https://bid-service.dev.essrtb.com/bid/prebid_rtb_call');
191
275
 
192
- expect(openRtbRequest.device.geo.zip).to.be.equal(zip);
276
+ const openRtbRequest = JSON.parse(result.data);
277
+ expect(openRtbRequest.site.page).to.be.equal('example.com');
278
+ expect(openRtbRequest.test).to.be.equal(1);
193
279
  });
194
280
 
195
- it('should read test from valid bid requests', function () {
281
+ it('should read pageUrl from config when testing', function () {
282
+ config.setConfig({
283
+ pageUrl: 'https://testing-url.com'
284
+ });
196
285
  const validBidRequests = [
197
286
  createValidBidRequest(
198
287
  {
199
- placementId: 'zwop842799',
200
288
  test: true
201
289
  }
202
290
  )
@@ -204,49 +292,40 @@ describe('KoblerAdapter', function () {
204
292
  const bidderRequest = createBidderRequest();
205
293
 
206
294
  const result = spec.buildRequests(validBidRequests, bidderRequest);
207
- const openRtbRequest = JSON.parse(result.data);
295
+ expect(result.url).to.be.equal('https://bid-service.dev.essrtb.com/bid/prebid_rtb_call');
208
296
 
297
+ const openRtbRequest = JSON.parse(result.data);
298
+ expect(openRtbRequest.site.page).to.be.equal('https://testing-url.com');
209
299
  expect(openRtbRequest.test).to.be.equal(1);
210
300
  });
211
301
 
212
- it('should read floorPrice from valid bid requests', function () {
213
- const floorPrice = 4.343;
302
+ it('should not read pageUrl from config when not testing', function () {
303
+ config.setConfig({
304
+ pageUrl: 'https://testing-url.com'
305
+ });
214
306
  const validBidRequests = [
215
- createValidBidRequest(
216
- {
217
- placementId: 'oqr3224234',
218
- floorPrice: floorPrice
219
- }
220
- )
307
+ createValidBidRequest()
221
308
  ];
222
- const bidderRequest = createBidderRequest();
309
+ const bidderRequest = createBidderRequest(
310
+ 'f85d61cc-ed11-4b6c-aefb-87943263cedb',
311
+ 2000,
312
+ 'https://non-testing-url.net'
313
+ );
223
314
 
224
315
  const result = spec.buildRequests(validBidRequests, bidderRequest);
225
- const openRtbRequest = JSON.parse(result.data);
316
+ expect(result.url).to.be.equal('https://bid.essrtb.com/bid/prebid_rtb_call');
226
317
 
227
- expect(openRtbRequest.imp.length).to.be.equal(1);
228
- expect(openRtbRequest.imp[0].bidfloor).to.be.equal(floorPrice);
318
+ const openRtbRequest = JSON.parse(result.data);
319
+ expect(openRtbRequest.site.page).to.be.equal('https://non-testing-url.net');
320
+ expect(openRtbRequest.test).to.be.equal(0);
229
321
  });
230
322
 
231
- it('should read position from valid bid requests', function () {
232
- const placementId = 'yzksf234592';
323
+ it('should read floorPrice from valid bid requests', function () {
324
+ const floorPrice = 4.343;
233
325
  const validBidRequests = [
234
326
  createValidBidRequest(
235
327
  {
236
- placementId: placementId,
237
- position: 1
238
- }
239
- ),
240
- createValidBidRequest(
241
- {
242
- placementId: placementId,
243
- position: 2
244
- }
245
- ),
246
- createValidBidRequest(
247
- {
248
- placementId: placementId,
249
- position: 3
328
+ floorPrice: floorPrice
250
329
  }
251
330
  )
252
331
  ];
@@ -255,13 +334,8 @@ describe('KoblerAdapter', function () {
255
334
  const result = spec.buildRequests(validBidRequests, bidderRequest);
256
335
  const openRtbRequest = JSON.parse(result.data);
257
336
 
258
- expect(openRtbRequest.imp.length).to.be.equal(3);
259
- expect(openRtbRequest.imp[0].banner.ext.kobler.pos).to.be.equal(1);
260
- expect(openRtbRequest.imp[0].tagid).to.be.equal(placementId);
261
- expect(openRtbRequest.imp[1].banner.ext.kobler.pos).to.be.equal(2);
262
- expect(openRtbRequest.imp[1].tagid).to.be.equal(placementId);
263
- expect(openRtbRequest.imp[2].banner.ext.kobler.pos).to.be.equal(3);
264
- expect(openRtbRequest.imp[2].tagid).to.be.equal(placementId);
337
+ expect(openRtbRequest.imp.length).to.be.equal(1);
338
+ expect(openRtbRequest.imp[0].bidfloor).to.be.equal(floorPrice);
265
339
  });
266
340
 
267
341
  it('should read dealIds from valid bid requests', function () {
@@ -270,13 +344,11 @@ describe('KoblerAdapter', function () {
270
344
  const validBidRequests = [
271
345
  createValidBidRequest(
272
346
  {
273
- placementId: 'rsl1239823',
274
347
  dealIds: dealIds1
275
348
  }
276
349
  ),
277
350
  createValidBidRequest(
278
351
  {
279
- placementId: 'pqw234232',
280
352
  dealIds: dealIds2
281
353
  }
282
354
  )
@@ -353,10 +425,7 @@ describe('KoblerAdapter', function () {
353
425
  const validBidRequests = [
354
426
  createValidBidRequest(
355
427
  {
356
- placementId: 'pcha322364',
357
- zip: '0015',
358
428
  floorPrice: 5.6234,
359
- position: 1,
360
429
  dealIds: ['623472534328234']
361
430
  },
362
431
  '953ee65d-d18a-484f-a840-d3056185a060',
@@ -364,19 +433,14 @@ describe('KoblerAdapter', function () {
364
433
  ),
365
434
  createValidBidRequest(
366
435
  {
367
- placementId: 'sdfgoi32y4',
368
436
  floorPrice: 3.2543,
369
- position: 2,
370
437
  dealIds: ['92368234753283', '263845832942']
371
438
  },
372
439
  '8320bf79-9d90-4a17-87c6-5d505706a921',
373
440
  [[400, 500], [200, 250], [300, 350]]
374
441
  ),
375
442
  createValidBidRequest(
376
- {
377
- placementId: 'gwms2738647',
378
- position: 3
379
- },
443
+ undefined,
380
444
  'd0de713b-32e3-4191-a2df-a007f08ffe72',
381
445
  [[800, 900]]
382
446
  )
@@ -406,14 +470,8 @@ describe('KoblerAdapter', function () {
406
470
  }
407
471
  ],
408
472
  w: 400,
409
- h: 600,
410
- ext: {
411
- kobler: {
412
- pos: 1
413
- }
414
- }
473
+ h: 600
415
474
  },
416
- tagid: 'pcha322364',
417
475
  bidfloor: 5.6234,
418
476
  bidfloorcur: 'USD',
419
477
  pmp: {
@@ -442,14 +500,8 @@ describe('KoblerAdapter', function () {
442
500
  }
443
501
  ],
444
502
  w: 400,
445
- h: 500,
446
- ext: {
447
- kobler: {
448
- pos: 2
449
- }
450
- }
503
+ h: 500
451
504
  },
452
- tagid: 'sdfgoi32y4',
453
505
  bidfloor: 3.2543,
454
506
  bidfloorcur: 'USD',
455
507
  pmp: {
@@ -473,24 +525,15 @@ describe('KoblerAdapter', function () {
473
525
  }
474
526
  ],
475
527
  w: 800,
476
- h: 900,
477
- ext: {
478
- kobler: {
479
- pos: 3
480
- }
481
- }
528
+ h: 900
482
529
  },
483
- tagid: 'gwms2738647',
484
530
  bidfloor: 0,
485
531
  bidfloorcur: 'USD',
486
532
  pmp: {}
487
533
  }
488
534
  ],
489
535
  device: {
490
- devicetype: 2,
491
- geo: {
492
- zip: '0015'
493
- }
536
+ devicetype: 2
494
537
  },
495
538
  site: {
496
539
  page: 'bid.kobler.no'
@@ -531,7 +574,7 @@ describe('KoblerAdapter', function () {
531
574
  dealid: '',
532
575
  w: 320,
533
576
  h: 250,
534
- adm: '<script src="https://atag.essrtb.com/serve/prebid_ad_tag?payload=sdhfusdaobfadslf234324&sp=${AUCTION_PRICE}&cur=${AUCTION_PRICE_CURRENCY}"></script>',
577
+ adm: '<script src="https://atag.essrtb.com/serve/prebid_ad_tag?payload=sdhfusdaobfadslf234324"></script>',
535
578
  adomain: [
536
579
  'https://kobler.no'
537
580
  ]
@@ -544,7 +587,7 @@ describe('KoblerAdapter', function () {
544
587
  dealid: '2783483223432342',
545
588
  w: 580,
546
589
  h: 400,
547
- adm: '<script src="https://atag.essrtb.com/serve/prebid_ad_tag?payload=nbashgufvishdafjk23432&sp=${AUCTION_PRICE}&cur=${AUCTION_PRICE_CURRENCY}"></script>',
590
+ adm: '<script src="https://atag.essrtb.com/serve/prebid_ad_tag?payload=nbashgufvishdafjk23432"></script>',
548
591
  adomain: [
549
592
  'https://bid.kobler.no'
550
593
  ]
@@ -568,7 +611,7 @@ describe('KoblerAdapter', function () {
568
611
  dealId: '',
569
612
  netRevenue: true,
570
613
  ttl: 600,
571
- ad: '<script src="https://atag.essrtb.com/serve/prebid_ad_tag?payload=sdhfusdaobfadslf234324&sp=${AUCTION_PRICE}&cur=NOK"></script>',
614
+ ad: '<script src="https://atag.essrtb.com/serve/prebid_ad_tag?payload=sdhfusdaobfadslf234324"></script>',
572
615
  nurl: 'https://atag.essrtb.com/serve/prebid_win_notification?payload=sdhfusdaobfadslf234324&sp=${AUCTION_PRICE}&sp_cur=${AUCTION_PRICE_CURRENCY}&asp=${AD_SERVER_PRICE}&asp_cur=${AD_SERVER_PRICE_CURRENCY}',
573
616
  meta: {
574
617
  advertiserDomains: [
@@ -586,7 +629,7 @@ describe('KoblerAdapter', function () {
586
629
  dealId: '2783483223432342',
587
630
  netRevenue: true,
588
631
  ttl: 600,
589
- ad: '<script src="https://atag.essrtb.com/serve/prebid_ad_tag?payload=nbashgufvishdafjk23432&sp=${AUCTION_PRICE}&cur=NOK"></script>',
632
+ ad: '<script src="https://atag.essrtb.com/serve/prebid_ad_tag?payload=nbashgufvishdafjk23432"></script>',
590
633
  nurl: 'https://atag.essrtb.com/serve/prebid_win_notification?payload=nbashgufvishdafjk23432&sp=${AUCTION_PRICE}&sp_cur=${AUCTION_PRICE_CURRENCY}&asp=${AD_SERVER_PRICE}&asp_cur=${AD_SERVER_PRICE_CURRENCY}',
591
634
  meta: {
592
635
  advertiserDomains: [
@@ -628,6 +671,7 @@ describe('KoblerAdapter', function () {
628
671
  }
629
672
  });
630
673
  spec.onBidWon({
674
+ originalCpm: 1.532,
631
675
  cpm: 8.341,
632
676
  currency: 'NOK',
633
677
  nurl: 'https://atag.essrtb.com/serve/prebid_win_notification?payload=sdhfusdaobfadslf234324&sp=${AUCTION_PRICE}&sp_cur=${AUCTION_PRICE_CURRENCY}&asp=${AD_SERVER_PRICE}&asp_cur=${AD_SERVER_PRICE_CURRENCY}',
@@ -670,22 +714,14 @@ describe('KoblerAdapter', function () {
670
714
  auctionId: 'a1fba829-dd41-409f-acfb-b7b0ac5f30c6',
671
715
  bidId: 'ef236c6c-e934-406b-a877-d7be8e8a839a',
672
716
  timeout: 100,
673
- params: [
674
- {
675
- placementId: 'xrwg62731',
676
- }
677
- ],
717
+ params: [],
678
718
  },
679
719
  {
680
720
  adUnitCode: 'adunit-code-2',
681
721
  auctionId: 'a1fba829-dd41-409f-acfb-b7b0ac5f30c6',
682
722
  bidId: 'ca4121c8-9a4a-46ba-a624-e9b64af206f2',
683
723
  timeout: 100,
684
- params: [
685
- {
686
- placementId: 'bc482234',
687
- }
688
- ],
724
+ params: [],
689
725
  }
690
726
  ]);
691
727
 
@@ -693,12 +729,12 @@ describe('KoblerAdapter', function () {
693
729
  expect(utils.triggerPixel.getCall(0).args[0]).to.be.equal(
694
730
  'https://bid.essrtb.com/notify/prebid_timeout?ad_unit_code=adunit-code&' +
695
731
  'auction_id=a1fba829-dd41-409f-acfb-b7b0ac5f30c6&bid_id=ef236c6c-e934-406b-a877-d7be8e8a839a&timeout=100&' +
696
- 'placement_id=xrwg62731&page_url=' + encodeURIComponent(getRefererInfo().referer)
732
+ 'page_url=' + encodeURIComponent(getRefererInfo().referer)
697
733
  );
698
734
  expect(utils.triggerPixel.getCall(1).args[0]).to.be.equal(
699
735
  'https://bid.essrtb.com/notify/prebid_timeout?ad_unit_code=adunit-code-2&' +
700
736
  'auction_id=a1fba829-dd41-409f-acfb-b7b0ac5f30c6&bid_id=ca4121c8-9a4a-46ba-a624-e9b64af206f2&timeout=100&' +
701
- 'placement_id=bc482234&page_url=' + encodeURIComponent(getRefererInfo().referer)
737
+ 'page_url=' + encodeURIComponent(getRefererInfo().referer)
702
738
  );
703
739
  });
704
740
  });