prebid.js 7.48.0 → 7.50.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 (219) hide show
  1. package/README.md +3 -0
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.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/admixerBidAdapter.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/aidemBidAdapter.js +1 -1
  13. package/dist/ajaBidAdapter.js +1 -1
  14. package/dist/amxBidAdapter.js +1 -1
  15. package/dist/amxIdSystem.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/asoBidAdapter.js +1 -1
  19. package/dist/axonixBidAdapter.js +1 -1
  20. package/dist/beopBidAdapter.js +1 -1
  21. package/dist/bidglassBidAdapter.js +1 -1
  22. package/dist/big-richmediaBidAdapter.js +1 -1
  23. package/dist/bridgewellBidAdapter.js +1 -1
  24. package/dist/brightMountainMediaBidAdapter.js +1 -1
  25. package/dist/carodaBidAdapter.js +1 -1
  26. package/dist/chtnwBidAdapter.js +1 -1
  27. package/dist/concertBidAdapter.js +1 -1
  28. package/dist/confiantRtdProvider.js +1 -1
  29. package/dist/connectadBidAdapter.js +1 -1
  30. package/dist/consumableBidAdapter.js +1 -1
  31. package/dist/conversantAnalyticsAdapter.js +1 -1
  32. package/dist/conversantBidAdapter.js +1 -1
  33. package/dist/craftBidAdapter.js +1 -1
  34. package/dist/criteoBidAdapter.js +1 -1
  35. package/dist/cwireBidAdapter.js +1 -1
  36. package/dist/dependencies.json +3 -0
  37. package/dist/dspxBidAdapter.js +1 -1
  38. package/dist/eplanningBidAdapter.js +1 -1
  39. package/dist/feedadBidAdapter.js +1 -1
  40. package/dist/finativeBidAdapter.js +1 -1
  41. package/dist/freewheel-sspBidAdapter.js +1 -1
  42. package/dist/glimpseBidAdapter.js +1 -1
  43. package/dist/gmosspBidAdapter.js +1 -1
  44. package/dist/goldbachBidAdapter.js +1 -1
  45. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  46. package/dist/greenbidsRtdProvider.js +1 -1
  47. package/dist/gridBidAdapter.js +1 -1
  48. package/dist/gumgumBidAdapter.js +1 -1
  49. package/dist/h12mediaBidAdapter.js +1 -1
  50. package/dist/id5IdSystem.js +1 -1
  51. package/dist/improvedigitalBidAdapter.js +1 -1
  52. package/dist/inmarBidAdapter.js +1 -1
  53. package/dist/insticatorBidAdapter.js +1 -1
  54. package/dist/ixBidAdapter.js +1 -1
  55. package/dist/justpremiumBidAdapter.js +1 -1
  56. package/dist/kargoBidAdapter.js +1 -1
  57. package/dist/konduitAnalyticsAdapter.js +1 -1
  58. package/dist/kueezBidAdapter.js +1 -1
  59. package/dist/kueezRtbBidAdapter.js +1 -1
  60. package/dist/kulturemediaBidAdapter.js +1 -1
  61. package/dist/lassoBidAdapter.js +1 -1
  62. package/dist/lifestreetBidAdapter.js +1 -1
  63. package/dist/liveIntentIdSystem.js +1 -1
  64. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  65. package/dist/logicadBidAdapter.js +1 -1
  66. package/dist/loglyliftBidAdapter.js +1 -1
  67. package/dist/magniteAnalyticsAdapter.js +1 -1
  68. package/dist/malltvAnalyticsAdapter.js +1 -1
  69. package/dist/marsmediaBidAdapter.js +1 -1
  70. package/dist/mediafuseBidAdapter.js +1 -1
  71. package/dist/mediasquareBidAdapter.js +1 -1
  72. package/dist/mgidBidAdapter.js +1 -1
  73. package/dist/minutemediaBidAdapter.js +1 -1
  74. package/dist/minutemediaplusBidAdapter.js +1 -1
  75. package/dist/nexx360BidAdapter.js +1 -1
  76. package/dist/not-for-prod/prebid.js +136 -134
  77. package/dist/oguryBidAdapter.js +1 -1
  78. package/dist/onetagBidAdapter.js +1 -1
  79. package/dist/ooloAnalyticsAdapter.js +1 -1
  80. package/dist/optidigitalBidAdapter.js +1 -1
  81. package/dist/outbrainBidAdapter.js +1 -1
  82. package/dist/parrableIdSystem.js +1 -1
  83. package/dist/permutiveRtdProvider.js +1 -1
  84. package/dist/pixfutureBidAdapter.js +1 -1
  85. package/dist/prebid-core.js +1 -1
  86. package/dist/prebidServerBidAdapter.js +1 -1
  87. package/dist/publinkIdSystem.js +1 -1
  88. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  89. package/dist/pubmaticBidAdapter.js +1 -1
  90. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  91. package/dist/pxyzBidAdapter.js +1 -1
  92. package/dist/quantcastBidAdapter.js +1 -1
  93. package/dist/readpeakBidAdapter.js +1 -1
  94. package/dist/relaidoBidAdapter.js +1 -1
  95. package/dist/retailspotBidAdapter.js +1 -0
  96. package/dist/rhythmoneBidAdapter.js +1 -1
  97. package/dist/riseBidAdapter.js +1 -1
  98. package/dist/rubiconAnalyticsAdapter.js +1 -1
  99. package/dist/rubiconBidAdapter.js +1 -1
  100. package/dist/seedingAllianceBidAdapter.js +1 -1
  101. package/dist/seedtagBidAdapter.js +1 -1
  102. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  103. package/dist/sharethroughBidAdapter.js +1 -1
  104. package/dist/shinezBidAdapter.js +1 -1
  105. package/dist/silverpushBidAdapter.js +1 -0
  106. package/dist/smaatoBidAdapter.js +1 -1
  107. package/dist/smartadserverBidAdapter.js +1 -1
  108. package/dist/smartxBidAdapter.js +1 -1
  109. package/dist/smilewantedBidAdapter.js +1 -1
  110. package/dist/sonobiBidAdapter.js +1 -1
  111. package/dist/sovrnAnalyticsAdapter.js +1 -1
  112. package/dist/sovrnBidAdapter.js +1 -1
  113. package/dist/sspBCBidAdapter.js +1 -1
  114. package/dist/stvBidAdapter.js +1 -1
  115. package/dist/sublimeBidAdapter.js +1 -1
  116. package/dist/synacormediaBidAdapter.js +1 -1
  117. package/dist/targetVideoBidAdapter.js +1 -1
  118. package/dist/teadsBidAdapter.js +1 -1
  119. package/dist/trionBidAdapter.js +1 -1
  120. package/dist/tripleliftBidAdapter.js +1 -1
  121. package/dist/ttdBidAdapter.js +1 -1
  122. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  123. package/dist/uid2IdSystem.js +1 -1
  124. package/dist/underdogmediaBidAdapter.js +1 -1
  125. package/dist/undertoneBidAdapter.js +1 -1
  126. package/dist/vidazooBidAdapter.js +1 -1
  127. package/dist/video.js +1 -1
  128. package/dist/videoModule.js +1 -1
  129. package/dist/videobyteBidAdapter.js +1 -1
  130. package/dist/visxBidAdapter.js +1 -1
  131. package/dist/vuukleBidAdapter.js +1 -1
  132. package/dist/widespaceBidAdapter.js +1 -1
  133. package/dist/winrBidAdapter.js +1 -1
  134. package/dist/yahoosspBidAdapter.js +1 -1
  135. package/dist/yieldlabBidAdapter.js +1 -1
  136. package/dist/yieldmoBidAdapter.js +1 -1
  137. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  138. package/integrationExamples/videoModule/eventsUI/eventsUI.css +205 -0
  139. package/integrationExamples/videoModule/eventsUI/eventsUI.js +181 -0
  140. package/integrationExamples/videoModule/jwplayer/eventsUI.html +295 -0
  141. package/integrationExamples/videoModule/videojs/eventsUI.html +319 -0
  142. package/libraries/video/shared/helpers.js +14 -0
  143. package/modules/33acrossBidAdapter.js +1 -1
  144. package/modules/adgenerationBidAdapter.js +24 -15
  145. package/modules/admixerBidAdapter.js +15 -9
  146. package/modules/aidemBidAdapter.js +3 -1
  147. package/modules/appnexusBidAdapter.js +1 -0
  148. package/modules/beopBidAdapter.js +1 -0
  149. package/modules/confiantRtdProvider.js +15 -12
  150. package/modules/conversantAnalyticsAdapter.js +7 -5
  151. package/modules/conversantBidAdapter.js +1 -1
  152. package/modules/criteoBidAdapter.js +17 -1
  153. package/modules/gridBidAdapter.js +3 -0
  154. package/modules/ixBidAdapter.js +65 -47
  155. package/modules/kueezRtbBidAdapter.js +30 -33
  156. package/modules/liveIntentIdSystem.js +8 -4
  157. package/modules/magniteAnalyticsAdapter.js +26 -3
  158. package/modules/mgidBidAdapter.js +9 -8
  159. package/modules/minutemediaBidAdapter.js +6 -0
  160. package/modules/minutemediaplusBidAdapter.js +30 -32
  161. package/modules/nexx360BidAdapter.js +2 -1
  162. package/modules/permutiveRtdProvider.js +9 -38
  163. package/modules/prebidServerBidAdapter/index.js +1 -3
  164. package/modules/prebidServerBidAdapter/ortbConverter.js +5 -1
  165. package/modules/pubmaticAnalyticsAdapter.js +3 -2
  166. package/modules/retailspotBidAdapter .md +32 -0
  167. package/modules/retailspotBidAdapter.js +186 -0
  168. package/modules/riseBidAdapter.js +6 -0
  169. package/modules/rubiconBidAdapter.js +6 -2
  170. package/modules/silverpushBidAdapter.js +326 -0
  171. package/modules/silverpushBidAdapter.md +107 -0
  172. package/modules/ttdBidAdapter.js +23 -22
  173. package/modules/underdogmediaBidAdapter.js +2 -2
  174. package/modules/vidazooBidAdapter.js +28 -32
  175. package/modules/videoModule/adQueue.js +2 -2
  176. package/modules/videoModule/index.js +9 -5
  177. package/modules/yahoosspBidAdapter.js +6 -0
  178. package/modules/yahoosspBidAdapter.md +37 -0
  179. package/modules/yieldlabBidAdapter.js +27 -5
  180. package/package.json +1 -1
  181. package/src/adapterManager.js +4 -0
  182. package/src/adapters/bidderFactory.js +1 -0
  183. package/src/auction.js +2 -0
  184. package/src/prebid.js +36 -12
  185. package/src/utils/cpm.js +4 -1
  186. package/test/spec/modules/33acrossBidAdapter_spec.js +4 -3
  187. package/test/spec/modules/adgenerationBidAdapter_spec.js +6 -6
  188. package/test/spec/modules/admixerBidAdapter_spec.js +64 -25
  189. package/test/spec/modules/aidemBidAdapter_spec.js +3 -0
  190. package/test/spec/modules/beopBidAdapter_spec.js +4 -0
  191. package/test/spec/modules/confiantRtdProvider_spec.js +4 -1
  192. package/test/spec/modules/conversantBidAdapter_spec.js +2 -1
  193. package/test/spec/modules/criteoBidAdapter_spec.js +109 -0
  194. package/test/spec/modules/gridBidAdapter_spec.js +3 -0
  195. package/test/spec/modules/ixBidAdapter_spec.js +66 -1
  196. package/test/spec/modules/kueezRtbBidAdapter_spec.js +3 -2
  197. package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +28 -0
  198. package/test/spec/modules/liveIntentIdSystem_spec.js +45 -0
  199. package/test/spec/modules/magniteAnalyticsAdapter_spec.js +16 -36
  200. package/test/spec/modules/mass_spec.js +2 -0
  201. package/test/spec/modules/mgidBidAdapter_spec.js +9 -9
  202. package/test/spec/modules/minutemediaBidAdapter_spec.js +18 -0
  203. package/test/spec/modules/minutemediaplusBidAdapter_spec.js +3 -2
  204. package/test/spec/modules/permutiveRtdProvider_spec.js +0 -20
  205. package/test/spec/modules/prebidServerBidAdapter_spec.js +96 -1
  206. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +6 -1
  207. package/test/spec/modules/retailspotBidAdapter_spec.js +426 -0
  208. package/test/spec/modules/riseBidAdapter_spec.js +18 -0
  209. package/test/spec/modules/rubiconBidAdapter_spec.js +143 -67
  210. package/test/spec/modules/silverpushBidAdapter_spec.js +394 -0
  211. package/test/spec/modules/ttdBidAdapter_spec.js +129 -2
  212. package/test/spec/modules/underdogmediaBidAdapter_spec.js +1 -1
  213. package/test/spec/modules/vidazooBidAdapter_spec.js +3 -2
  214. package/test/spec/modules/videoModule/shared/helpers_spec.js +22 -0
  215. package/test/spec/modules/yahoosspBidAdapter_spec.js +60 -1
  216. package/test/spec/modules/yieldlabBidAdapter_spec.js +8 -1
  217. package/test/spec/unit/core/bidderFactory_spec.js +9 -9
  218. package/test/spec/unit/pbjs_api_spec.js +59 -1
  219. package/test/spec/unit/utils/cpm_spec.js +56 -1
@@ -100,33 +100,72 @@ describe('AdmixerAdapter', function () {
100
100
  });
101
101
  });
102
102
 
103
- describe('buildRequestsAdmixerADX', function () {
104
- let validRequest = [
105
- {
106
- bidder: BIDDER_CODE_ADX,
107
- params: {
108
- zone: ZONE_ID,
103
+ describe('buildRequests URL check', function () {
104
+ const requestParamsFor = (bidder) => ({
105
+ validRequest: [
106
+ {
107
+ bidder: bidder,
108
+ params: {
109
+ zone: ZONE_ID,
110
+ },
111
+ adUnitCode: 'adunit-code',
112
+ sizes: [
113
+ [300, 250],
114
+ [300, 600],
115
+ ],
116
+ bidId: '30b31c1838de1e',
117
+ bidderRequestId: '22edbae2733bf6',
118
+ auctionId: '1d1a030790a475',
109
119
  },
110
- adUnitCode: 'adunit-code',
111
- sizes: [
112
- [300, 250],
113
- [300, 600],
114
- ],
115
- bidId: '30b31c1838de1e',
116
- bidderRequestId: '22edbae2733bf6',
117
- auctionId: '1d1a030790a475',
118
- },
119
- ];
120
- let bidderRequest = {
121
- bidderCode: BIDDER_CODE_ADX,
122
- refererInfo: {
123
- page: 'https://example.com',
124
- },
125
- };
120
+ ],
121
+ bidderRequest: {
122
+ bidderCode: bidder,
123
+ refererInfo: {
124
+ page: 'https://example.com',
125
+ },
126
+ }
127
+ })
126
128
 
127
- it('sends bid request to ADX ENDPOINT', function () {
128
- const request = spec.buildRequests(validRequest, bidderRequest);
129
- expect(request.url).to.equal(ENDPOINT_URL_ADX);
129
+ it('build request for admixer', function () {
130
+ const requestParams = requestParamsFor('admixer');
131
+ const request = spec.buildRequests(requestParams.validRequest, requestParams.bidderRequest);
132
+ expect(request.url).to.equal('https://inv-nets.admixer.net/prebid.1.2.aspx');
133
+ expect(request.method).to.equal('POST');
134
+ });
135
+ it('build request for go2net', function () {
136
+ const requestParams = requestParamsFor('go2net');
137
+ const request = spec.buildRequests(requestParams.validRequest, requestParams.bidderRequest);
138
+ expect(request.url).to.equal('https://ads.go2net.com.ua/prebid.1.2.aspx');
139
+ expect(request.method).to.equal('POST');
140
+ });
141
+ it('build request for adblender', function () {
142
+ const requestParams = requestParamsFor('adblender');
143
+ const request = spec.buildRequests(requestParams.validRequest, requestParams.bidderRequest);
144
+ expect(request.url).to.equal('https://inv-nets.admixer.net/prebid.1.2.aspx');
145
+ expect(request.method).to.equal('POST');
146
+ });
147
+ it('build request for adsyield', function () {
148
+ const requestParams = requestParamsFor('adsyield');
149
+ const request = spec.buildRequests(requestParams.validRequest, requestParams.bidderRequest);
150
+ expect(request.url).to.equal('https://ads.adsyield.com/prebid.1.2.aspx');
151
+ expect(request.method).to.equal('POST');
152
+ });
153
+ it('build request for futureads', function () {
154
+ const requestParams = requestParamsFor('futureads');
155
+ const request = spec.buildRequests(requestParams.validRequest, requestParams.bidderRequest);
156
+ expect(request.url).to.equal('https://ads.futureads.io/prebid.1.2.aspx');
157
+ expect(request.method).to.equal('POST');
158
+ });
159
+ it('build request for smn', function () {
160
+ const requestParams = requestParamsFor('smn');
161
+ const request = spec.buildRequests(requestParams.validRequest, requestParams.bidderRequest);
162
+ expect(request.url).to.equal('https://ads.smn.rs/prebid.1.2.aspx');
163
+ expect(request.method).to.equal('POST');
164
+ });
165
+ it('build request for admixeradx', function () {
166
+ const requestParams = requestParamsFor('admixeradx');
167
+ const request = spec.buildRequests(requestParams.validRequest, requestParams.bidderRequest);
168
+ expect(request.url).to.equal('https://inv-nets.admixer.net/adxprebid.1.2.aspx');
130
169
  expect(request.method).to.equal('POST');
131
170
  });
132
171
  });
@@ -359,6 +359,9 @@ const WIN_NOTICE_APP = {
359
359
  'app_name': '{{APP_NAME}}',
360
360
  'app_store_url': '{{APP_STORE_URL}}',
361
361
  'inventory_source': '{{INVENTORY_SOURCE}}'
362
+ },
363
+ 'win_notice_ext': {
364
+ 'seatid': '{{SEAT_ID}}'
362
365
  }
363
366
  }
364
367
  },
@@ -99,6 +99,8 @@ describe('BeOp Bid Adapter tests', () => {
99
99
  expect(url).to.equal(ENDPOINT);
100
100
  expect(payload.pid).to.exist;
101
101
  expect(payload.pid).to.equal('5a8af500c9e77c00017e4cad');
102
+ expect(payload.gdpr_applies).to.exist;
103
+ expect(payload.gdpr_applies).to.equals(false);
102
104
  expect(payload.slts[0].name).to.exist;
103
105
  expect(payload.slts[0].name).to.equal('bellow-article');
104
106
  expect(payload.slts[0].flr).to.equal(10);
@@ -121,6 +123,8 @@ describe('BeOp Bid Adapter tests', () => {
121
123
 
122
124
  const request = spec.buildRequests(bidRequests, bidderRequest);
123
125
  const payload = JSON.parse(request.data);
126
+ expect(payload.gdpr_applies).to.exist;
127
+ expect(payload.gdpr_applies).to.equals(true);
124
128
  expect(payload.tc_string).to.exist;
125
129
  expect(payload.tc_string).to.equal('BOJ8RZsOJ8RZsABAB8AAAAAZ+A==');
126
130
  expect(payload.url).to.exist;
@@ -46,6 +46,7 @@ describe('Confiant RTD module', function () {
46
46
  let listenerCallback;
47
47
  const mockWindow = { addEventListener: (a, cb) => (listenerCallback = cb) };
48
48
  let billableEventsCounter = 0;
49
+ const propertyId = 'fff';
49
50
 
50
51
  events.on(CONSTANTS.EVENTS.BILLABLE_EVENT, (e) => {
51
52
  if (e.vendor === 'confiant') {
@@ -57,15 +58,17 @@ describe('Confiant RTD module', function () {
57
58
  }
58
59
  });
59
60
 
60
- subscribeToConfiantCommFrame(mockWindow);
61
+ subscribeToConfiantCommFrame(mockWindow, propertyId);
61
62
  listenerCallback({
62
63
  data: {
64
+ type: 'cnft:reportBillableEvent:' + propertyId,
63
65
  auctionId: 'auctionId',
64
66
  transactionId: 'transactionId'
65
67
  }
66
68
  });
67
69
  listenerCallback({
68
70
  data: {
71
+ type: 'cnft:reportBillableEvent:' + propertyId,
69
72
  auctionId: 'auctionId',
70
73
  transactionId: 'transactionId'
71
74
  }
@@ -221,8 +221,9 @@ describe('Conversant adapter tests', function() {
221
221
 
222
222
  it('Verify basic properties', function() {
223
223
  expect(spec.code).to.equal('conversant');
224
- expect(spec.aliases).to.be.an('array').with.lengthOf(1);
224
+ expect(spec.aliases).to.be.an('array').with.lengthOf(2);
225
225
  expect(spec.aliases[0]).to.equal('cnvr');
226
+ expect(spec.aliases[1]).to.equal('epsilon');
226
227
  expect(spec.supportedMediaTypes).to.be.an('array').with.lengthOf(2);
227
228
  expect(spec.supportedMediaTypes[1]).to.equal('video');
228
229
  });
@@ -710,6 +710,42 @@ describe('The Criteo bidding adapter', function () {
710
710
  expect(ortbRequest.slots[0].native).to.equal(true);
711
711
  });
712
712
 
713
+ it('should properly forward eids', function () {
714
+ const bidRequests = [
715
+ {
716
+ bidder: 'criteo',
717
+ adUnitCode: 'bid-123',
718
+ transactionId: 'transaction-123',
719
+ mediaTypes: {
720
+ banner: {
721
+ sizes: [[728, 90]]
722
+ }
723
+ },
724
+ userIdAsEids: [
725
+ {
726
+ source: 'criteo.com',
727
+ uids: [{
728
+ id: 'abc',
729
+ atype: 1
730
+ }]
731
+ }
732
+ ],
733
+ params: {}
734
+ },
735
+ ];
736
+ const request = spec.buildRequests(bidRequests, bidderRequest);
737
+ const ortbRequest = request.data;
738
+ expect(ortbRequest.user.ext.eids).to.deep.equal([
739
+ {
740
+ source: 'criteo.com',
741
+ uids: [{
742
+ id: 'abc',
743
+ atype: 1
744
+ }]
745
+ }
746
+ ]);
747
+ });
748
+
713
749
  it('should properly detect and forward native flag', function () {
714
750
  const bidRequests = [
715
751
  {
@@ -1543,6 +1579,73 @@ describe('The Criteo bidding adapter', function () {
1543
1579
  }
1544
1580
  });
1545
1581
  });
1582
+
1583
+ it('should properly build a request when imp.rwdd is present', function () {
1584
+ const bidderRequest = {};
1585
+ const bidRequests = [
1586
+ {
1587
+ bidder: 'criteo',
1588
+ adUnitCode: 'bid-123',
1589
+ transactionId: 'transaction-123',
1590
+ mediaTypes: {
1591
+ banner: {
1592
+ sizes: [[728, 90]]
1593
+ }
1594
+ },
1595
+ params: {
1596
+ zoneId: 123,
1597
+ ext: {
1598
+ bidfloor: 0.75
1599
+ }
1600
+ },
1601
+ ortb2Imp: {
1602
+ rwdd: 1,
1603
+ ext: {
1604
+ data: {
1605
+ someContextAttribute: 'abc'
1606
+ }
1607
+ }
1608
+ }
1609
+ },
1610
+ ];
1611
+
1612
+ const request = spec.buildRequests(bidRequests, bidderRequest);
1613
+ expect(request.data.slots[0].rwdd).to.be.not.null;
1614
+ expect(request.data.slots[0].rwdd).to.equal(1);
1615
+ });
1616
+
1617
+ it('should properly build a request when imp.rwdd is false', function () {
1618
+ const bidderRequest = {};
1619
+ const bidRequests = [
1620
+ {
1621
+ bidder: 'criteo',
1622
+ adUnitCode: 'bid-123',
1623
+ transactionId: 'transaction-123',
1624
+ mediaTypes: {
1625
+ banner: {
1626
+ sizes: [[728, 90]]
1627
+ }
1628
+ },
1629
+ params: {
1630
+ zoneId: 123,
1631
+ ext: {
1632
+ bidfloor: 0.75
1633
+ }
1634
+ },
1635
+ ortb2Imp: {
1636
+ rwdd: 0,
1637
+ ext: {
1638
+ data: {
1639
+ someContextAttribute: 'abc'
1640
+ }
1641
+ }
1642
+ }
1643
+ },
1644
+ ];
1645
+
1646
+ const request = spec.buildRequests(bidRequests, bidderRequest);
1647
+ expect(request.data.slots[0].rwdd).to.be.undefined;
1648
+ });
1546
1649
  });
1547
1650
 
1548
1651
  describe('interpretResponse', function () {
@@ -1565,6 +1668,11 @@ describe('The Criteo bidding adapter', function () {
1565
1668
  height: 90,
1566
1669
  deal: 'myDealCode',
1567
1670
  adomain: ['criteo.com'],
1671
+ ext: {
1672
+ meta: {
1673
+ networkName: 'Criteo'
1674
+ }
1675
+ }
1568
1676
  }],
1569
1677
  },
1570
1678
  };
@@ -1587,6 +1695,7 @@ describe('The Criteo bidding adapter', function () {
1587
1695
  expect(bids[0].height).to.equal(90);
1588
1696
  expect(bids[0].dealId).to.equal('myDealCode');
1589
1697
  expect(bids[0].meta.advertiserDomains[0]).to.equal('criteo.com');
1698
+ expect(bids[0].meta.networkName).to.equal('Criteo');
1590
1699
  });
1591
1700
 
1592
1701
  it('should properly parse a bid response with a zoneId', function () {
@@ -423,6 +423,7 @@ describe('TheMediaGrid Adapter', function () {
423
423
  api: [1, 2],
424
424
  skip: 1,
425
425
  placement: 1,
426
+ plcmt: 2,
426
427
  minduration: 0,
427
428
  playbackmethod: 1,
428
429
  startdelay: 0
@@ -486,6 +487,7 @@ describe('TheMediaGrid Adapter', function () {
486
487
  'api': [1, 2],
487
488
  'skip': 1,
488
489
  'placement': 1,
490
+ 'plcmt': 2,
489
491
  'playbackmethod': 1,
490
492
  'startdelay': 0
491
493
  }
@@ -539,6 +541,7 @@ describe('TheMediaGrid Adapter', function () {
539
541
  ],
540
542
  'minduration': 0,
541
543
  'placement': 1,
544
+ 'plcmt': 2,
542
545
  'playbackmethod': 1,
543
546
  'playersizes': [
544
547
  '400x600'
@@ -725,6 +725,11 @@ describe('IndexexchangeAdapter', function () {
725
725
  refererInfo: {
726
726
  page: 'https://www.prebid.org',
727
727
  canonicalUrl: 'https://www.prebid.org/the/link/to/the/page'
728
+ },
729
+ ortb2: {
730
+ site: {
731
+ page: 'https://www.prebid.org'
732
+ }
728
733
  }
729
734
  };
730
735
 
@@ -2135,7 +2140,7 @@ describe('IndexexchangeAdapter', function () {
2135
2140
 
2136
2141
  const requestWithFirstPartyData = spec.buildRequests(DEFAULT_BANNER_VALID_BID, DEFAULT_OPTION)[0];
2137
2142
  const pageUrl = extractPayload(requestWithFirstPartyData).site.page;
2138
- const expectedPageUrl = DEFAULT_OPTION.refererInfo.page + '?ab=123&cd=123%23ab&e%2Ff=456&h%3Fg=456%23cd';
2143
+ const expectedPageUrl = DEFAULT_OPTION.ortb2.site.page + '/?ab=123&cd=123%23ab&e%2Ff=456&h%3Fg=456%23cd';
2139
2144
  expect(pageUrl).to.equal(expectedPageUrl);
2140
2145
  });
2141
2146
 
@@ -2233,6 +2238,66 @@ describe('IndexexchangeAdapter', function () {
2233
2238
  });
2234
2239
  });
2235
2240
 
2241
+ describe('getIxFirstPartyDataPageUrl', () => {
2242
+ beforeEach(() => {
2243
+ config.setConfig({ ix: { firstPartyData: { key1: 'value1', key2: 'value2' } } });
2244
+ });
2245
+
2246
+ afterEach(() => {
2247
+ config.resetConfig();
2248
+ });
2249
+
2250
+ it('should return the modified URL with first party data query parameters appended', () => {
2251
+ const requestWithIXFirstPartyData = spec.buildRequests(DEFAULT_BANNER_VALID_BID, DEFAULT_OPTION)[0];
2252
+ const pageUrl = extractPayload(requestWithIXFirstPartyData).site.page;
2253
+ expect(pageUrl).to.equal('https://www.prebid.org/?key1=value1&key2=value2');
2254
+ });
2255
+
2256
+ it('should return the modified URL with first party data query parameters appended but not duplicated', () => {
2257
+ const bidderRequest = deepClone(DEFAULT_OPTION);
2258
+ bidderRequest.ortb2.site.page = 'https://www.prebid.org/?key1=value1'
2259
+ const requestWithIXFirstPartyData = spec.buildRequests(DEFAULT_BANNER_VALID_BID, DEFAULT_OPTION)[0];
2260
+ const pageUrl = extractPayload(requestWithIXFirstPartyData).site.page;
2261
+ expect(pageUrl).to.equal('https://www.prebid.org/?key1=value1&key2=value2');
2262
+ });
2263
+
2264
+ it('should not overwrite existing query parameters with first party data', () => {
2265
+ config.setConfig({ ix: { firstPartyData: { key1: 'value1', key2: 'value2' } } });
2266
+ const bidderRequest = deepClone(DEFAULT_OPTION);
2267
+ bidderRequest.ortb2.site.page = 'https://www.prebid.org/?key1=existingValue1'
2268
+ const requestWithIXFirstPartyData = spec.buildRequests(DEFAULT_BANNER_VALID_BID, bidderRequest)[0];
2269
+ const pageUrl = extractPayload(requestWithIXFirstPartyData).site.page;
2270
+ expect(pageUrl).to.equal('https://www.prebid.org/?key1=existingValue1&key2=value2');
2271
+ });
2272
+
2273
+ it('should return the original URL if no first party data is available', () => {
2274
+ config.setConfig({ ix: {} });
2275
+ const requestWithIXFirstPartyData = spec.buildRequests(DEFAULT_BANNER_VALID_BID, DEFAULT_OPTION)[0];
2276
+ const pageUrl = extractPayload(requestWithIXFirstPartyData).site.page;
2277
+ expect(pageUrl).to.equal('https://www.prebid.org');
2278
+ });
2279
+
2280
+ it('should return the original URL referer page url if ortb2 does not exist', () => {
2281
+ config.setConfig({ ix: {} });
2282
+ const bidderRequest = deepClone(DEFAULT_OPTION);
2283
+ delete bidderRequest.ortb2;
2284
+ bidderRequest.refererInfo.page = 'https://example.com';
2285
+ const requestWithIXFirstPartyData = spec.buildRequests(DEFAULT_BANNER_VALID_BID, bidderRequest)[0];
2286
+ const pageUrl = extractPayload(requestWithIXFirstPartyData).site.page;
2287
+ expect(pageUrl).to.equal('https://example.com');
2288
+ });
2289
+
2290
+ it('should use referer URL if the provided ortb2.site.page URL is not valid', () => {
2291
+ config.setConfig({ ix: { firstPartyData: { key1: 'value1', key2: 'value2' } } });
2292
+ const bidderRequest = deepClone(DEFAULT_OPTION);
2293
+ bidderRequest.ortb2.site.page = 'www.invalid-url*&?.com';
2294
+ bidderRequest.refererInfo.page = 'https://www.prebid.org';
2295
+ const requestWithIXFirstPartyData = spec.buildRequests(DEFAULT_BANNER_VALID_BID, bidderRequest)[0];
2296
+ const pageUrl = extractPayload(requestWithIXFirstPartyData).site.page;
2297
+ expect(pageUrl).to.equal('https://www.prebid.org/?key1=value1&key2=value2');
2298
+ });
2299
+ });
2300
+
2236
2301
  describe('request should contain both banner and video requests', function () {
2237
2302
  const request = spec.buildRequests([DEFAULT_BANNER_VALID_BID[0], DEFAULT_VIDEO_VALID_BID[0]], {});
2238
2303
  it('should have banner request', () => {
@@ -1,7 +1,6 @@
1
1
  import {expect} from 'chai';
2
2
  import {
3
3
  spec as adapter,
4
- SUPPORTED_ID_SYSTEMS,
5
4
  createDomain,
6
5
  hashCode,
7
6
  extractPID,
@@ -18,6 +17,8 @@ import {useFakeTimers} from 'sinon';
18
17
  import {BANNER, VIDEO} from '../../../src/mediaTypes';
19
18
  import {config} from '../../../src/config';
20
19
 
20
+ export const TEST_ID_SYSTEMS = ['britepoolid', 'criteoId', 'id5id', 'idl_env', 'lipb', 'netId', 'parrableId', 'pubcid', 'tdid', 'pubProvidedId'];
21
+
21
22
  const SUB_DOMAIN = 'exchange';
22
23
 
23
24
  const BID = {
@@ -498,7 +499,7 @@ describe('KueezRtbBidAdapter', function () {
498
499
  });
499
500
 
500
501
  describe('user id system', function () {
501
- Object.keys(SUPPORTED_ID_SYSTEMS).forEach((idSystemProvider) => {
502
+ TEST_ID_SYSTEMS.forEach((idSystemProvider) => {
502
503
  const id = Date.now().toString();
503
504
  const bid = utils.deepClone(BID);
504
505
 
@@ -73,6 +73,34 @@ describe('LiveIntentMinimalId', function() {
73
73
  expect(callBackSpy.calledOnce).to.be.true;
74
74
  });
75
75
 
76
+ it('should call the Identity Exchange endpoint with the privided distributorId', function() {
77
+ getCookieStub.returns(null);
78
+ let callBackSpy = sinon.spy();
79
+ let submoduleCallback = liveIntentIdSubmodule.getId({ params: { fireEventDelay: 1, distributorId: 'did-1111' } }).callback;
80
+ submoduleCallback(callBackSpy);
81
+ let request = server.requests[0];
82
+ expect(request.url).to.be.eq('https://idx.liadm.com/idex/did-1111/any?did=did-1111&resolve=nonId');
83
+ request.respond(
84
+ 204,
85
+ responseHeader
86
+ );
87
+ expect(callBackSpy.calledOnceWith({})).to.be.true;
88
+ });
89
+
90
+ it('should call the Identity Exchange endpoint without the privided distributorId when appId is provided', function() {
91
+ getCookieStub.returns(null);
92
+ let callBackSpy = sinon.spy();
93
+ let submoduleCallback = liveIntentIdSubmodule.getId({ params: { fireEventDelay: 1, distributorId: 'did-1111', liCollectConfig: { appId: 'a-0001' } } }).callback;
94
+ submoduleCallback(callBackSpy);
95
+ let request = server.requests[0];
96
+ expect(request.url).to.be.eq('https://idx.liadm.com/idex/prebid/any?resolve=nonId');
97
+ request.respond(
98
+ 204,
99
+ responseHeader
100
+ );
101
+ expect(callBackSpy.calledOnceWith({})).to.be.true;
102
+ });
103
+
76
104
  it('should call the default url of the LiveIntent Identity Exchange endpoint, with a partner', function() {
77
105
  getCookieStub.returns(null);
78
106
  let callBackSpy = sinon.spy();
@@ -100,6 +100,23 @@ describe('LiveIntentId', function() {
100
100
  }, 200);
101
101
  });
102
102
 
103
+ it('should fire an event with the provided distributorId', function (done) {
104
+ liveIntentIdSubmodule.decode({}, { params: { fireEventDelay: 1, distributorId: 'did-1111' } });
105
+ setTimeout(() => {
106
+ expect(server.requests[0].url).to.match(/https:\/\/rp.liadm.com\/j\?.*did=did-1111.*&wpn=prebid.*/);
107
+ done();
108
+ }, 200);
109
+ });
110
+
111
+ it('should fire an event without the provided distributorId when appId is provided', function (done) {
112
+ liveIntentIdSubmodule.decode({}, { params: { fireEventDelay: 1, distributorId: 'did-1111', liCollectConfig: { appId: 'a-0001' } } });
113
+ setTimeout(() => {
114
+ expect(server.requests[0].url).to.match(/https:\/\/rp.liadm.com\/j\?.*aid=a-0001.*&wpn=prebid.*/);
115
+ expect(server.requests[0].url).to.not.match(/.*did=*/);
116
+ done();
117
+ }, 200);
118
+ });
119
+
103
120
  it('should initialize LiveConnect and emit an event with a privacy string when decode', function(done) {
104
121
  uspConsentDataStub.returns('1YNY');
105
122
  gdprConsentDataStub.returns({
@@ -162,6 +179,34 @@ describe('LiveIntentId', function() {
162
179
  expect(callBackSpy.calledOnceWith({})).to.be.true;
163
180
  });
164
181
 
182
+ it('should call the Identity Exchange endpoint with the privided distributorId', function() {
183
+ getCookieStub.returns(null);
184
+ let callBackSpy = sinon.spy();
185
+ let submoduleCallback = liveIntentIdSubmodule.getId({ params: { fireEventDelay: 1, distributorId: 'did-1111' } }).callback;
186
+ submoduleCallback(callBackSpy);
187
+ let request = server.requests[0];
188
+ expect(request.url).to.be.eq('https://idx.liadm.com/idex/did-1111/any?did=did-1111&resolve=nonId');
189
+ request.respond(
190
+ 204,
191
+ responseHeader
192
+ );
193
+ expect(callBackSpy.calledOnceWith({})).to.be.true;
194
+ });
195
+
196
+ it('should call the Identity Exchange endpoint without the privided distributorId when appId is provided', function() {
197
+ getCookieStub.returns(null);
198
+ let callBackSpy = sinon.spy();
199
+ let submoduleCallback = liveIntentIdSubmodule.getId({ params: { fireEventDelay: 1, distributorId: 'did-1111', liCollectConfig: { appId: 'a-0001' } } }).callback;
200
+ submoduleCallback(callBackSpy);
201
+ let request = server.requests[0];
202
+ expect(request.url).to.be.eq('https://idx.liadm.com/idex/prebid/any?resolve=nonId');
203
+ request.respond(
204
+ 204,
205
+ responseHeader
206
+ );
207
+ expect(callBackSpy.calledOnceWith({})).to.be.true;
208
+ });
209
+
165
210
  it('should call the default url of the LiveIntent Identity Exchange endpoint, with a partner', function() {
166
211
  getCookieStub.returns(null);
167
212
  let callBackSpy = sinon.spy();
@@ -9,10 +9,6 @@ import CONSTANTS from 'src/constants.json';
9
9
  import { config } from 'src/config.js';
10
10
  import { server } from 'test/mocks/xhr.js';
11
11
  import * as mockGpt from '../integration/faker/googletag.js';
12
- import {
13
- setConfig,
14
- addBidResponseHook,
15
- } from 'modules/currency.js';
16
12
  import { getGlobal } from '../../../src/prebidGlobal.js';
17
13
  import { deepAccess } from '../../../src/utils.js';
18
14
 
@@ -35,6 +31,16 @@ const {
35
31
 
36
32
  const STUBBED_UUID = '12345678-1234-1234-1234-123456789abc';
37
33
 
34
+ const metrics = {
35
+ getMetrics: () => {
36
+ return {
37
+ 'adapter.client.total': 271,
38
+ 'adapter.client.net': 240,
39
+ 'adapter.s2s.total': 371,
40
+ 'adapter.s2s.net': 340
41
+ }
42
+ }
43
+ }
38
44
  // Mock Event Data
39
45
  const MOCK = {
40
46
  AUCTION_INIT: {
@@ -160,6 +166,7 @@ const MOCK = {
160
166
  'size': '300x250',
161
167
  'status': 'rendered',
162
168
  getStatusCode: () => 1,
169
+ metrics
163
170
  },
164
171
  SEAT_NON_BID: {
165
172
  auctionId: '99785e47-a7c8-4c8a-ae05-ef1c717a4b4d',
@@ -186,6 +193,7 @@ const MOCK = {
186
193
  'bidId': '23fcd8cf4bf0d7',
187
194
  'auctionId': '99785e47-a7c8-4c8a-ae05-ef1c717a4b4d',
188
195
  'src': 'client',
196
+ metrics
189
197
  }
190
198
  ]
191
199
  },
@@ -262,6 +270,7 @@ const ANALYTICS_MESSAGE = {
262
270
  'source': 'client',
263
271
  'status': 'success',
264
272
  'clientLatencyMillis': 271,
273
+ 'httpLatencyMillis': 240,
265
274
  'bidResponse': {
266
275
  'bidPriceUSD': 3.4,
267
276
  'mediaType': 'banner',
@@ -298,6 +307,7 @@ const ANALYTICS_MESSAGE = {
298
307
  'source': 'client',
299
308
  'status': 'success',
300
309
  'clientLatencyMillis': 271,
310
+ 'httpLatencyMillis': 240,
301
311
  'bidResponse': {
302
312
  'bidPriceUSD': 3.4,
303
313
  'mediaType': 'banner',
@@ -1353,9 +1363,6 @@ describe('magnite analytics adapter', function () {
1353
1363
  // adunit should be marked as error
1354
1364
  expectedMessage.auctions[0].adUnits[0].status = 'error';
1355
1365
 
1356
- // timed out in 1000 ms
1357
- expectedMessage.auctions[0].adUnits[0].bids[0].clientLatencyMillis = 1000;
1358
-
1359
1366
  expectedMessage.auctions[0].auctionStart = auctionStart;
1360
1367
 
1361
1368
  expect(message).to.deep.equal(expectedMessage);
@@ -1439,34 +1446,6 @@ describe('magnite analytics adapter', function () {
1439
1446
  expect(message).to.deep.equal(expectedMessage);
1440
1447
  });
1441
1448
 
1442
- it('should pass bidderDetail for multibid auctions', function () {
1443
- // Set the rates
1444
- setConfig({
1445
- adServerCurrency: 'JPY',
1446
- rates: {
1447
- USD: {
1448
- JPY: 100
1449
- }
1450
- }
1451
- });
1452
-
1453
- // set our bid response to JPY
1454
- let bidResponse = utils.deepClone(MOCK.BID_RESPONSE);
1455
- bidResponse.currency = 'JPY';
1456
- bidResponse.cpm = 100;
1457
-
1458
- // Now add the bidResponse hook which hooks on the currenct conversion function onto the bid response
1459
- let innerBid;
1460
- addBidResponseHook(function (adCodeId, bid) {
1461
- innerBid = bid;
1462
- }, 'elementId', bidResponse);
1463
-
1464
- // Use the rubi analytics parseBidResponse Function to get the resulting cpm from the bid response!
1465
- const bidResponseObj = parseBidResponse(innerBid);
1466
- expect(bidResponseObj).to.have.property('bidPriceUSD');
1467
- expect(bidResponseObj.bidPriceUSD).to.equal(1.0);
1468
- });
1469
-
1470
1449
  it('should use the integration type provided in the config instead of the default', () => {
1471
1450
  config.setConfig({
1472
1451
  rubicon: {
@@ -2096,7 +2075,8 @@ describe('magnite analytics adapter', function () {
2096
2075
  oldBidId: 'fakeId',
2097
2076
  unknownBid: true,
2098
2077
  bidId: 'fakeId',
2099
- clientLatencyMillis: 271
2078
+ clientLatencyMillis: 271,
2079
+ httpLatencyMillis: 240
2100
2080
  }
2101
2081
  );
2102
2082
  });
@@ -130,6 +130,8 @@ describe('MASS Module', function() {
130
130
  });
131
131
 
132
132
  it('should have a default renderer', function() {
133
+ // SOT needs at least one script to be on the page; ugly solution, but good enough since mass is to be removed in v8
134
+ document.body.appendChild(document.createElement('script'));
133
135
  const render = useDefaultRender('https://example.com/render.js', 'abc');
134
136
  render({});
135
137