prebid.js 9.53.2 → 9.53.3

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 (196) hide show
  1. package/dist/33acrossAnalyticsAdapter.js +1 -1
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/BTBidAdapter.js +1 -1
  5. package/dist/adagioAnalyticsAdapter.js +1 -1
  6. package/dist/adagioBidAdapter.js +1 -1
  7. package/dist/adagioRtdProvider.js +1 -1
  8. package/dist/adagioUtils.js +1 -1
  9. package/dist/addefendBidAdapter.js +1 -1
  10. package/dist/adgenerationBidAdapter.js +1 -1
  11. package/dist/adlooxRtdProvider.js +1 -1
  12. package/dist/adqueryBidAdapter.js +1 -1
  13. package/dist/adrelevantisBidAdapter.js +1 -1
  14. package/dist/adstirBidAdapter.js +1 -1
  15. package/dist/adtrgtmeBidAdapter.js +1 -1
  16. package/dist/adxcgAnalyticsAdapter.js +1 -1
  17. package/dist/adxcgBidAdapter.js +1 -1
  18. package/dist/adyoulikeBidAdapter.js +1 -1
  19. package/dist/agmaAnalyticsAdapter.js +1 -1
  20. package/dist/ajaBidAdapter.js +1 -1
  21. package/dist/amxBidAdapter.js +1 -1
  22. package/dist/amxIdSystem.js +1 -1
  23. package/dist/aniviewBidAdapter.js +1 -1
  24. package/dist/appierAnalyticsAdapter.js +1 -1
  25. package/dist/appnexusBidAdapter.js +1 -1
  26. package/dist/asoBidAdapter.js +1 -1
  27. package/dist/axonixBidAdapter.js +1 -1
  28. package/dist/beopBidAdapter.js +1 -1
  29. package/dist/bidglassBidAdapter.js +1 -1
  30. package/dist/big-richmediaBidAdapter.js +1 -1
  31. package/dist/bitmediaBidAdapter.js +1 -1
  32. package/dist/bridBidAdapter.js +1 -1
  33. package/dist/bridgeuppBidAdapter.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/concertBidAdapter.js +1 -1
  40. package/dist/connectadBidAdapter.js +1 -1
  41. package/dist/consumableBidAdapter.js +1 -1
  42. package/dist/contxtfulBidAdapter.js +1 -1
  43. package/dist/conversantAnalyticsAdapter.js +1 -1
  44. package/dist/conversantBidAdapter.js +1 -1
  45. package/dist/craftBidAdapter.js +1 -1
  46. package/dist/criteoBidAdapter.js +1 -1
  47. package/dist/cwireBidAdapter.js +1 -1
  48. package/dist/dailymotionBidAdapter.js +1 -1
  49. package/dist/debugging-standalone.js +1 -1
  50. package/dist/dspxBidAdapter.js +1 -1
  51. package/dist/dxkultureBidAdapter.js +1 -1
  52. package/dist/eplanningBidAdapter.js +1 -1
  53. package/dist/equativBidAdapter.js +1 -1
  54. package/dist/eskimiBidAdapter.js +1 -1
  55. package/dist/euidIdSystem.js +1 -1
  56. package/dist/exadsBidAdapter.js +1 -1
  57. package/dist/excoBidAdapter.js +1 -1
  58. package/dist/feedadBidAdapter.js +1 -1
  59. package/dist/finativeBidAdapter.js +1 -1
  60. package/dist/freewheel-sspBidAdapter.js +1 -1
  61. package/dist/gmosspBidAdapter.js +1 -1
  62. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  63. package/dist/greenbidsBidAdapter.js +1 -1
  64. package/dist/greenbidsRtdProvider.js +1 -1
  65. package/dist/gridBidAdapter.js +1 -1
  66. package/dist/gumgumBidAdapter.js +1 -1
  67. package/dist/h12mediaBidAdapter.js +1 -1
  68. package/dist/hypelabBidAdapter.js +1 -1
  69. package/dist/id5AnalyticsAdapter.js +1 -1
  70. package/dist/id5IdSystem.js +1 -1
  71. package/dist/imdsBidAdapter.js +1 -1
  72. package/dist/improvedigitalBidAdapter.js +1 -1
  73. package/dist/inmobiBidAdapter.js +1 -1
  74. package/dist/insticatorBidAdapter.js +1 -1
  75. package/dist/intentIqAnalyticsAdapter.js +1 -1
  76. package/dist/ixBidAdapter.js +1 -1
  77. package/dist/jixieBidAdapter.js +1 -1
  78. package/dist/justpremiumBidAdapter.js +1 -1
  79. package/dist/kargoBidAdapter.js +1 -1
  80. package/dist/kimberliteBidAdapter.js +1 -1
  81. package/dist/konduitAnalyticsAdapter.js +1 -1
  82. package/dist/kueezBidAdapter.js +1 -1
  83. package/dist/lassoBidAdapter.js +1 -1
  84. package/dist/lifestreetBidAdapter.js +1 -1
  85. package/dist/liveIntentId.js +1 -1
  86. package/dist/logicadBidAdapter.js +1 -1
  87. package/dist/loglyliftBidAdapter.js +1 -1
  88. package/dist/luceadBidAdapter.js +1 -1
  89. package/dist/mabidderBidAdapter.js +1 -1
  90. package/dist/madsenseBidAdapter.js +1 -1
  91. package/dist/magniteAnalyticsAdapter.js +1 -1
  92. package/dist/malltvAnalyticsAdapter.js +1 -1
  93. package/dist/marsmediaBidAdapter.js +1 -1
  94. package/dist/mediafuseBidAdapter.js +1 -1
  95. package/dist/medianetBidAdapter.js +1 -1
  96. package/dist/medianetUtils.js +1 -1
  97. package/dist/mediasquareBidAdapter.js +1 -1
  98. package/dist/mgidBidAdapter.js +1 -1
  99. package/dist/missenaBidAdapter.js +1 -1
  100. package/dist/mobilefuseBidAdapter.js +1 -1
  101. package/dist/nextMillenniumBidAdapter.js +1 -1
  102. package/dist/nexx360Utils.js +1 -1
  103. package/dist/nobidAnalyticsAdapter.js +1 -1
  104. package/dist/nobidBidAdapter.js +1 -1
  105. package/dist/nodalsAiRtdProvider.js +1 -1
  106. package/dist/not-for-prod/prebid.js +172 -172
  107. package/dist/objectGuard.js +1 -1
  108. package/dist/oguryBidAdapter.js +1 -1
  109. package/dist/onetagBidAdapter.js +1 -1
  110. package/dist/ooloAnalyticsAdapter.js +1 -1
  111. package/dist/openxBidAdapter.js +1 -1
  112. package/dist/optidigitalBidAdapter.js +1 -1
  113. package/dist/orbidderBidAdapter.js +1 -1
  114. package/dist/outbrainBidAdapter.js +1 -1
  115. package/dist/pixfutureBidAdapter.js +1 -1
  116. package/dist/publinkIdSystem.js +1 -1
  117. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  118. package/dist/pubmaticBidAdapter.js +1 -1
  119. package/dist/pubmaticIdSystem.js +1 -1
  120. package/dist/pubmaticRtdProvider.js +1 -1
  121. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  122. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  123. package/dist/pxyzBidAdapter.js +1 -1
  124. package/dist/quantcastBidAdapter.js +1 -1
  125. package/dist/readpeakBidAdapter.js +1 -1
  126. package/dist/relaidoBidAdapter.js +1 -1
  127. package/dist/retailspotBidAdapter.js +1 -1
  128. package/dist/rhythmoneBidAdapter.js +1 -1
  129. package/dist/riseUtils.js +1 -1
  130. package/dist/rtdModule.js +1 -1
  131. package/dist/rubiconBidAdapter.js +1 -1
  132. package/dist/seedingAllianceBidAdapter.js +1 -1
  133. package/dist/seedtagBidAdapter.js +1 -1
  134. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  135. package/dist/sharethroughBidAdapter.js +1 -1
  136. package/dist/showheroes-bsBidAdapter.js +1 -1
  137. package/dist/smaatoBidAdapter.js +1 -1
  138. package/dist/smartadserverBidAdapter.js +1 -1
  139. package/dist/smartxBidAdapter.js +1 -1
  140. package/dist/smilewantedBidAdapter.js +1 -1
  141. package/dist/snigelBidAdapter.js +1 -1
  142. package/dist/sonobiBidAdapter.js +1 -1
  143. package/dist/sovrnBidAdapter.js +1 -1
  144. package/dist/sparteoBidAdapter.js +1 -1
  145. package/dist/sspBCBidAdapter.js +1 -1
  146. package/dist/stvBidAdapter.js +1 -1
  147. package/dist/sublimeBidAdapter.js +1 -1
  148. package/dist/taboolaBidAdapter.js +1 -1
  149. package/dist/tappxBidAdapter.js +1 -1
  150. package/dist/targetVideoBidAdapter.js +1 -1
  151. package/dist/teadsBidAdapter.js +1 -1
  152. package/dist/terceptAnalyticsAdapter.js +1 -1
  153. package/dist/themoneytizerBidAdapter.js +1 -1
  154. package/dist/trionBidAdapter.js +1 -1
  155. package/dist/tripleliftBidAdapter.js +1 -1
  156. package/dist/ttdBidAdapter.js +1 -1
  157. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  158. package/dist/uid2IdSystem.js +1 -1
  159. package/dist/underdogmediaBidAdapter.js +1 -1
  160. package/dist/undertoneBidAdapter.js +1 -1
  161. package/dist/unrulyBidAdapter.js +1 -1
  162. package/dist/userId.js +1 -1
  163. package/dist/vidazooUtils.js +1 -1
  164. package/dist/videobyteBidAdapter.js +1 -1
  165. package/dist/visxBidAdapter.js +1 -1
  166. package/dist/vuukleBidAdapter.js +1 -1
  167. package/dist/widespaceBidAdapter.js +1 -1
  168. package/dist/winrBidAdapter.js +1 -1
  169. package/dist/yahooAdsBidAdapter.js +1 -1
  170. package/dist/yandexBidAdapter.js +1 -1
  171. package/dist/yieldmoBidAdapter.js +1 -1
  172. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  173. package/libraries/objectGuard/objectGuard.js +149 -48
  174. package/libraries/objectGuard/ortbGuard.js +33 -43
  175. package/modules/adagioAnalyticsAdapter.js +6 -1
  176. package/modules/adagioBidAdapter.js +12 -5
  177. package/modules/adagioRtdProvider.js +41 -35
  178. package/modules/pubmaticAnalyticsAdapter.js +311 -587
  179. package/modules/pubmaticBidAdapter.js +71 -8
  180. package/modules/pubmaticIdSystem.js +4 -4
  181. package/modules/pubmaticRtdProvider.js +12 -60
  182. package/modules/rtdModule/index.js +1 -5
  183. package/modules/ttdBidAdapter.js +0 -5
  184. package/modules/userId/eids.js +1 -1
  185. package/modules/userId/index.js +32 -1
  186. package/package.json +1 -1
  187. package/src/auction.js +3 -0
  188. package/test/spec/activities/objectGuard_spec.js +156 -32
  189. package/test/spec/activities/ortbGuard_spec.js +10 -15
  190. package/test/spec/modules/adagioAnalyticsAdapter_spec.js +94 -24
  191. package/test/spec/modules/adagioRtdProvider_spec.js +17 -17
  192. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +634 -916
  193. package/test/spec/modules/pubmaticBidAdapter_spec.js +260 -1
  194. package/test/spec/modules/pubmaticRtdProvider_spec.js +78 -400
  195. package/test/spec/modules/ttdBidAdapter_spec.js +0 -33
  196. package/test/spec/modules/userId_spec.js +115 -1
@@ -3,9 +3,11 @@ import { spec, cpmAdjustment, addViewabilityToImp } from 'modules/pubmaticBidAda
3
3
  import * as utils from 'src/utils.js';
4
4
  import { bidderSettings } from 'src/bidderSettings.js';
5
5
  import { config } from 'src/config.js';
6
+ import {getGlobal} from '../../../src/prebidGlobal.js';
6
7
 
7
8
  describe('PubMatic adapter', () => {
8
- let firstBid, videoBid, firstResponse, response, videoResponse;
9
+ let firstBid, videoBid, firstResponse, response, videoResponse, firstAliasBid;
10
+ const PUBMATIC_ALIAS_BIDDER = 'pubmaticAlias';
9
11
  const request = {};
10
12
  firstBid = {
11
13
  adUnitCode: 'Div1',
@@ -83,6 +85,89 @@ describe('PubMatic adapter', () => {
83
85
  }
84
86
  }
85
87
  }
88
+ firstAliasBid = {
89
+ adUnitCode: 'Div1',
90
+ bidder: PUBMATIC_ALIAS_BIDDER,
91
+ mediaTypes: {
92
+ banner: {
93
+ sizes: [[728, 90], [160, 600]],
94
+ pos: 1
95
+ }
96
+ },
97
+ params: {
98
+ publisherId: '5670',
99
+ adSlot: '/15671365/DMDemo@300x250:0',
100
+ kadfloor: '1.2',
101
+ pmzoneid: 'aabc, ddef',
102
+ // kadpageurl: 'www.publisher.com',
103
+ yob: '1986',
104
+ gender: 'M',
105
+ lat: '12.3',
106
+ lon: '23.7',
107
+ wiid: '1234567890',
108
+ profId: '100',
109
+ verId: '200',
110
+ currency: 'AUD',
111
+ dctr: 'key1:val1,val2|key2:val1',
112
+ deals: ['deal-1', 'deal-2']
113
+ },
114
+ placementCode: '/19968336/header-bid-tag-1',
115
+ sizes: [
116
+ [300, 250],
117
+ [300, 600],
118
+ ['fluid']
119
+ ],
120
+ bidId: '3736271c3c4b27',
121
+ requestId: '0fb4905b-9456-4152-86be-c6f6d259ba99',
122
+ bidderRequestId: '1c56ad30b9b8ca8',
123
+ ortb2: {
124
+ device: {
125
+ w: 1200,
126
+ h: 1800,
127
+ sua: {},
128
+ language: 'en',
129
+ js: 1,
130
+ connectiontype: 6
131
+ },
132
+ site: {domain: 'ebay.com', page: 'https://ebay.com', publisher: {id: '5670'}},
133
+ source: {},
134
+ user: {
135
+ ext: {
136
+ data: {
137
+ im_segments: ['segment1', 'segment2']
138
+ }
139
+ }
140
+ }
141
+ },
142
+ ortb2Imp: {
143
+ ext: {
144
+ tid: '92489f71-1bf2-49a0-adf9-000cea934729',
145
+ gpid: '/1111/homepage-leftnav',
146
+ data: {
147
+ pbadslot: '/1111/homepage-leftnav',
148
+ adserver: {
149
+ name: 'gam',
150
+ adslot: '/1111/homepage-leftnav'
151
+ },
152
+ customData: {
153
+ id: 'id-1'
154
+ }
155
+ }
156
+ }
157
+ },
158
+ rtd: {
159
+ jwplayer: {
160
+ targeting: {
161
+ content: {
162
+ id: 'jwplayer-content-id'
163
+ },
164
+ segments: [
165
+ 'jwplayer-segment-1', 'jwplayer-segment-2'
166
+ ]
167
+ }
168
+ }
169
+ }
170
+ }
86
171
  videoBid = {
87
172
  'seat': 'seat-id',
88
173
  'ext': {
@@ -143,6 +228,7 @@ describe('PubMatic adapter', () => {
143
228
  }
144
229
  }
145
230
  const validBidRequests = [firstBid];
231
+ const validAliasBidRequests = [firstAliasBid];
146
232
  const bidderRequest = {
147
233
  bids: [firstBid],
148
234
  auctionId: 'ee3074fe-97ce-4681-9235-d7622aede74c',
@@ -167,6 +253,38 @@ describe('PubMatic adapter', () => {
167
253
  },
168
254
  timeout: 2000,
169
255
 
256
+ };
257
+ const bidderAliasRequest = {
258
+ bids: [firstAliasBid],
259
+ auctionId: 'ee3074fe-97ce-4681-9235-d7622aede74c',
260
+ auctionStart: 1725514077194,
261
+ bidderCode: PUBMATIC_ALIAS_BIDDER,
262
+ bidderRequestId: '1c56ad30b9b8ca8',
263
+ refererInfo: {
264
+ page: 'https://ebay.com',
265
+ ref: ''
266
+ },
267
+ ortb2: {
268
+ device: {
269
+ w: 1200,
270
+ h: 1800,
271
+ sua: {},
272
+ language: 'en',
273
+ js: 1,
274
+ connectiontype: 6
275
+ },
276
+ site: {domain: 'ebay.com', page: 'https://ebay.com'},
277
+ source: {},
278
+ user: {
279
+ ext: {
280
+ data: {
281
+ im_segments: ['segment1', 'segment2']
282
+ }
283
+ }
284
+ }
285
+ },
286
+ timeout: 2000,
287
+
170
288
  };
171
289
  let videoBidRequest, videoBidderRequest, utilsLogWarnMock, nativeBidderRequest;
172
290
 
@@ -276,6 +394,13 @@ describe('PubMatic adapter', () => {
276
394
  expect(imp[0]).to.have.property('id').equal('3736271c3c4b27');
277
395
  });
278
396
 
397
+ it('should have build request with alias bidder', () => {
398
+ getGlobal().aliasBidder('pubmatic', PUBMATIC_ALIAS_BIDDER);
399
+ const request = spec.buildRequests(validAliasBidRequests, bidderAliasRequest);
400
+ expect(request.data).to.have.property('ext').to.have.property('wrapper').to.have.property('biddercode');
401
+ expect(request.data.ext.wrapper.biddercode).to.equal(PUBMATIC_ALIAS_BIDDER);
402
+ });
403
+
279
404
  it('should add pmp if deals are present in parameters', () => {
280
405
  const request = spec.buildRequests(validBidRequests, bidderRequest);
281
406
  const { imp } = request?.data;
@@ -345,6 +470,15 @@ describe('PubMatic adapter', () => {
345
470
  expect(imp[0]).to.have.property('ext').to.have.property('pmZoneId');
346
471
  });
347
472
 
473
+ it('should add pbcode in ext with adUnitCode value', () => {
474
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
475
+ const { imp } = request?.data;
476
+ expect(imp).to.be.an('array');
477
+ expect(imp[0]).to.have.property('ext');
478
+ expect(imp[0].ext).to.have.property('pbcode');
479
+ expect(imp[0].ext.pbcode).to.equal(validBidRequests[0].adUnitCode);
480
+ });
481
+
348
482
  it('should add bidfloor if kadfloor is present in parameters', () => {
349
483
  const request = spec.buildRequests(validBidRequests, bidderRequest);
350
484
  const { imp } = request?.data;
@@ -610,6 +744,76 @@ describe('PubMatic adapter', () => {
610
744
  expect(request.data).to.have.property('tmax').to.equal(2000);
611
745
  });
612
746
 
747
+ describe('Gzip Configuration', () => {
748
+ let configStub;
749
+ let bidderConfigStub;
750
+
751
+ beforeEach(() => {
752
+ configStub = sinon.stub(config, 'getConfig');
753
+ bidderConfigStub = sinon.stub(config, 'getBidderConfig');
754
+ });
755
+
756
+ afterEach(() => {
757
+ configStub.restore();
758
+ if (bidderConfigStub && bidderConfigStub.restore) {
759
+ bidderConfigStub.restore();
760
+ }
761
+ });
762
+
763
+ it('should enable gzip compression by default', () => {
764
+ // No specific configuration set, should use default
765
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
766
+ expect(request.options.endpointCompression).to.be.true;
767
+ });
768
+
769
+ it('should respect bidder-specific boolean configuration set via setBidderConfig', () => {
770
+ // Mock bidder-specific config to return false
771
+ bidderConfigStub.returns({
772
+ pubmatic: {
773
+ gzipEnabled: false
774
+ }
775
+ });
776
+
777
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
778
+ expect(request.options.endpointCompression).to.be.false;
779
+ });
780
+
781
+ it('should handle bidder-specific string configuration ("true")', () => {
782
+ bidderConfigStub.returns({
783
+ pubmatic: {
784
+ gzipEnabled: 'true'
785
+ }
786
+ });
787
+
788
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
789
+ expect(request.options.endpointCompression).to.be.true;
790
+ });
791
+
792
+ it('should handle bidder-specific string configuration ("false")', () => {
793
+ bidderConfigStub.returns({
794
+ pubmatic: {
795
+ gzipEnabled: 'false'
796
+ }
797
+ });
798
+
799
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
800
+ expect(request.options.endpointCompression).to.be.false;
801
+ });
802
+
803
+ it('should fall back to default when bidder-specific value is invalid', () => {
804
+ // Mock bidder-specific config to return invalid value
805
+ bidderConfigStub.returns({
806
+ pubmatic: {
807
+ gzipEnabled: 'invalid'
808
+ }
809
+ });
810
+
811
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
812
+ // Should fall back to default (true)
813
+ expect(request.options.endpointCompression).to.be.true;
814
+ });
815
+ });
816
+
613
817
  it('should remove test if pubmaticTest is not set', () => {
614
818
  const request = spec.buildRequests(validBidRequests, bidderRequest);
615
819
  expect(request.data).to.have.property('test').to.equal(undefined);
@@ -639,6 +843,8 @@ describe('PubMatic adapter', () => {
639
843
  expect(request.data).to.have.property('ext').to.have.property('wrapper').to.have.property('wiid');
640
844
  expect(request.data).to.have.property('ext').to.have.property('wrapper').to.have.property('wv');
641
845
  expect(request.data).to.have.property('ext').to.have.property('wrapper').to.have.property('wp');
846
+ expect(request.data).to.have.property('ext').to.have.property('wrapper').to.have.property('biddercode');
847
+ expect(request.data.ext.wrapper.biddercode).to.equal('pubmatic');
642
848
  });
643
849
 
644
850
  it('should have url with post method', () => {
@@ -1389,6 +1595,59 @@ describe('PubMatic adapter', () => {
1389
1595
  expect(request.data.site.page).to.equal('https://example.com/page');
1390
1596
  });
1391
1597
 
1598
+ describe('Impression optimization', () => {
1599
+ it('should add pbcode to impression ext with adUnitCode value', () => {
1600
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
1601
+ const { imp } = request?.data;
1602
+
1603
+ expect(imp).to.be.an('array');
1604
+ expect(imp[0]).to.have.property('ext');
1605
+ expect(imp[0].ext).to.have.property('pbcode');
1606
+ expect(imp[0].ext.pbcode).to.equal(validBidRequests[0].adUnitCode);
1607
+ });
1608
+
1609
+ it('should consolidate impressions with same adUnitCode and media type', () => {
1610
+ // Create two banner bids with the same adUnitCode
1611
+ const bid1 = utils.deepClone(validBidRequests[0]);
1612
+ const bid2 = utils.deepClone(validBidRequests[0]);
1613
+
1614
+ bid1.bidId = 'bid-id-1';
1615
+ bid2.bidId = 'bid-id-2';
1616
+
1617
+ // Set the same adUnitCode and adSlot to ensure they're treated as the same unit
1618
+ const sharedAdUnitCode = 'shared-ad-unit';
1619
+ bid1.adUnitCode = sharedAdUnitCode;
1620
+ bid2.adUnitCode = sharedAdUnitCode;
1621
+ bid1.params.adSlot = 'same_ad_slot';
1622
+ bid2.params.adSlot = 'same_ad_slot';
1623
+
1624
+ bid1.mediaTypes = { banner: { sizes: [[300, 250]] } };
1625
+ bid2.mediaTypes = { banner: { sizes: [[300, 250]] } };
1626
+
1627
+ bid1.params.pmzoneid = 'zone1';
1628
+ bid2.params.pmzoneid = 'zone2';
1629
+
1630
+ const bidRequests = [bid1, bid2];
1631
+ const combinedBidderRequest = utils.deepClone(bidderRequest);
1632
+ combinedBidderRequest.bids = bidRequests;
1633
+
1634
+ const request = spec.buildRequests(bidRequests, combinedBidderRequest);
1635
+ const { imp } = request?.data;
1636
+
1637
+ // Should be consolidated to a single impression
1638
+ expect(imp).to.be.an('array');
1639
+ expect(imp).to.have.lengthOf(1);
1640
+
1641
+ expect(imp[0].ext).to.have.property('pbcode');
1642
+ expect(imp[0].ext.pbcode).to.equal(sharedAdUnitCode);
1643
+
1644
+ if (imp[0].ext.pmZoneId) {
1645
+ expect(typeof imp[0].ext.pmZoneId).to.equal('string');
1646
+ expect(imp[0].ext.pmZoneId).to.equal('zone2');
1647
+ }
1648
+ });
1649
+ });
1650
+
1392
1651
  it('should set site.publisher.id from pubId', () => {
1393
1652
  // Ensure site.publisher structure exists in bidderRequest.ortb2
1394
1653
  const bidderRequestWithPublisher = utils.deepClone(bidderRequest);