prebid.js 7.11.0 → 7.12.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 (170) hide show
  1. package/.github/workflows/issue_tracker.yml +1 -1
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/adkernelBidAdapter.js +1 -1
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adriverBidAdapter.js +1 -1
  9. package/dist/adriverIdSystem.js +1 -1
  10. package/dist/adtelligentBidAdapter.js +1 -1
  11. package/dist/adtrgtmeBidAdapter.js +1 -1
  12. package/dist/adxcgBidAdapter.js +1 -1
  13. package/dist/ajaBidAdapter.js +1 -1
  14. package/dist/alkimiBidAdapter.js +1 -1
  15. package/dist/amxBidAdapter.js +1 -1
  16. package/dist/amxIdSystem.js +1 -1
  17. package/dist/appierAnalyticsAdapter.js +1 -1
  18. package/dist/appnexusBidAdapter.js +1 -1
  19. package/dist/asoBidAdapter.js +1 -1
  20. package/dist/axonixBidAdapter.js +1 -1
  21. package/dist/betweenBidAdapter.js +1 -1
  22. package/dist/bidglassBidAdapter.js +1 -1
  23. package/dist/bidwatchAnalyticsAdapter.js +1 -1
  24. package/dist/big-richmediaBidAdapter.js +1 -1
  25. package/dist/bridgewellBidAdapter.js +1 -1
  26. package/dist/brightMountainMediaBidAdapter.js +1 -1
  27. package/dist/concertBidAdapter.js +1 -1
  28. package/dist/connectadBidAdapter.js +1 -1
  29. package/dist/consumableBidAdapter.js +1 -1
  30. package/dist/conversantBidAdapter.js +1 -1
  31. package/dist/craftBidAdapter.js +1 -1
  32. package/dist/criteoBidAdapter.js +1 -1
  33. package/dist/dfpAdServerVideo.js +1 -1
  34. package/dist/dgkeywordRtdProvider.js +1 -1
  35. package/dist/displayioBidAdapter.js +1 -3
  36. package/dist/dspxBidAdapter.js +1 -1
  37. package/dist/eplanningBidAdapter.js +1 -1
  38. package/dist/finativeBidAdapter.js +1 -1
  39. package/dist/glimpseBidAdapter.js +1 -1
  40. package/dist/gmosspBidAdapter.js +1 -1
  41. package/dist/goldbachBidAdapter.js +1 -1
  42. package/dist/gridBidAdapter.js +1 -1
  43. package/dist/gridNMBidAdapter.js +1 -1
  44. package/dist/gumgumBidAdapter.js +1 -1
  45. package/dist/h12mediaBidAdapter.js +1 -1
  46. package/dist/id5IdSystem.js +1 -1
  47. package/dist/improvedigitalBidAdapter.js +1 -1
  48. package/dist/inmarBidAdapter.js +1 -1
  49. package/dist/insticatorBidAdapter.js +1 -1
  50. package/dist/ixBidAdapter.js +1 -1
  51. package/dist/justpremiumBidAdapter.js +1 -1
  52. package/dist/konduitAnalyticsAdapter.js +1 -1
  53. package/dist/kueezBidAdapter.js +1 -1
  54. package/dist/lassoBidAdapter.js +1 -1
  55. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  56. package/dist/logicadBidAdapter.js +1 -1
  57. package/dist/loglyliftBidAdapter.js +1 -1
  58. package/dist/malltvAnalyticsAdapter.js +1 -1
  59. package/dist/marsmediaBidAdapter.js +1 -1
  60. package/dist/mediafuseBidAdapter.js +1 -1
  61. package/dist/mediagoBidAdapter.js +1 -0
  62. package/dist/mediasquareBidAdapter.js +1 -1
  63. package/dist/mgidBidAdapter.js +1 -1
  64. package/dist/minutemediaBidAdapter.js +1 -1
  65. package/dist/nextMillenniumBidAdapter.js +1 -1
  66. package/dist/not-for-prod/prebid.js +120 -121
  67. package/dist/oguryBidAdapter.js +1 -1
  68. package/dist/onetagBidAdapter.js +1 -1
  69. package/dist/ooloAnalyticsAdapter.js +1 -1
  70. package/dist/outbrainBidAdapter.js +1 -1
  71. package/dist/parrableIdSystem.js +1 -1
  72. package/dist/pixfutureBidAdapter.js +1 -1
  73. package/dist/prebid-core.js +1 -1
  74. package/dist/publinkIdSystem.js +1 -1
  75. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  76. package/dist/pubmaticBidAdapter.js +1 -1
  77. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  78. package/dist/pxyzBidAdapter.js +1 -1
  79. package/dist/quantcastBidAdapter.js +1 -1
  80. package/dist/rasBidAdapter.js +1 -1
  81. package/dist/readpeakBidAdapter.js +1 -1
  82. package/dist/relaidoBidAdapter.js +1 -1
  83. package/dist/rhythmoneBidAdapter.js +1 -1
  84. package/dist/riseBidAdapter.js +1 -1
  85. package/dist/rubiconAnalyticsAdapter.js +1 -1
  86. package/dist/rubiconBidAdapter.js +1 -1
  87. package/dist/seedingAllianceBidAdapter.js +1 -1
  88. package/dist/seedtagBidAdapter.js +1 -1
  89. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  90. package/dist/sharethroughBidAdapter.js +1 -1
  91. package/dist/shinezBidAdapter.js +1 -1
  92. package/dist/smaatoBidAdapter.js +1 -1
  93. package/dist/smartadserverBidAdapter.js +1 -1
  94. package/dist/smartxBidAdapter.js +1 -1
  95. package/dist/smilewantedBidAdapter.js +1 -1
  96. package/dist/sonobiBidAdapter.js +1 -1
  97. package/dist/sovrnAnalyticsAdapter.js +1 -1
  98. package/dist/sovrnBidAdapter.js +1 -1
  99. package/dist/sspBCBidAdapter.js +1 -1
  100. package/dist/sublimeBidAdapter.js +1 -1
  101. package/dist/synacormediaBidAdapter.js +1 -1
  102. package/dist/tappxBidAdapter.js +1 -1
  103. package/dist/targetVideoBidAdapter.js +1 -1
  104. package/dist/teadsBidAdapter.js +1 -1
  105. package/dist/trionBidAdapter.js +1 -1
  106. package/dist/tripleliftBidAdapter.js +1 -1
  107. package/dist/ttdBidAdapter.js +1 -1
  108. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  109. package/dist/underdogmediaBidAdapter.js +1 -1
  110. package/dist/undertoneBidAdapter.js +1 -1
  111. package/dist/userId.js +1 -1
  112. package/dist/vidazooBidAdapter.js +1 -1
  113. package/dist/videobyteBidAdapter.js +1 -1
  114. package/dist/visxBidAdapter.js +1 -1
  115. package/dist/vuukleBidAdapter.js +1 -1
  116. package/dist/widespaceBidAdapter.js +1 -1
  117. package/dist/winrBidAdapter.js +1 -1
  118. package/dist/yahoosspBidAdapter.js +1 -1
  119. package/dist/yieldmoBidAdapter.js +1 -1
  120. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  121. package/modules/adkernelBidAdapter.js +28 -12
  122. package/modules/adriverBidAdapter.js +5 -12
  123. package/modules/adriverIdSystem.js +2 -1
  124. package/modules/adtelligentBidAdapter.js +2 -0
  125. package/modules/alkimiBidAdapter.js +2 -1
  126. package/modules/betweenBidAdapter.js +3 -3
  127. package/modules/bidwatchAnalyticsAdapter.js +112 -59
  128. package/modules/consumableBidAdapter.js +2 -2
  129. package/modules/criteoBidAdapter.js +19 -13
  130. package/modules/dgkeywordRtdProvider.js +9 -0
  131. package/modules/displayioBidAdapter.js +92 -97
  132. package/modules/id5IdSystem.js +160 -111
  133. package/modules/id5IdSystem.md +16 -14
  134. package/modules/improvedigitalBidAdapter.js +50 -28
  135. package/modules/ixBidAdapter.js +13 -306
  136. package/modules/mediagoBidAdapter.js +462 -0
  137. package/modules/mediagoBidAdapter.md +34 -0
  138. package/modules/nextMillenniumBidAdapter.js +25 -6
  139. package/modules/pubmaticAnalyticsAdapter.js +1 -1
  140. package/modules/rasBidAdapter.js +8 -0
  141. package/modules/rasBidAdapter.md +14 -13
  142. package/modules/sonobiBidAdapter.js +1 -0
  143. package/modules/tappxBidAdapter.js +9 -0
  144. package/package.json +1 -1
  145. package/src/adloader.js +2 -1
  146. package/src/adserver.js +0 -56
  147. package/src/auction.js +58 -15
  148. package/src/native.js +1 -0
  149. package/src/refererDetection.js +12 -1
  150. package/src/videoCache.js +8 -2
  151. package/test/spec/modules/adkernelBidAdapter_spec.js +11 -2
  152. package/test/spec/modules/adriverBidAdapter_spec.js +6 -13
  153. package/test/spec/modules/adriverIdSystem_spec.js +3 -8
  154. package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
  155. package/test/spec/modules/alkimiBidAdapter_spec.js +2 -1
  156. package/test/spec/modules/betweenBidAdapter_spec.js +17 -0
  157. package/test/spec/modules/bidwatchAnalyticsAdapter_spec.js +28 -12
  158. package/test/spec/modules/criteoBidAdapter_spec.js +35 -26
  159. package/test/spec/modules/dgkeywordRtdProvider_spec.js +1 -1
  160. package/test/spec/modules/displayioBidAdapter_spec.js +16 -52
  161. package/test/spec/modules/enrichmentFpdModule_spec.js +2 -1
  162. package/test/spec/modules/fpdModule_spec.js +2 -1
  163. package/test/spec/modules/id5IdSystem_spec.js +529 -172
  164. package/test/spec/modules/improvedigitalBidAdapter_spec.js +9 -13
  165. package/test/spec/modules/ixBidAdapter_spec.js +210 -104
  166. package/test/spec/modules/mediagoBidAdapter_spec.js +97 -0
  167. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +2 -7
  168. package/test/spec/modules/rasBidAdapter_spec.js +2 -0
  169. package/test/spec/native_spec.js +144 -0
  170. package/test/spec/videoCache_spec.js +37 -7
@@ -104,9 +104,9 @@ describe('nextMillenniumBidAdapterTests', function() {
104
104
  expect(JSON.parse(request[0].data).ext.nextMillennium.refresh_count).to.equal(3);
105
105
  });
106
106
 
107
- it('Check if ORTB was added', function() {
107
+ it('Check if domain was added', function() {
108
108
  const request = spec.buildRequests(bidRequestData)
109
- expect(JSON.parse(request[0].data).site.domain).to.equal('example.com')
109
+ expect(JSON.parse(request[0].data).site.domain).to.exist
110
110
  })
111
111
 
112
112
  it('Check if elOffsets was added', function() {
@@ -114,11 +114,6 @@ describe('nextMillenniumBidAdapterTests', function() {
114
114
  expect(JSON.parse(request[0].data).ext.nextMillennium.elOffsets).to.be.an('object')
115
115
  })
116
116
 
117
- it('Check if refferer was added', function() {
118
- const request = spec.buildRequests(bidRequestData)
119
- expect(JSON.parse(request[0].data).device.referrer).to.exist
120
- })
121
-
122
117
  it('Check if imp object was added', function() {
123
118
  const request = spec.buildRequests(bidRequestData)
124
119
  expect(JSON.parse(request[0].data).imp).to.be.an('array')
@@ -58,6 +58,7 @@ describe('rasBidAdapter', function () {
58
58
  slot: 'test',
59
59
  area: 'areatest',
60
60
  site: 'test',
61
+ slotSequence: '0',
61
62
  network: '4178463'
62
63
  }
63
64
  };
@@ -140,6 +141,7 @@ describe('rasBidAdapter', function () {
140
141
  expect(requests[0].url).to.have.string('DV=test%2Fareatest');
141
142
  expect(requests[0].url).to.have.string('kwrd=val1%2Bval2');
142
143
  expect(requests[0].url).to.have.string('kvadunit=test%2Fareatest');
144
+ expect(requests[0].url).to.have.string('pos0=0');
143
145
  });
144
146
  });
145
147
 
@@ -44,6 +44,106 @@ const bid = {
44
44
  },
45
45
  };
46
46
 
47
+ const ortbBid = {
48
+ adId: '123',
49
+ transactionId: 'au',
50
+ native: {
51
+ ortb: {
52
+ assets: [
53
+ {
54
+ id: 0,
55
+ title: {
56
+ text: 'Native Creative'
57
+ }
58
+ },
59
+ {
60
+ id: 1,
61
+ data: {
62
+ value: 'Cool description great stuff'
63
+ }
64
+ },
65
+ {
66
+ id: 2,
67
+ data: {
68
+ value: 'Do it'
69
+ }
70
+ },
71
+ {
72
+ id: 3,
73
+ img: {
74
+ url: 'http://cdn.example.com/p/creative-image/image.png',
75
+ h: 83,
76
+ w: 127
77
+ }
78
+ },
79
+ {
80
+ id: 4,
81
+ img: {
82
+ url: 'http://cdn.example.com/p/creative-image/icon.jpg',
83
+ h: 742,
84
+ w: 989
85
+ }
86
+ },
87
+ {
88
+ id: 5,
89
+ data: {
90
+ value: 'AppNexus',
91
+ type: 1
92
+ }
93
+ }
94
+ ],
95
+ link: {
96
+ url: 'https://www.link.example'
97
+ },
98
+ privacy: 'https://privacy-link.example',
99
+ ver: '1.2'
100
+ }
101
+ },
102
+ };
103
+
104
+ const ortbRequest = {
105
+ assets: [
106
+ {
107
+ id: 0,
108
+ required: 0,
109
+ title: {
110
+ len: 140
111
+ }
112
+ }, {
113
+ id: 1,
114
+ required: 0,
115
+ data: {
116
+ type: 2
117
+ }
118
+ }, {
119
+ id: 2,
120
+ required: 0,
121
+ data: {
122
+ type: 12
123
+ }
124
+ }, {
125
+ id: 3,
126
+ required: 0,
127
+ img: {
128
+ type: 3
129
+ }
130
+ }, {
131
+ id: 4,
132
+ required: 0,
133
+ img: {
134
+ type: 1
135
+ }
136
+ }, {
137
+ id: 5,
138
+ required: 0,
139
+ data: {
140
+ type: 1
141
+ }
142
+ }
143
+ ],
144
+ ver: '1.2'
145
+ }
146
+
47
147
  const bidWithUndefinedFields = {
48
148
  transactionId: 'au',
49
149
  native: {
@@ -401,6 +501,50 @@ describe('native.js', function () {
401
501
  });
402
502
  });
403
503
 
504
+ it('creates native all asset message with OpenRTB format', function () {
505
+ const messageRequest = {
506
+ message: 'Prebid Native',
507
+ action: 'allAssetRequest',
508
+ adId: '123',
509
+ };
510
+
511
+ const message = getAllAssetsMessage(messageRequest, ortbBid, {getNativeReq: () => ortbRequest});
512
+
513
+ expect(message.assets.length).to.equal(8);
514
+ expect(message.assets).to.deep.include({
515
+ key: 'body',
516
+ value: bid.native.body,
517
+ });
518
+ expect(message.assets).to.deep.include({
519
+ key: 'image',
520
+ value: bid.native.image.url,
521
+ });
522
+ expect(message.assets).to.deep.include({
523
+ key: 'clickUrl',
524
+ value: bid.native.clickUrl,
525
+ });
526
+ expect(message.assets).to.deep.include({
527
+ key: 'title',
528
+ value: bid.native.title,
529
+ });
530
+ expect(message.assets).to.deep.include({
531
+ key: 'icon',
532
+ value: bid.native.icon.url,
533
+ });
534
+ expect(message.assets).to.deep.include({
535
+ key: 'cta',
536
+ value: bid.native.cta,
537
+ });
538
+ expect(message.assets).to.deep.include({
539
+ key: 'sponsoredBy',
540
+ value: bid.native.sponsoredBy,
541
+ });
542
+ expect(message.assets).to.deep.include({
543
+ key: 'privacyLink',
544
+ value: ortbBid.native.ortb.privacy,
545
+ });
546
+ });
547
+
404
548
  const SAMPLE_ORTB_REQUEST = toOrtbNativeRequest({
405
549
  title: 'vtitle',
406
550
  body: 'vbody'
@@ -4,6 +4,7 @@ import { config } from 'src/config.js';
4
4
  import { server } from 'test/mocks/xhr.js';
5
5
  import {auctionManager} from '../../src/auctionManager.js';
6
6
  import {AuctionIndex} from '../../src/auctionIndex.js';
7
+ import { batchingCache } from '../../src/auction.js';
7
8
 
8
9
  const should = chai.should();
9
10
 
@@ -155,12 +156,12 @@ describe('The video cache', function () {
155
156
  puts: [{
156
157
  type: 'xml',
157
158
  value: vastXml1,
158
- ttlseconds: 25,
159
+ ttlseconds: 40,
159
160
  key: customKey1
160
161
  }, {
161
162
  type: 'xml',
162
163
  value: vastXml2,
163
- ttlseconds: 25,
164
+ ttlseconds: 40,
164
165
  key: customKey2
165
166
  }]
166
167
  };
@@ -205,7 +206,7 @@ describe('The video cache', function () {
205
206
  puts: [{
206
207
  type: 'xml',
207
208
  value: vastXml1,
208
- ttlseconds: 25,
209
+ ttlseconds: 40,
209
210
  key: customKey1,
210
211
  bidid: '12345abc',
211
212
  aid: '1234-56789-abcde',
@@ -213,7 +214,7 @@ describe('The video cache', function () {
213
214
  }, {
214
215
  type: 'xml',
215
216
  value: vastXml2,
216
- ttlseconds: 25,
217
+ ttlseconds: 40,
217
218
  key: customKey2,
218
219
  bidid: 'cba54321',
219
220
  aid: '1234-56789-abcde',
@@ -276,7 +277,7 @@ describe('The video cache', function () {
276
277
  puts: [{
277
278
  type: 'xml',
278
279
  value: vastXml1,
279
- ttlseconds: 25,
280
+ ttlseconds: 40,
280
281
  key: customKey1,
281
282
  bidid: '12345abc',
282
283
  bidder: 'appnexus',
@@ -285,7 +286,7 @@ describe('The video cache', function () {
285
286
  }, {
286
287
  type: 'xml',
287
288
  value: vastXml2,
288
- ttlseconds: 25,
289
+ ttlseconds: 40,
289
290
  key: customKey2,
290
291
  bidid: 'cba54321',
291
292
  bidder: 'rubicon',
@@ -297,6 +298,35 @@ describe('The video cache', function () {
297
298
  JSON.parse(request.requestBody).should.deep.equal(payload);
298
299
  });
299
300
 
301
+ it('should wait the duration of the batchTimeout and pass the correct batchSize if batched requests are enabled in the config', () => {
302
+ const mockAfterBidAdded = function() {};
303
+ let callback = null;
304
+ let mockTimeout = sinon.stub().callsFake((cb) => { callback = cb });
305
+
306
+ config.setConfig({
307
+ cache: {
308
+ url: 'https://prebid.adnxs.com/pbc/v1/cache',
309
+ batchSize: 3,
310
+ batchTimeout: 20
311
+ }
312
+ });
313
+
314
+ let stubCache = sinon.stub();
315
+ const batchAndStore = batchingCache(mockTimeout, stubCache);
316
+ for (let i = 0; i < 3; i++) {
317
+ batchAndStore({}, {}, mockAfterBidAdded);
318
+ }
319
+
320
+ sinon.assert.calledOnce(mockTimeout);
321
+ sinon.assert.calledWith(mockTimeout, sinon.match.any, 20);
322
+
323
+ const expectedBatch = [{ afterBidAdded: mockAfterBidAdded, auctionInstance: { }, bidResponse: { } }, { afterBidAdded: mockAfterBidAdded, auctionInstance: { }, bidResponse: { } }, { afterBidAdded: mockAfterBidAdded, auctionInstance: { }, bidResponse: { } }];
324
+
325
+ callback();
326
+
327
+ sinon.assert.calledWith(stubCache, expectedBatch);
328
+ });
329
+
300
330
  function assertRequestMade(bid, expectedValue) {
301
331
  store([bid], function () { });
302
332
 
@@ -309,7 +339,7 @@ describe('The video cache', function () {
309
339
  puts: [{
310
340
  type: 'xml',
311
341
  value: expectedValue,
312
- ttlseconds: 25
342
+ ttlseconds: 40
313
343
  }],
314
344
  });
315
345
  }