prebid.js 9.2.0 → 9.4.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 (279) hide show
  1. package/creative/constants.js +2 -1
  2. package/creative/crossDomain.js +16 -4
  3. package/dist/33acrossAnalyticsAdapter.js +1 -1
  4. package/dist/33acrossBidAdapter.js +1 -1
  5. package/dist/33acrossIdSystem.js +1 -1
  6. package/dist/BTBidAdapter.js +1 -1
  7. package/dist/adagioAnalyticsAdapter.js +1 -1
  8. package/dist/adagioBidAdapter.js +1 -1
  9. package/dist/adagioRtdProvider.js +1 -1
  10. package/dist/adagioUtils.js +1 -1
  11. package/dist/addefendBidAdapter.js +1 -1
  12. package/dist/adfBidAdapter.js +1 -1
  13. package/dist/adgenerationBidAdapter.js +1 -1
  14. package/dist/adlooxRtdProvider.js +1 -1
  15. package/dist/adnuntiusBidAdapter.js +1 -1
  16. package/dist/adqueryBidAdapter.js +1 -1
  17. package/dist/adrelevantisBidAdapter.js +1 -1
  18. package/dist/adstirBidAdapter.js +1 -1
  19. package/dist/adtrgtmeBidAdapter.js +1 -1
  20. package/dist/adxcgAnalyticsAdapter.js +1 -1
  21. package/dist/adxcgBidAdapter.js +1 -1
  22. package/dist/adyoulikeBidAdapter.js +1 -1
  23. package/dist/agmaAnalyticsAdapter.js +1 -1
  24. package/dist/ajaBidAdapter.js +1 -1
  25. package/dist/amxBidAdapter.js +1 -1
  26. package/dist/amxIdSystem.js +1 -1
  27. package/dist/appierAnalyticsAdapter.js +1 -1
  28. package/dist/appnexusBidAdapter.js +1 -1
  29. package/dist/asoBidAdapter.js +1 -1
  30. package/dist/axonixBidAdapter.js +1 -1
  31. package/dist/bidglassBidAdapter.js +1 -1
  32. package/dist/big-richmediaBidAdapter.js +1 -1
  33. package/dist/bridBidAdapter.js +1 -1
  34. package/dist/bridgewellBidAdapter.js +1 -1
  35. package/dist/brightMountainMediaBidAdapter.js +1 -1
  36. package/dist/carodaBidAdapter.js +1 -1
  37. package/dist/chtnwBidAdapter.js +1 -1
  38. package/dist/chunk-core.js +1 -1
  39. package/dist/codefuelBidAdapter.js +1 -1
  40. package/dist/concertBidAdapter.js +1 -1
  41. package/dist/connectadBidAdapter.js +1 -1
  42. package/dist/consentManagement.js +1 -0
  43. package/dist/consentManagementGpp.js +1 -1
  44. package/dist/consentManagementTcf.js +1 -1
  45. package/dist/consumableBidAdapter.js +1 -1
  46. package/dist/conversantAnalyticsAdapter.js +1 -1
  47. package/dist/conversantBidAdapter.js +1 -1
  48. package/dist/copper6sspBidAdapter.js +1 -0
  49. package/dist/cpmstarBidAdapter.js +1 -1
  50. package/dist/craftBidAdapter.js +1 -1
  51. package/dist/criteoBidAdapter.js +1 -1
  52. package/dist/cwireBidAdapter.js +1 -1
  53. package/dist/dailymotionBidAdapter.js +1 -1
  54. package/dist/deltaprojectsBidAdapter.js +1 -1
  55. package/dist/dependencies.json +51 -13
  56. package/dist/dianomiBidAdapter.js +1 -1
  57. package/dist/dspxBidAdapter.js +1 -1
  58. package/dist/dxkultureBidAdapter.js +1 -1
  59. package/dist/eplanningBidAdapter.js +1 -1
  60. package/dist/euidIdSystem.js +1 -1
  61. package/dist/exadsBidAdapter.js +1 -1
  62. package/dist/feedadBidAdapter.js +1 -1
  63. package/dist/finativeBidAdapter.js +1 -1
  64. package/dist/freewheel-sspBidAdapter.js +1 -1
  65. package/dist/gmosspBidAdapter.js +1 -1
  66. package/dist/goldbachBidAdapter.js +1 -1
  67. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  68. package/dist/greenbidsRtdProvider.js +1 -1
  69. package/dist/gridBidAdapter.js +1 -1
  70. package/dist/gumgumBidAdapter.js +1 -1
  71. package/dist/h12mediaBidAdapter.js +1 -1
  72. package/dist/hypelabBidAdapter.js +1 -1
  73. package/dist/id5AnalyticsAdapter.js +1 -1
  74. package/dist/id5IdSystem.js +1 -1
  75. package/dist/illuminBidAdapter.js +1 -1
  76. package/dist/imdsBidAdapter.js +1 -1
  77. package/dist/improvedigitalBidAdapter.js +1 -1
  78. package/dist/insticatorBidAdapter.js +1 -1
  79. package/dist/intentIqIdSystem.js +1 -1
  80. package/dist/ixBidAdapter.js +1 -1
  81. package/dist/jixieBidAdapter.js +1 -1
  82. package/dist/justpremiumBidAdapter.js +1 -1
  83. package/dist/kargoBidAdapter.js +1 -1
  84. package/dist/kimberliteBidAdapter.js +1 -1
  85. package/dist/konduitAnalyticsAdapter.js +1 -1
  86. package/dist/kueezBidAdapter.js +1 -1
  87. package/dist/kueezRtbBidAdapter.js +1 -1
  88. package/dist/lassoBidAdapter.js +1 -1
  89. package/dist/lifestreetBidAdapter.js +1 -1
  90. package/dist/liveIntentIdSystem.js +1 -1
  91. package/dist/logicadBidAdapter.js +1 -1
  92. package/dist/loglyliftBidAdapter.js +1 -1
  93. package/dist/luceadBidAdapter.js +1 -1
  94. package/dist/luponmediaBidAdapter.js +1 -1
  95. package/dist/mabidderBidAdapter.js +1 -1
  96. package/dist/magniteAnalyticsAdapter.js +1 -1
  97. package/dist/malltvAnalyticsAdapter.js +1 -1
  98. package/dist/marsmediaBidAdapter.js +1 -1
  99. package/dist/mediafuseBidAdapter.js +1 -1
  100. package/dist/medianetAnalyticsAdapter.js +1 -1
  101. package/dist/medianetBidAdapter.js +1 -1
  102. package/dist/mediasquareBidAdapter.js +1 -1
  103. package/dist/mgidBidAdapter.js +1 -1
  104. package/dist/minutemediaBidAdapter.js +1 -1
  105. package/dist/missenaBidAdapter.js +1 -1
  106. package/dist/nexx360BidAdapter.js +1 -1
  107. package/dist/nobidAnalyticsAdapter.js +1 -1
  108. package/dist/nobidBidAdapter.js +1 -1
  109. package/dist/not-for-prod/prebid.js +184 -178
  110. package/dist/oguryBidAdapter.js +1 -1
  111. package/dist/onetagBidAdapter.js +1 -1
  112. package/dist/ooloAnalyticsAdapter.js +1 -1
  113. package/dist/openwebBidAdapter.js +1 -1
  114. package/dist/openxBidAdapter.js +1 -1
  115. package/dist/optidigitalBidAdapter.js +1 -1
  116. package/dist/orakiBidAdapter.js +1 -0
  117. package/dist/orbidderBidAdapter.js +1 -1
  118. package/dist/outbrainBidAdapter.js +1 -1
  119. package/dist/ozoneBidAdapter.js +1 -1
  120. package/dist/pairIdSystem.js +1 -1
  121. package/dist/pixfutureBidAdapter.js +1 -1
  122. package/dist/prebidServerBidAdapter.js +1 -1
  123. package/dist/processResponse.js +1 -0
  124. package/dist/publinkIdSystem.js +1 -1
  125. package/dist/publirBidAdapter.js +1 -1
  126. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  127. package/dist/pubmaticBidAdapter.js +1 -1
  128. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  129. package/dist/pxyzBidAdapter.js +1 -1
  130. package/dist/quantcastBidAdapter.js +1 -1
  131. package/dist/readpeakBidAdapter.js +1 -1
  132. package/dist/relaidoBidAdapter.js +1 -1
  133. package/dist/retailspotBidAdapter.js +1 -1
  134. package/dist/rhythmoneBidAdapter.js +1 -1
  135. package/dist/riseBidAdapter.js +1 -1
  136. package/dist/rubiconBidAdapter.js +1 -1
  137. package/dist/seedingAllianceBidAdapter.js +1 -1
  138. package/dist/seedtagBidAdapter.js +1 -1
  139. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  140. package/dist/sharethroughBidAdapter.js +1 -1
  141. package/dist/shinezBidAdapter.js +1 -1
  142. package/dist/shinezRtbBidAdapter.js +1 -1
  143. package/dist/smaatoBidAdapter.js +1 -1
  144. package/dist/smartadserverBidAdapter.js +1 -1
  145. package/dist/smartxBidAdapter.js +1 -1
  146. package/dist/smartyadsBidAdapter.js +1 -1
  147. package/dist/smartyadsUtils.js +1 -0
  148. package/dist/smilewantedBidAdapter.js +1 -1
  149. package/dist/snigelBidAdapter.js +1 -1
  150. package/dist/sonobiBidAdapter.js +1 -1
  151. package/dist/sovrnBidAdapter.js +1 -1
  152. package/dist/sspBCBidAdapter.js +1 -1
  153. package/dist/stnBidAdapter.js +1 -1
  154. package/dist/stvBidAdapter.js +1 -1
  155. package/dist/sublimeBidAdapter.js +1 -1
  156. package/dist/taboolaBidAdapter.js +1 -1
  157. package/dist/tagorasBidAdapter.js +1 -1
  158. package/dist/tappxBidAdapter.js +1 -1
  159. package/dist/targetVideoBidAdapter.js +1 -1
  160. package/dist/teadsBidAdapter.js +1 -1
  161. package/dist/terceptAnalyticsAdapter.js +1 -1
  162. package/dist/themoneytizerBidAdapter.js +1 -1
  163. package/dist/trionBidAdapter.js +1 -1
  164. package/dist/tripleliftBidAdapter.js +1 -1
  165. package/dist/ttdBidAdapter.js +1 -1
  166. package/dist/twistDigitalBidAdapter.js +1 -1
  167. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  168. package/dist/uid2IdSystem.js +1 -1
  169. package/dist/underdogmediaBidAdapter.js +1 -1
  170. package/dist/undertoneBidAdapter.js +1 -1
  171. package/dist/unrulyBidAdapter.js +1 -1
  172. package/dist/userId.js +1 -1
  173. package/dist/viantOrtbBidAdapter.js +1 -1
  174. package/dist/vidazooBidAdapter.js +1 -1
  175. package/dist/vidazooUtils.js +1 -0
  176. package/dist/videobyteBidAdapter.js +1 -1
  177. package/dist/visxBidAdapter.js +1 -1
  178. package/dist/vuukleBidAdapter.js +1 -1
  179. package/dist/widespaceBidAdapter.js +1 -1
  180. package/dist/winrBidAdapter.js +1 -1
  181. package/dist/yahooAdsBidAdapter.js +1 -1
  182. package/dist/yieldmoBidAdapter.js +1 -1
  183. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  184. package/dist/yuktamediaAnalyticsAdapter.js +1 -1
  185. package/dist/zeta_global_sspBidAdapter.js +1 -1
  186. package/integrationExamples/gpt/x-domain/creative.html +1 -1
  187. package/libraries/consentManagement/cmUtils.js +38 -0
  188. package/libraries/processResponse/index.js +12 -0
  189. package/libraries/smartyadsUtils/getAdUrlByRegion.js +32 -0
  190. package/libraries/vidazooUtils/bidderUtils.js +480 -0
  191. package/libraries/vidazooUtils/constants.js +7 -0
  192. package/modules/adagioRtdProvider.js +9 -7
  193. package/modules/addefendBidAdapter.js +1 -2
  194. package/modules/adfBidAdapter.js +1 -10
  195. package/modules/adlooxRtdProvider.js +1 -1
  196. package/modules/adnuntiusBidAdapter.js +1 -0
  197. package/modules/adxcgAnalyticsAdapter.js +1 -2
  198. package/modules/carodaBidAdapter.js +3 -8
  199. package/modules/codefuelBidAdapter.js +1 -10
  200. package/modules/consentManagementGpp.js +2 -38
  201. package/modules/consentManagementTcf.js +7 -38
  202. package/modules/conversantAnalyticsAdapter.js +1 -2
  203. package/modules/copper6sspBidAdapter.js +19 -0
  204. package/modules/copper6sspBidAdapter.md +79 -0
  205. package/modules/cpmstarBidAdapter.js +52 -36
  206. package/modules/cpmstarBidAdapter.md +1 -4
  207. package/modules/criteoBidAdapter.js +10 -3
  208. package/modules/dailymotionBidAdapter.js +1 -1
  209. package/modules/deltaprojectsBidAdapter.js +2 -11
  210. package/modules/dianomiBidAdapter.js +1 -9
  211. package/modules/finativeBidAdapter.js +1 -10
  212. package/modules/gridBidAdapter.js +2 -12
  213. package/modules/id5AnalyticsAdapter.js +1 -2
  214. package/modules/illuminBidAdapter.js +9 -304
  215. package/modules/intentIqIdSystem.js +408 -50
  216. package/modules/intentIqIdSystem.md +92 -0
  217. package/modules/kueezRtbBidAdapter.js +17 -312
  218. package/modules/liveIntentIdSystem.js +2 -2
  219. package/modules/luponmediaBidAdapter.js +4 -10
  220. package/modules/mabidderBidAdapter.js +1 -2
  221. package/modules/medianetAnalyticsAdapter.js +1 -2
  222. package/modules/medianetBidAdapter.js +1 -1
  223. package/modules/mgidBidAdapter.js +1 -10
  224. package/modules/orakiBidAdapter.js +19 -0
  225. package/modules/orakiBidAdapter.md +79 -0
  226. package/modules/orbidderBidAdapter.js +4 -2
  227. package/modules/outbrainBidAdapter.js +8 -43
  228. package/modules/ozoneBidAdapter.js +9 -7
  229. package/modules/pairIdSystem.js +27 -10
  230. package/modules/pixfutureBidAdapter.js +1 -2
  231. package/modules/prebidServerBidAdapter/index.js +1 -1
  232. package/modules/seedtagBidAdapter.js +4 -0
  233. package/modules/shinezRtbBidAdapter.js +12 -304
  234. package/modules/smartadserverBidAdapter.js +3 -0
  235. package/modules/smartyadsBidAdapter.js +6 -110
  236. package/modules/snigelBidAdapter.js +1 -2
  237. package/modules/tagorasBidAdapter.js +13 -316
  238. package/modules/tappxBidAdapter.js +1 -2
  239. package/modules/terceptAnalyticsAdapter.js +1 -2
  240. package/modules/twistDigitalBidAdapter.js +9 -433
  241. package/modules/userId/index.js +31 -21
  242. package/modules/viantOrtbBidAdapter.js +20 -0
  243. package/modules/vidazooBidAdapter.js +26 -468
  244. package/modules/visxBidAdapter.js +27 -29
  245. package/modules/yahooAdsBidAdapter.js +4 -1
  246. package/modules/yuktamediaAnalyticsAdapter.js +1 -2
  247. package/modules/zeta_global_sspBidAdapter.js +2 -2
  248. package/package.json +1 -1
  249. package/src/adRendering.js +25 -2
  250. package/src/constants.js +2 -0
  251. package/src/prebid.js +2 -1
  252. package/src/utils.js +19 -1
  253. package/test/spec/creative/crossDomainCreative_spec.js +38 -2
  254. package/test/spec/fpd/gdpr_spec.js +24 -2
  255. package/test/spec/libraries/processResponse_spec.js +60 -0
  256. package/test/spec/modules/adagioRtdProvider_spec.js +12 -0
  257. package/test/spec/modules/adnuntiusBidAdapter_spec.js +6 -3
  258. package/test/spec/modules/conversantAnalyticsAdapter_spec.js +1 -1
  259. package/test/spec/modules/copper6sspBidAdapter_spec.js +514 -0
  260. package/test/spec/modules/cpmstarBidAdapter_spec.js +1 -1
  261. package/test/spec/modules/dailymotionBidAdapter_spec.js +18 -14
  262. package/test/spec/modules/illuminBidAdapter_spec.js +26 -13
  263. package/test/spec/modules/intentIqIdSystem_spec.js +264 -36
  264. package/test/spec/modules/kueezRtbBidAdapter_spec.js +26 -15
  265. package/test/spec/modules/orakiBidAdapter_spec.js +510 -0
  266. package/test/spec/modules/outbrainBidAdapter_spec.js +32 -1
  267. package/test/spec/modules/seedtagBidAdapter_spec.js +27 -0
  268. package/test/spec/modules/shinezRtbBidAdapter_spec.js +26 -14
  269. package/test/spec/modules/smartadserverBidAdapter_spec.js +7 -0
  270. package/test/spec/modules/smartyadsBidAdapter_spec.js +6 -83
  271. package/test/spec/modules/tagorasBidAdapter_spec.js +26 -15
  272. package/test/spec/modules/twistDigitalBidAdapter_spec.js +19 -22
  273. package/test/spec/modules/userId_spec.js +86 -47
  274. package/test/spec/modules/viantOrtbBidAdapter_spec.js +87 -6
  275. package/test/spec/modules/vidazooBidAdapter_spec.js +21 -23
  276. package/test/spec/modules/visxBidAdapter_spec.js +180 -0
  277. package/test/spec/modules/yahooAdsBidAdapter_spec.js +1 -1
  278. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +11 -0
  279. package/test/spec/unit/pbjs_api_spec.js +6 -1
@@ -1,8 +1,9 @@
1
- import { spec, converter } from 'modules/viantOrtbBidAdapter.js';
1
+ import {spec, converter} from 'modules/viantOrtbBidAdapter.js';
2
2
  import {assert, expect} from 'chai';
3
- import { deepClone } from '../../../src/utils';
3
+ import {deepClone} from '../../../src/utils';
4
4
  import {buildWindowTree} from '../../helpers/refererDetectionHelper';
5
5
  import {detectReferer} from '../../../src/refererDetection';
6
+
6
7
  describe('viantOrtbBidAdapter', function () {
7
8
  function testBuildRequests(bidRequests, bidderRequestBase) {
8
9
  let clonedBidderRequest = deepClone(bidderRequestBase);
@@ -10,7 +11,8 @@ describe('viantOrtbBidAdapter', function () {
10
11
  let requests = spec.buildRequests(bidRequests, clonedBidderRequest);
11
12
  return requests
12
13
  }
13
- describe('isBidRequestValid', function() {
14
+
15
+ describe('isBidRequestValid', function () {
14
16
  function makeBid() {
15
17
  return {
16
18
  'bidder': 'viant',
@@ -46,9 +48,7 @@ describe('viantOrtbBidAdapter', function () {
46
48
  it('should return true if placementId is not passed ', function () {
47
49
  let bid = makeBid();
48
50
  delete bid.params.placementId;
49
- bid.ortb2Imp = {
50
-
51
- }
51
+ bid.ortb2Imp = {}
52
52
  expect(spec.isBidRequestValid(bid)).to.equal(true);
53
53
  });
54
54
 
@@ -98,6 +98,7 @@ describe('viantOrtbBidAdapter', function () {
98
98
  'transactionId': '4008d88a-8137-410b-aa35-fbfdabcb478e'
99
99
  }
100
100
  }
101
+
101
102
  it('should return true when required params found', function () {
102
103
  expect(spec.isBidRequestValid(makeBid())).to.equal(true);
103
104
  });
@@ -141,6 +142,7 @@ describe('viantOrtbBidAdapter', function () {
141
142
  'transactionId': '4008d88a-8137-410b-aa35-fbfdabcb478e'
142
143
  }
143
144
  }
145
+
144
146
  it('should return true when required params found', function () {
145
147
  expect(spec.isBidRequestValid(makeBid())).to.equal(true);
146
148
  });
@@ -180,6 +182,57 @@ describe('viantOrtbBidAdapter', function () {
180
182
  'src': 'client',
181
183
  'bidRequestsCount': 1
182
184
  }];
185
+ const basePMPDealsBidRequests = [{
186
+ 'bidder': 'viant',
187
+ 'params': {
188
+ 'publisherId': '464',
189
+ 'placementId': '1'
190
+ },
191
+ 'ortb2Imp': {
192
+ 'pmp': {
193
+ 'private_auction': 0,
194
+ 'deals': [
195
+ {
196
+ 'id': '1234567',
197
+ 'at': 3,
198
+ 'bidfloor': 25,
199
+ 'bidfloorcur': 'USD',
200
+ 'ext': {
201
+ 'must_bid': 1,
202
+ 'private_auction': 1
203
+ }
204
+ },
205
+ {
206
+ 'id': '1234568',
207
+ 'at': 3,
208
+ 'bidfloor': 25,
209
+ 'bidfloorcur': 'USD',
210
+ 'ext': {
211
+ 'must_bid': 0
212
+ }
213
+ }
214
+ ]
215
+ },
216
+ },
217
+ 'mediaTypes': {
218
+ 'banner': {
219
+ 'sizes': [[728, 90]]
220
+ }
221
+ },
222
+ 'gdprConsent': {
223
+ 'consentString': 'consentString',
224
+ 'gdprApplies': true,
225
+ },
226
+ 'uspConsent': '1YYY',
227
+ 'sizes': [[728, 90]],
228
+ 'transactionId': '1111474f-58b1-4368-b812-84f8c937a099',
229
+ 'adUnitCode': 'div-gpt-ad-1460505748561-0',
230
+ 'bidId': '243310435309b5',
231
+ 'bidderRequestId': '18084284054531',
232
+ 'auctionId': 'e7b34fa3-8654-424e-8c49-03e509e53d8c',
233
+ 'src': 'client',
234
+ 'bidRequestsCount': 1
235
+ }];
183
236
 
184
237
  const testWindow = buildWindowTree(['https://www.example.com/test', 'https://www.example.com/other/page', 'https://www.example.com/third/page'], 'https://othersite.com/', 'https://example.com/canonical/page');
185
238
  const baseBidderRequestReferer = detectReferer(testWindow)();
@@ -236,6 +289,34 @@ describe('viantOrtbBidAdapter', function () {
236
289
  const requestBody = testBuildRequests(clonedBannerRequests, baseBidderRequest)[0].data;
237
290
  expect(requestBody.imp[0].banner.pos).to.equal(1);
238
291
  });
292
+ it('includes the deals in the bid request', function () {
293
+ const requestBody = testBuildRequests(basePMPDealsBidRequests, baseBidderRequest)[0].data;
294
+ expect(requestBody.imp[0].pmp).to.be.not.null;
295
+ expect(requestBody.imp[0].pmp).to.deep.equal({
296
+ 'private_auction': 0,
297
+ 'deals': [
298
+ {
299
+ 'id': '1234567',
300
+ 'at': 3,
301
+ 'bidfloor': 25,
302
+ 'bidfloorcur': 'USD',
303
+ 'ext': {
304
+ 'must_bid': 1,
305
+ 'private_auction': 1
306
+ }
307
+ },
308
+ {
309
+ 'id': '1234568',
310
+ 'at': 3,
311
+ 'bidfloor': 25,
312
+ 'bidfloorcur': 'USD',
313
+ 'ext': {
314
+ 'must_bid': 0
315
+ }
316
+ }
317
+ ]
318
+ });
319
+ });
239
320
  });
240
321
 
241
322
  if (FEATURES.VIDEO) {
@@ -1,7 +1,11 @@
1
1
  import {expect} from 'chai';
2
2
  import {
3
3
  spec as adapter,
4
+ storage,
4
5
  createDomain,
6
+ webSessionId
7
+ } from 'modules/vidazooBidAdapter.js';
8
+ import {
5
9
  hashCode,
6
10
  extractPID,
7
11
  extractCID,
@@ -11,9 +15,9 @@ import {
11
15
  tryParseJSON,
12
16
  getUniqueDealId,
13
17
  getNextDealId,
14
- getVidazooSessionId,
15
- webSessionId
16
- } from 'modules/vidazooBidAdapter.js';
18
+ getTopWindowQueryParams,
19
+ getVidazooSessionId
20
+ } from 'libraries/vidazooUtils/bidderUtils.js'
17
21
  import * as utils from 'src/utils.js';
18
22
  import {version} from 'package.json';
19
23
  import {useFakeTimers} from 'sinon';
@@ -205,15 +209,6 @@ const REQUEST = {
205
209
  }
206
210
  };
207
211
 
208
- function getTopWindowQueryParams() {
209
- try {
210
- const parsedUrl = utils.parseUrl(window.top.document.URL, {decodeSearchAsString: true});
211
- return parsedUrl.search;
212
- } catch (e) {
213
- return '';
214
- }
215
- }
216
-
217
212
  describe('VidazooBidAdapter', function () {
218
213
  describe('validtae spec', function () {
219
214
  it('exists and is a function', function () {
@@ -317,6 +312,7 @@ describe('VidazooBidAdapter', function () {
317
312
  gpid: '',
318
313
  prebidVersion: version,
319
314
  ptrace: '1000',
315
+ vdzhum: '1000',
320
316
  publisherId: '59ac17c192832d0011283fe3',
321
317
  url: 'https%3A%2F%2Fwww.greatsite.com',
322
318
  referrer: 'https://www.somereferrer.com',
@@ -436,6 +432,7 @@ describe('VidazooBidAdapter', function () {
436
432
  prebidVersion: version,
437
433
  schain: BID.schain,
438
434
  ptrace: '1000',
435
+ vdzhum: '1000',
439
436
  res: `${window.top.screen.width}x${window.top.screen.height}`,
440
437
  mediaTypes: [BANNER],
441
438
  uqs: getTopWindowQueryParams(),
@@ -526,6 +523,7 @@ describe('VidazooBidAdapter', function () {
526
523
  prebidVersion: version,
527
524
  schain: BID.schain,
528
525
  ptrace: '1000',
526
+ vdzhum: '1000',
529
527
  res: `${window.top.screen.width}x${window.top.screen.height}`,
530
528
  mediaTypes: [BANNER],
531
529
  uqs: getTopWindowQueryParams(),
@@ -800,14 +798,14 @@ describe('VidazooBidAdapter', function () {
800
798
  $$PREBID_GLOBAL$$.bidderSettings = {};
801
799
  });
802
800
  it('should get undefined vidazoo session id', function () {
803
- const sessionId = getVidazooSessionId();
801
+ const sessionId = getVidazooSessionId(storage);
804
802
  expect(sessionId).to.be.empty;
805
803
  });
806
804
 
807
805
  it('should get vidazoo session id from storage', function () {
808
806
  const vidSid = '1234-5678';
809
807
  window.localStorage.setItem('vidSid', vidSid);
810
- const sessionId = getVidazooSessionId();
808
+ const sessionId = getVidazooSessionId(storage);
811
809
  expect(sessionId).to.be.equal(vidSid);
812
810
  });
813
811
  });
@@ -826,15 +824,15 @@ describe('VidazooBidAdapter', function () {
826
824
  const key = 'myDealKey';
827
825
 
828
826
  it('should get the next deal id', function () {
829
- const dealId = getNextDealId(key);
830
- const nextDealId = getNextDealId(key);
827
+ const dealId = getNextDealId(storage, key);
828
+ const nextDealId = getNextDealId(storage, key);
831
829
  expect(dealId).to.be.equal(1);
832
830
  expect(nextDealId).to.be.equal(2);
833
831
  });
834
832
 
835
833
  it('should get the first deal id on expiration', function (done) {
836
834
  setTimeout(function () {
837
- const dealId = getNextDealId(key, 100);
835
+ const dealId = getNextDealId(storage, key, 100);
838
836
  expect(dealId).to.be.equal(1);
839
837
  done();
840
838
  }, 200);
@@ -855,13 +853,13 @@ describe('VidazooBidAdapter', function () {
855
853
  const key = 'myKey';
856
854
  let uniqueDealId;
857
855
  beforeEach(() => {
858
- uniqueDealId = getUniqueDealId(key, 0);
856
+ uniqueDealId = getUniqueDealId(storage, key, 0);
859
857
  })
860
858
 
861
859
  it('should get current unique deal id', function (done) {
862
860
  // waiting some time so `now` will become past
863
861
  setTimeout(() => {
864
- const current = getUniqueDealId(key);
862
+ const current = getUniqueDealId(storage, key);
865
863
  expect(current).to.be.equal(uniqueDealId);
866
864
  done();
867
865
  }, 200);
@@ -869,7 +867,7 @@ describe('VidazooBidAdapter', function () {
869
867
 
870
868
  it('should get new unique deal id on expiration', function (done) {
871
869
  setTimeout(() => {
872
- const current = getUniqueDealId(key, 100);
870
+ const current = getUniqueDealId(storage, key, 100);
873
871
  expect(current).to.not.be.equal(uniqueDealId);
874
872
  done();
875
873
  }, 200)
@@ -893,8 +891,8 @@ describe('VidazooBidAdapter', function () {
893
891
  shouldAdvanceTime: true,
894
892
  now
895
893
  });
896
- setStorageItem('myKey', 2020);
897
- const {value, created} = getStorageItem('myKey');
894
+ setStorageItem(storage, 'myKey', 2020);
895
+ const {value, created} = getStorageItem(storage, 'myKey');
898
896
  expect(created).to.be.equal(now);
899
897
  expect(value).to.be.equal(2020);
900
898
  expect(typeof value).to.be.equal('number');
@@ -905,7 +903,7 @@ describe('VidazooBidAdapter', function () {
905
903
  it('should get external stored value', function () {
906
904
  const value = 'superman'
907
905
  window.localStorage.setItem('myExternalKey', value);
908
- const item = getStorageItem('myExternalKey');
906
+ const item = getStorageItem(storage, 'myExternalKey');
909
907
  expect(item).to.be.equal(value);
910
908
  });
911
909
 
@@ -4,6 +4,7 @@ import { config } from 'src/config.js';
4
4
  import { newBidder } from 'src/adapters/bidderFactory.js';
5
5
  import * as utils from 'src/utils.js';
6
6
  import { makeSlot } from '../integration/faker/googletag.js';
7
+ import { mergeDeep } from '../../../src/utils.js';
7
8
 
8
9
  describe('VisxAdapter', function () {
9
10
  const adapter = newBidder(spec);
@@ -2161,4 +2162,183 @@ describe('VisxAdapter', function () {
2161
2162
  expect(request.data.user.ext.vads).to.be.a('string');
2162
2163
  });
2163
2164
  });
2165
+
2166
+ describe('ortb2 data', function () {
2167
+ const bidRequests = [
2168
+ {
2169
+ 'bidder': 'visx',
2170
+ 'params': {
2171
+ 'uid': 903535
2172
+ },
2173
+ 'adUnitCode': 'adunit-code-1',
2174
+ 'sizes': [[300, 250], [300, 600]],
2175
+ 'bidId': '30b31c1838de1e',
2176
+ 'bidderRequestId': '22edbae2733bf6',
2177
+ 'auctionId': '1d1a030790a475'
2178
+ }
2179
+ ];
2180
+ const bidderRequest = {
2181
+ timeout: 3000,
2182
+ refererInfo: {
2183
+ page: 'https://example.com'
2184
+ },
2185
+ 'ortb2': {
2186
+ 'device': {
2187
+ 'w': 1259,
2188
+ 'h': 934,
2189
+ 'dnt': 0,
2190
+ 'ua': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
2191
+ 'language': 'tr',
2192
+ 'sua': {
2193
+ 'source': 1,
2194
+ 'platform': {
2195
+ 'brand': 'macOS'
2196
+ },
2197
+ 'browsers': [
2198
+ {
2199
+ 'brand': 'Chromium',
2200
+ 'version': [ '124' ]
2201
+ },
2202
+ {
2203
+ 'brand': 'Google Chrome',
2204
+ 'version': [ '124' ]
2205
+ },
2206
+ {
2207
+ 'brand': 'Not-A.Brand',
2208
+ 'version': [ '99' ]
2209
+ }
2210
+ ],
2211
+ 'mobile': 0
2212
+ },
2213
+ 'ext': {
2214
+ 'cdep': 'treatment_1.1'
2215
+ }
2216
+ },
2217
+ 'site': {
2218
+ 'domain': 'localhost:9999',
2219
+ 'publisher': {
2220
+ 'domain': 'localhost:9999'
2221
+ },
2222
+ 'page': 'http://localhost:9999/integrationExamples/gpt/hello_world.html'
2223
+ },
2224
+ 'user': {
2225
+ 'keywords': 'x,y',
2226
+ 'data': [
2227
+ {
2228
+ 'name': 'exampleprovider.de',
2229
+ 'ext': {
2230
+ 'segtax': 5
2231
+ },
2232
+ 'segment': [
2233
+ {
2234
+ 'id': '1'
2235
+ }
2236
+ ]
2237
+ },
2238
+ {
2239
+ 'ext': {
2240
+ 'segtax': 601,
2241
+ 'segclass': '5'
2242
+ },
2243
+ 'segment': [
2244
+ {
2245
+ 'id': '140'
2246
+ }
2247
+ ],
2248
+ 'name': 'pa.openx.net'
2249
+ },
2250
+ {
2251
+ 'ext': {
2252
+ 'segtax': 601,
2253
+ 'segclass': '5'
2254
+ },
2255
+ 'segment': [
2256
+ {
2257
+ 'id': '140'
2258
+ }
2259
+ ],
2260
+ 'name': 'ads.pubmatic.com'
2261
+ }
2262
+ ],
2263
+ 'ext': {
2264
+ 'data': {
2265
+ 'registered': true,
2266
+ 'interests': [
2267
+ 'ads'
2268
+ ]
2269
+ }
2270
+ }
2271
+ }
2272
+ }
2273
+ };
2274
+
2275
+ it('should pass interests if ortb2 has interests in user data', function () {
2276
+ const request = spec.buildRequests(bidRequests, bidderRequest);
2277
+ expect(request.data.user.ext.data.interests).not.to.be.undefined;
2278
+ });
2279
+
2280
+ it('should pass device if ortb2 has device', function () {
2281
+ const request = spec.buildRequests(bidRequests, bidderRequest);
2282
+ expect(request.data.device).not.to.be.undefined;
2283
+ });
2284
+
2285
+ it('should pass site if ortb2 has site', function () {
2286
+ const request = spec.buildRequests(bidRequests, bidderRequest);
2287
+ expect(request.data.site).not.to.be.undefined;
2288
+ });
2289
+
2290
+ it('should merge if user object exists', function () {
2291
+ const user = {
2292
+ 'ext': {
2293
+ 'vads': 'cXaIRA425BmynEN1ratEnc_5e',
2294
+ 'data': {
2295
+ 'registered': true,
2296
+ 'interests': [
2297
+ 'ads'
2298
+ ]
2299
+ }
2300
+ },
2301
+ 'keywords': 'x,y',
2302
+ 'data': [
2303
+ {
2304
+ 'name': 'exampleprovider.de',
2305
+ 'ext': {
2306
+ 'segtax': 5
2307
+ },
2308
+ 'segment': [
2309
+ {
2310
+ 'id': '1'
2311
+ }
2312
+ ]
2313
+ }
2314
+ ]
2315
+ };
2316
+ const userOrtb2 = {
2317
+ 'keywords': 'x,y',
2318
+ 'data': [
2319
+ {
2320
+ 'name': 'exampleprovider.de',
2321
+ 'ext': {
2322
+ 'segtax': 5
2323
+ },
2324
+ 'segment': [
2325
+ {
2326
+ 'id': '1'
2327
+ }
2328
+ ]
2329
+ }
2330
+ ],
2331
+ 'ext': {
2332
+ 'data': {
2333
+ 'registered': true,
2334
+ 'interests': [
2335
+ 'ads'
2336
+ ]
2337
+ }
2338
+ }
2339
+ }
2340
+ const userReq = mergeDeep(user, userOrtb2);
2341
+ expect(userReq.ext.vads).not.to.be.undefined;
2342
+ });
2343
+ });
2164
2344
  });
@@ -193,7 +193,7 @@ describe('Yahoo Advertising Bid Adapter:', () => {
193
193
  });
194
194
 
195
195
  it('should define the correct bidder aliases', () => {
196
- expect(spec.aliases).to.deep.equal(['yahoossp', 'yahooAdvertising']);
196
+ expect(spec.aliases).to.deep.equal([{ 'code': 'yahoossp', 'gvlid': 25 }, { 'code': 'yahooAdvertising', 'gvlid': 25 }]);
197
197
  });
198
198
 
199
199
  it('should define the correct vendor ID', () => {
@@ -132,6 +132,9 @@ describe('Zeta Ssp Bid Adapter', function () {
132
132
  userIdAsEids: eids,
133
133
  timeout: 500,
134
134
  ortb2: {
135
+ site: {
136
+ inventorypartnerdomain: 'disqus.com'
137
+ },
135
138
  device: {
136
139
  sua: {
137
140
  mobile: 1,
@@ -709,4 +712,12 @@ describe('Zeta Ssp Bid Adapter', function () {
709
712
  expect(payload.ext.tags.nullTag).to.be.undefined;
710
713
  expect(payload.ext.tags.complexEmptyTag).to.be.undefined;
711
714
  });
715
+
716
+ it('Test that site payload param are merged from ortb2 and params', function () {
717
+ const request = spec.buildRequests(bannerRequest, bannerRequest[0]);
718
+ const payload = JSON.parse(request.data);
719
+
720
+ expect(payload.site.page).to.eql('zetaglobal.com/page');
721
+ expect(payload.site.inventorypartnerdomain).to.eql('disqus.com');
722
+ });
712
723
  });
@@ -26,7 +26,7 @@ import {enrichFPD} from '../../../src/fpd/enrichment.js';
26
26
  import {mockFpdEnrichments} from '../../helpers/fpd.js';
27
27
  import {generateUUID} from '../../../src/utils.js';
28
28
  import {getCreativeRenderer} from '../../../src/creativeRenderers.js';
29
- import { BID_STATUS, EVENTS, GRANULARITY_OPTIONS, TARGETING_KEYS } from 'src/constants.js';
29
+ import {BID_STATUS, EVENTS, GRANULARITY_OPTIONS, PB_LOCATOR, TARGETING_KEYS} from 'src/constants.js';
30
30
  import {getBidToRender} from '../../../src/adRendering.js';
31
31
 
32
32
  var assert = require('chai').assert;
@@ -236,6 +236,11 @@ describe('Unit: Prebid Module', function () {
236
236
  getBidToRender.getHooks({hook: getBidToRenderHook}).remove();
237
237
  });
238
238
 
239
+ it('should insert a locator frame on the page', () => {
240
+ $$PREBID_GLOBAL$$.processQueue();
241
+ expect(window.frames[PB_LOCATOR]).to.exist;
242
+ })
243
+
239
244
  describe('and global adUnits', () => {
240
245
  const startingAdUnits = [
241
246
  {