prebid.js 7.16.0 → 7.18.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 (160) hide show
  1. package/.circleci/config.yml +0 -18
  2. package/dist/1plusXRtdProvider.js +1 -1
  3. package/dist/33acrossBidAdapter.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/adqueryBidAdapter.js +1 -1
  8. package/dist/adrelevantisBidAdapter.js +1 -1
  9. package/dist/adtrgtmeBidAdapter.js +1 -1
  10. package/dist/adxcgBidAdapter.js +1 -1
  11. package/dist/adyoulikeBidAdapter.js +1 -1
  12. package/dist/ajaBidAdapter.js +1 -1
  13. package/dist/amxBidAdapter.js +1 -1
  14. package/dist/amxIdSystem.js +1 -1
  15. package/dist/appierAnalyticsAdapter.js +1 -1
  16. package/dist/appnexusBidAdapter.js +1 -1
  17. package/dist/asoBidAdapter.js +1 -1
  18. package/dist/audiencerunBidAdapter.js +1 -1
  19. package/dist/axonixBidAdapter.js +1 -1
  20. package/dist/bidglassBidAdapter.js +1 -1
  21. package/dist/bidwatchAnalyticsAdapter.js +1 -1
  22. package/dist/big-richmediaBidAdapter.js +1 -1
  23. package/dist/bluebillywigBidAdapter.js +1 -1
  24. package/dist/bridgewellBidAdapter.js +1 -1
  25. package/dist/brightMountainMediaBidAdapter.js +1 -1
  26. package/dist/carodaBidAdapter.js +1 -0
  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/dspxBidAdapter.js +1 -1
  34. package/dist/eplanningBidAdapter.js +1 -1
  35. package/dist/finativeBidAdapter.js +1 -1
  36. package/dist/glimpseBidAdapter.js +1 -1
  37. package/dist/gmosspBidAdapter.js +1 -1
  38. package/dist/goldbachBidAdapter.js +1 -1
  39. package/dist/gridBidAdapter.js +1 -1
  40. package/dist/gridNMBidAdapter.js +1 -1
  41. package/dist/growthCodeIdSystem.js +1 -0
  42. package/dist/gumgumBidAdapter.js +1 -1
  43. package/dist/h12mediaBidAdapter.js +1 -1
  44. package/dist/id5IdSystem.js +1 -1
  45. package/dist/impactifyBidAdapter.js +1 -1
  46. package/dist/improvedigitalBidAdapter.js +1 -1
  47. package/dist/inmarBidAdapter.js +1 -1
  48. package/dist/insticatorBidAdapter.js +1 -1
  49. package/dist/ixBidAdapter.js +1 -1
  50. package/dist/jixieBidAdapter.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/lifestreetBidAdapter.js +1 -1
  56. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  57. package/dist/logicadBidAdapter.js +1 -1
  58. package/dist/loglyliftBidAdapter.js +1 -1
  59. package/dist/malltvAnalyticsAdapter.js +1 -1
  60. package/dist/marsmediaBidAdapter.js +1 -1
  61. package/dist/mediafuseBidAdapter.js +1 -1
  62. package/dist/mediagoBidAdapter.js +1 -1
  63. package/dist/mediakeysBidAdapter.js +1 -1
  64. package/dist/mediasquareBidAdapter.js +1 -1
  65. package/dist/mgidBidAdapter.js +1 -1
  66. package/dist/minutemediaBidAdapter.js +1 -1
  67. package/dist/nativoBidAdapter.js +1 -1
  68. package/dist/nextMillenniumBidAdapter.js +1 -1
  69. package/dist/not-for-prod/prebid.js +121 -119
  70. package/dist/oguryBidAdapter.js +1 -1
  71. package/dist/onetagBidAdapter.js +1 -1
  72. package/dist/ooloAnalyticsAdapter.js +1 -1
  73. package/dist/outbrainBidAdapter.js +1 -1
  74. package/dist/parrableIdSystem.js +1 -1
  75. package/dist/pixfutureBidAdapter.js +1 -1
  76. package/dist/prebid-core.js +1 -1
  77. package/dist/publinkIdSystem.js +1 -1
  78. package/dist/pubmaticBidAdapter.js +1 -1
  79. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  80. package/dist/pxyzBidAdapter.js +1 -1
  81. package/dist/quantcastBidAdapter.js +1 -1
  82. package/dist/readpeakBidAdapter.js +1 -1
  83. package/dist/relaidoBidAdapter.js +1 -1
  84. package/dist/rhythmoneBidAdapter.js +1 -1
  85. package/dist/riseBidAdapter.js +1 -1
  86. package/dist/rubiconAnalyticsAdapter.js +1 -1
  87. package/dist/rubiconBidAdapter.js +1 -1
  88. package/dist/seedingAllianceBidAdapter.js +1 -1
  89. package/dist/seedtagBidAdapter.js +1 -1
  90. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  91. package/dist/sharethroughBidAdapter.js +1 -1
  92. package/dist/shinezBidAdapter.js +1 -1
  93. package/dist/smaatoBidAdapter.js +1 -1
  94. package/dist/smartadserverBidAdapter.js +1 -1
  95. package/dist/smartxBidAdapter.js +1 -1
  96. package/dist/smilewantedBidAdapter.js +1 -1
  97. package/dist/sonobiBidAdapter.js +1 -1
  98. package/dist/sovrnAnalyticsAdapter.js +1 -1
  99. package/dist/sovrnBidAdapter.js +1 -1
  100. package/dist/sspBCBidAdapter.js +1 -1
  101. package/dist/sublimeBidAdapter.js +1 -1
  102. package/dist/synacormediaBidAdapter.js +1 -1
  103. package/dist/taboolaBidAdapter.js +1 -1
  104. package/dist/targetVideoBidAdapter.js +1 -1
  105. package/dist/teadsBidAdapter.js +1 -1
  106. package/dist/trionBidAdapter.js +1 -1
  107. package/dist/tripleliftBidAdapter.js +1 -1
  108. package/dist/ttdBidAdapter.js +1 -1
  109. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  110. package/dist/underdogmediaBidAdapter.js +1 -1
  111. package/dist/undertoneBidAdapter.js +1 -1
  112. package/dist/userId.js +1 -1
  113. package/dist/vidazooBidAdapter.js +1 -1
  114. package/dist/videobyteBidAdapter.js +1 -1
  115. package/dist/visxBidAdapter.js +1 -1
  116. package/dist/vuukleBidAdapter.js +1 -1
  117. package/dist/widespaceBidAdapter.js +1 -1
  118. package/dist/winrBidAdapter.js +1 -1
  119. package/dist/yahoosspBidAdapter.js +1 -1
  120. package/dist/yieldmoBidAdapter.js +1 -1
  121. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  122. package/karma.conf.maker.js +2 -4
  123. package/modules/1plusXRtdProvider.js +27 -7
  124. package/modules/adagioBidAdapter.js +18 -3
  125. package/modules/adagioBidAdapter.md +11 -1
  126. package/modules/adqueryBidAdapter.js +4 -2
  127. package/modules/appnexusBidAdapter.js +24 -22
  128. package/modules/bidwatchAnalyticsAdapter.js +1 -1
  129. package/modules/carodaBidAdapter.js +217 -0
  130. package/modules/carodaBidAdapter.md +43 -0
  131. package/modules/gridBidAdapter.js +1 -1
  132. package/modules/growthCodeIdSystem.js +164 -0
  133. package/modules/growthCodeIdSystem.md +37 -0
  134. package/modules/improvedigitalBidAdapter.js +3 -1
  135. package/modules/ixBidAdapter.js +17 -12
  136. package/modules/mediagoBidAdapter.js +15 -11
  137. package/modules/mediasquareBidAdapter.js +1 -1
  138. package/modules/nativoBidAdapter.js +2 -1
  139. package/modules/nextMillenniumBidAdapter.js +34 -11
  140. package/modules/rubiconAnalyticsAdapter.js +2 -2
  141. package/modules/rubiconBidAdapter.js +16 -6
  142. package/modules/seedtagBidAdapter.js +4 -0
  143. package/modules/taboolaBidAdapter.js +3 -7
  144. package/modules/userId/eids.js +19 -0
  145. package/modules/vidazooBidAdapter.js +1 -1
  146. package/package.json +1 -1
  147. package/test/spec/modules/1plusXRtdProvider_spec.js +77 -1
  148. package/test/spec/modules/adagioBidAdapter_spec.js +46 -2
  149. package/test/spec/modules/adqueryBidAdapter_spec.js +11 -0
  150. package/test/spec/modules/appnexusBidAdapter_spec.js +76 -0
  151. package/test/spec/modules/bidwatchAnalyticsAdapter_spec.js +2 -0
  152. package/test/spec/modules/carodaBidAdapter_spec.js +494 -0
  153. package/test/spec/modules/growthCodeIdSystem_spec.js +83 -0
  154. package/test/spec/modules/improvedigitalBidAdapter_spec.js +10 -0
  155. package/test/spec/modules/ixBidAdapter_spec.js +32 -16
  156. package/test/spec/modules/mediasquareBidAdapter_spec.js +2 -0
  157. package/test/spec/modules/prebidServerBidAdapter_spec.js +12 -0
  158. package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +7 -7
  159. package/test/spec/modules/rubiconBidAdapter_spec.js +28 -35
  160. package/test/spec/modules/seedtagBidAdapter_spec.js +45 -0
@@ -5,7 +5,9 @@ import {
5
5
  extractConfig,
6
6
  buildOrtb2Updates,
7
7
  updateBidderConfig,
8
- setTargetingDataToConfig
8
+ setTargetingDataToConfig,
9
+ extractConsent,
10
+ getPapiUrl
9
11
  } from 'modules/1plusXRtdProvider';
10
12
 
11
13
  describe('1plusXRtdProvider', () => {
@@ -251,6 +253,80 @@ describe('1plusXRtdProvider', () => {
251
253
  })
252
254
  })
253
255
 
256
+ describe('extractConsent', () => {
257
+ it('extracts consent strings correctly if given', () => {
258
+ const consent = {
259
+ gdpr: {
260
+ gdprApplies: 1,
261
+ consentString: 'myConsent'
262
+ }
263
+ }
264
+ const output = extractConsent(consent)
265
+ const expectedOutput = {
266
+ gdpr_applies: 1,
267
+ consent_string: 'myConsent'
268
+ }
269
+ expect(expectedOutput).to.deep.include(output)
270
+ expect(output).to.deep.include(expectedOutput)
271
+ })
272
+ it('extracts null if consent object is empty', () => {
273
+ const consent1 = {}
274
+ expect(extractConsent(consent1)).to.equal(null)
275
+ })
276
+
277
+ it('throws an error if the consent is malformed', () => {
278
+ const consent1 = {
279
+ gdpr: {
280
+ gdprApplies: 1
281
+ }
282
+ }
283
+ const consent2 = {
284
+ gdpr: {
285
+ consentString: 'myConsent'
286
+ }
287
+ }
288
+ const consent3 = {
289
+ gdpr: {
290
+ gdprApplies: 1,
291
+ consentString: 3
292
+ }
293
+ }
294
+ const consent4 = {
295
+ gdpr: {
296
+ gdprApplies: 'yes',
297
+ consentString: 'myConsent'
298
+ }
299
+ }
300
+ const consent5 = {
301
+ gdprApplies: 1,
302
+ consentString: 'myConsent'
303
+ }
304
+
305
+ for (const consent in [consent1, consent2, consent3, consent4, consent5]) {
306
+ try {
307
+ extractConsent(consent)
308
+ assert(false, 'Should be throwing an exception')
309
+ } catch (e) { }
310
+ }
311
+ })
312
+ })
313
+
314
+ describe('getPapiUrl', () => {
315
+ const customer = 'acme'
316
+ const consent = {
317
+ gdpr: {
318
+ gdprApplies: 1,
319
+ consentString: 'myConsent'
320
+ }
321
+ }
322
+
323
+ it('correctly builds URLs based on consent', () => {
324
+ const url1 = getPapiUrl(customer)
325
+ const url2 = getPapiUrl(customer, extractConsent(consent))
326
+ expect(['&consent_string=myConsent&gdpr_applies=1', '&gdpr_applies=1&consent_string=myConsent']).to.contain(url2.replace(url1, ''))
327
+ })
328
+ })
329
+
254
330
  describe('updateBidderConfig', () => {
255
331
  const ortb2UpdatesAppNexus = {
256
332
  site: {
@@ -150,7 +150,9 @@ describe('Adagio bid adapter', () => {
150
150
  ext: {
151
151
  data: {
152
152
  environment: 'desktop',
153
- pagetype: 'abc'
153
+ pagetype: 'abc',
154
+ category: ['cat1', 'cat2', 'cat3'],
155
+ subcategory: []
154
156
  }
155
157
  }
156
158
  }
@@ -170,6 +172,12 @@ describe('Adagio bid adapter', () => {
170
172
 
171
173
  setExtraParam(bid, 'pagetype')
172
174
  expect(bid.params.pagetype).to.equal('article');
175
+
176
+ setExtraParam(bid, 'category');
177
+ expect(bid.params.category).to.equal('cat1'); // Only the first value is kept
178
+
179
+ setExtraParam(bid, 'subcategory');
180
+ expect(bid.params.subcategory).to.be.undefined;
173
181
  });
174
182
 
175
183
  it('should use the adUnit param unit if defined', function() {
@@ -1081,7 +1089,7 @@ describe('Adagio bid adapter', () => {
1081
1089
  impressionTrackers: [
1082
1090
  'https://eventrack.local/impression'
1083
1091
  ],
1084
- javascriptTrackers: '<script src=\"https://eventrack.local/impression\"></script>',
1092
+ javascriptTrackers: '<script async src=\"https://eventrack.local/impression\"></script>',
1085
1093
  clickTrackers: [
1086
1094
  'https://i.am.a.clicktracker.url'
1087
1095
  ],
@@ -1104,6 +1112,19 @@ describe('Adagio bid adapter', () => {
1104
1112
  expect(r[0].native).ok;
1105
1113
  expect(r[0].native).to.deep.equal(expected);
1106
1114
  });
1115
+
1116
+ it('Should handle multiple javascriptTrackers in one single string', () => {
1117
+ const serverResponseWithNativeCopy = utils.deepClone(serverResponseWithNative);
1118
+ serverResponseWithNativeCopy.body.bids[0].admNative.eventtrackers.push(
1119
+ {
1120
+ event: 1,
1121
+ method: 2,
1122
+ url: 'https://eventrack.local/impression-2'
1123
+ },)
1124
+ const r = spec.interpretResponse(serverResponseWithNativeCopy, bidRequestNative);
1125
+ const expected = '<script async src=\"https://eventrack.local/impression\"></script>\n<script async src=\"https://eventrack.local/impression-2\"></script>';
1126
+ expect(r[0].native.javascriptTrackers).to.equal(expected);
1127
+ });
1107
1128
  });
1108
1129
  });
1109
1130
 
@@ -1244,6 +1265,29 @@ describe('Adagio bid adapter', () => {
1244
1265
  expect(result.dom_loading).to.be.a('String');
1245
1266
  expect(result.user_timestamp).to.be.a('String');
1246
1267
  });
1268
+
1269
+ it('should return `adunit_position` feature when the slot is hidden', function () {
1270
+ const elem = fixtures.getElementById();
1271
+ sandbox.stub(window.top.document, 'getElementById').returns(elem);
1272
+ sandbox.stub(window.top, 'getComputedStyle').returns({ display: 'none' });
1273
+ sandbox.stub(utils, 'inIframe').returns(false);
1274
+
1275
+ const bidRequest = new BidRequestBuilder({
1276
+ mediaTypes: {
1277
+ banner: { sizes: [[300, 250]] },
1278
+ },
1279
+ })
1280
+ .withParams()
1281
+ .build();
1282
+
1283
+ const bidderRequest = new BidderRequestBuilder().build();
1284
+
1285
+ const requests = spec.buildRequests([bidRequest], bidderRequest);
1286
+ const result = requests[0].data.adUnits[0].features;
1287
+
1288
+ expect(result.adunit_position).to.match(/^[\d]+x[\d]+$/);
1289
+ expect(elem.style.display).to.equal(null); // set null to reset style
1290
+ });
1247
1291
  });
1248
1292
 
1249
1293
  describe('Adagio features when prebid in Safeframe', function() {
@@ -70,6 +70,13 @@ describe('adqueryBidAdapter', function () {
70
70
  it('should return false if any parameter missing', function () {
71
71
  expect(spec.isBidRequestValid(inValidBid)).to.be.false
72
72
  })
73
+
74
+ it('should return false when sizes for banner are not specified', () => {
75
+ const bid = utils.deepClone(bidRequest);
76
+ delete bid.mediaTypes.banner.sizes;
77
+
78
+ expect(spec.isBidRequestValid(bid)).to.equal(false);
79
+ });
73
80
  })
74
81
 
75
82
  describe('buildRequests', function () {
@@ -108,6 +115,10 @@ describe('adqueryBidAdapter', function () {
108
115
  it('should include bidder', function () {
109
116
  expect(rdata.bidder !== null).to.be.true
110
117
  })
118
+
119
+ it('should include sizes', function () {
120
+ expect(rdata.sizes).not.be.null
121
+ })
111
122
  })
112
123
 
113
124
  describe('interpretResponse', function () {
@@ -757,6 +757,82 @@ describe('AppNexusAdapter', function () {
757
757
  });
758
758
  }
759
759
 
760
+ it('should convert keyword params (when there are no ortb keywords) to proper form and attaches to request', function () {
761
+ let bidRequest = Object.assign({},
762
+ bidRequests[0],
763
+ {
764
+ params: {
765
+ placementId: '10433394',
766
+ keywords: {
767
+ single: 'val',
768
+ singleArr: ['val'],
769
+ singleArrNum: [5],
770
+ multiValMixed: ['value1', 2, 'value3'],
771
+ singleValNum: 123,
772
+ emptyStr: '',
773
+ emptyArr: [''],
774
+ badValue: { 'foo': 'bar' } // should be dropped
775
+ }
776
+ }
777
+ }
778
+ );
779
+
780
+ const request = spec.buildRequests([bidRequest]);
781
+ const payload = JSON.parse(request.data);
782
+
783
+ expect(payload.tags[0].keywords).to.deep.equal([{
784
+ 'key': 'single',
785
+ 'value': ['val']
786
+ }, {
787
+ 'key': 'singleArr',
788
+ 'value': ['val']
789
+ }, {
790
+ 'key': 'singleArrNum',
791
+ 'value': ['5']
792
+ }, {
793
+ 'key': 'multiValMixed',
794
+ 'value': ['value1', '2', 'value3']
795
+ }, {
796
+ 'key': 'singleValNum',
797
+ 'value': ['123']
798
+ }, {
799
+ 'key': 'emptyStr'
800
+ }, {
801
+ 'key': 'emptyArr'
802
+ }]);
803
+ });
804
+
805
+ it('should convert adUnit ortb2 keywords (when there are no bid param keywords) to proper form and attaches to request', function () {
806
+ let bidRequest = Object.assign({},
807
+ bidRequests[0],
808
+ {
809
+ ortb2Imp: {
810
+ ext: {
811
+ data: {
812
+ keywords: 'ortb2=yes,ortb2test, multiValMixed=4, singleValNum=456'
813
+ }
814
+ }
815
+ }
816
+ }
817
+ );
818
+
819
+ const request = spec.buildRequests([bidRequest]);
820
+ const payload = JSON.parse(request.data);
821
+
822
+ expect(payload.tags[0].keywords).to.deep.equal([{
823
+ 'key': 'ortb2',
824
+ 'value': ['yes']
825
+ }, {
826
+ 'key': 'ortb2test'
827
+ }, {
828
+ 'key': 'multiValMixed',
829
+ 'value': ['4']
830
+ }, {
831
+ 'key': 'singleValNum',
832
+ 'value': ['456']
833
+ }]);
834
+ });
835
+
760
836
  it('should convert keyword params and adUnit ortb2 keywords to proper form and attaches to request', function () {
761
837
  let bidRequest = Object.assign({},
762
838
  bidRequests[0],
@@ -293,6 +293,7 @@ describe('BidWatch Analytics', function () {
293
293
  expect(message.auctionEnd[0].bidsReceived[0]).not.to.have.property('ad');
294
294
  expect(message.auctionEnd[0].bidsReceived[0]).to.have.property('meta');
295
295
  expect(message.auctionEnd[0].bidsReceived[0].meta).to.have.property('advertiserDomains');
296
+ expect(message.auctionEnd[0].bidsReceived[0]).to.have.property('adId');
296
297
  expect(message.auctionEnd[0]).to.have.property('bidderRequests').and.to.have.lengthOf(1);
297
298
  expect(message.auctionEnd[0].bidderRequests[0]).to.have.property('gdprConsent');
298
299
  expect(message.auctionEnd[0].bidderRequests[0].gdprConsent).not.to.have.property('vendorData');
@@ -315,6 +316,7 @@ describe('BidWatch Analytics', function () {
315
316
  expect(server.requests.length).to.equal(1);
316
317
  let message = JSON.parse(server.requests[0].requestBody);
317
318
  expect(message).not.to.have.property('ad');
319
+ expect(message).to.have.property('adId')
318
320
  expect(message).to.have.property('cpmIncrement').and.to.equal(27.4276);
319
321
  sinon.assert.callCount(bidwatchAnalytics.track, 1);
320
322
  });