prebid.js 7.54.0 → 7.54.2

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 (140) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/adqueryBidAdapter.js +1 -1
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adtrgtmeBidAdapter.js +1 -1
  9. package/dist/adxcgBidAdapter.js +1 -1
  10. package/dist/adyoulikeBidAdapter.js +1 -1
  11. package/dist/ajaBidAdapter.js +1 -1
  12. package/dist/amxBidAdapter.js +1 -1
  13. package/dist/amxIdSystem.js +1 -1
  14. package/dist/appierAnalyticsAdapter.js +1 -1
  15. package/dist/appnexusBidAdapter.js +1 -1
  16. package/dist/asoBidAdapter.js +1 -1
  17. package/dist/axonixBidAdapter.js +1 -1
  18. package/dist/bidglassBidAdapter.js +1 -1
  19. package/dist/big-richmediaBidAdapter.js +1 -1
  20. package/dist/bridgewellBidAdapter.js +1 -1
  21. package/dist/brightMountainMediaBidAdapter.js +1 -1
  22. package/dist/carodaBidAdapter.js +1 -1
  23. package/dist/chtnwBidAdapter.js +1 -1
  24. package/dist/concertBidAdapter.js +1 -1
  25. package/dist/connectadBidAdapter.js +1 -1
  26. package/dist/consumableBidAdapter.js +1 -1
  27. package/dist/conversantAnalyticsAdapter.js +1 -1
  28. package/dist/conversantBidAdapter.js +1 -1
  29. package/dist/craftBidAdapter.js +1 -1
  30. package/dist/criteoBidAdapter.js +1 -1
  31. package/dist/cwireBidAdapter.js +1 -1
  32. package/dist/dspxBidAdapter.js +1 -1
  33. package/dist/eplanningBidAdapter.js +1 -1
  34. package/dist/euidIdSystem.js +1 -1
  35. package/dist/feedadBidAdapter.js +1 -1
  36. package/dist/finativeBidAdapter.js +1 -1
  37. package/dist/freewheel-sspBidAdapter.js +1 -1
  38. package/dist/glimpseBidAdapter.js +1 -1
  39. package/dist/gmosspBidAdapter.js +1 -1
  40. package/dist/goldbachBidAdapter.js +1 -1
  41. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  42. package/dist/greenbidsRtdProvider.js +1 -1
  43. package/dist/gridBidAdapter.js +1 -1
  44. package/dist/gumgumBidAdapter.js +1 -1
  45. package/dist/h12mediaBidAdapter.js +1 -1
  46. package/dist/hypelabBidAdapter.js +1 -1
  47. package/dist/id5IdSystem.js +1 -1
  48. package/dist/improvedigitalBidAdapter.js +1 -1
  49. package/dist/inmarBidAdapter.js +1 -1
  50. package/dist/insticatorBidAdapter.js +1 -1
  51. package/dist/ixBidAdapter.js +1 -1
  52. package/dist/justpremiumBidAdapter.js +1 -1
  53. package/dist/kargoBidAdapter.js +1 -1
  54. package/dist/konduitAnalyticsAdapter.js +1 -1
  55. package/dist/kueezBidAdapter.js +1 -1
  56. package/dist/kueezRtbBidAdapter.js +1 -1
  57. package/dist/kulturemediaBidAdapter.js +1 -1
  58. package/dist/lassoBidAdapter.js +1 -1
  59. package/dist/lifestreetBidAdapter.js +1 -1
  60. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  61. package/dist/logicadBidAdapter.js +1 -1
  62. package/dist/loglyliftBidAdapter.js +1 -1
  63. package/dist/magniteAnalyticsAdapter.js +1 -1
  64. package/dist/malltvAnalyticsAdapter.js +1 -1
  65. package/dist/marsmediaBidAdapter.js +1 -1
  66. package/dist/mediafuseBidAdapter.js +1 -1
  67. package/dist/mediasquareBidAdapter.js +1 -1
  68. package/dist/mgidBidAdapter.js +1 -1
  69. package/dist/minutemediaBidAdapter.js +1 -1
  70. package/dist/minutemediaplusBidAdapter.js +1 -1
  71. package/dist/nexx360BidAdapter.js +1 -1
  72. package/dist/not-for-prod/prebid.js +128 -128
  73. package/dist/oguryBidAdapter.js +1 -1
  74. package/dist/onetagBidAdapter.js +1 -1
  75. package/dist/ooloAnalyticsAdapter.js +1 -1
  76. package/dist/optidigitalBidAdapter.js +1 -1
  77. package/dist/outbrainBidAdapter.js +1 -1
  78. package/dist/oxxionRtdProvider.js +1 -1
  79. package/dist/parrableIdSystem.js +1 -1
  80. package/dist/pixfutureBidAdapter.js +1 -1
  81. package/dist/prebid-core.js +1 -1
  82. package/dist/publinkIdSystem.js +1 -1
  83. package/dist/pubmaticBidAdapter.js +1 -1
  84. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  85. package/dist/pxyzBidAdapter.js +1 -1
  86. package/dist/quantcastBidAdapter.js +1 -1
  87. package/dist/readpeakBidAdapter.js +1 -1
  88. package/dist/relaidoBidAdapter.js +1 -1
  89. package/dist/retailspotBidAdapter.js +1 -1
  90. package/dist/rhythmoneBidAdapter.js +1 -1
  91. package/dist/riseBidAdapter.js +1 -1
  92. package/dist/rubiconAnalyticsAdapter.js +1 -1
  93. package/dist/rubiconBidAdapter.js +1 -1
  94. package/dist/seedingAllianceBidAdapter.js +1 -1
  95. package/dist/seedtagBidAdapter.js +1 -1
  96. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  97. package/dist/sharethroughBidAdapter.js +1 -1
  98. package/dist/shinezBidAdapter.js +1 -1
  99. package/dist/smaatoBidAdapter.js +1 -1
  100. package/dist/smartadserverBidAdapter.js +1 -1
  101. package/dist/smartxBidAdapter.js +1 -1
  102. package/dist/smilewantedBidAdapter.js +1 -1
  103. package/dist/sonobiBidAdapter.js +1 -1
  104. package/dist/sovrnAnalyticsAdapter.js +1 -1
  105. package/dist/sovrnBidAdapter.js +1 -1
  106. package/dist/sspBCBidAdapter.js +1 -1
  107. package/dist/stvBidAdapter.js +1 -1
  108. package/dist/sublimeBidAdapter.js +1 -1
  109. package/dist/synacormediaBidAdapter.js +1 -1
  110. package/dist/targetVideoBidAdapter.js +1 -1
  111. package/dist/teadsBidAdapter.js +1 -1
  112. package/dist/trionBidAdapter.js +1 -1
  113. package/dist/tripleliftBidAdapter.js +1 -1
  114. package/dist/ttdBidAdapter.js +1 -1
  115. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  116. package/dist/uid2IdSystem.js +1 -1
  117. package/dist/underdogmediaBidAdapter.js +1 -1
  118. package/dist/undertoneBidAdapter.js +1 -1
  119. package/dist/vidazooBidAdapter.js +1 -1
  120. package/dist/videobyteBidAdapter.js +1 -1
  121. package/dist/visxBidAdapter.js +1 -1
  122. package/dist/vuukleBidAdapter.js +1 -1
  123. package/dist/widespaceBidAdapter.js +1 -1
  124. package/dist/winrBidAdapter.js +1 -1
  125. package/dist/yahoosspBidAdapter.js +1 -1
  126. package/dist/yieldmoBidAdapter.js +1 -1
  127. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  128. package/modules/adqueryBidAdapter.js +21 -18
  129. package/modules/ixBidAdapter.js +285 -53
  130. package/modules/kargoBidAdapter.js +4 -0
  131. package/modules/mediasquareBidAdapter.js +19 -23
  132. package/modules/oxxionRtdProvider.js +124 -11
  133. package/modules/rubiconBidAdapter.js +13 -1
  134. package/modules/yahoosspBidAdapter.js +8 -7
  135. package/package.json +1 -1
  136. package/test/spec/modules/ixBidAdapter_spec.js +745 -3
  137. package/test/spec/modules/mediasquareBidAdapter_spec.js +3 -0
  138. package/test/spec/modules/oxxionRtdProvider_spec.js +113 -1
  139. package/test/spec/modules/rubiconBidAdapter_spec.js +41 -0
  140. package/test/spec/modules/yahoosspBidAdapter_spec.js +54 -24
@@ -1,10 +1,13 @@
1
1
  import { submodule } from '../src/hook.js'
2
- import { deepAccess, logInfo } from '../src/utils.js'
2
+ import { deepAccess, logInfo, logError } from '../src/utils.js'
3
+ import { ajax } from '../src/ajax.js';
4
+ import adapterManager from '../src/adapterManager.js';
3
5
 
4
6
  const oxxionRtdSearchFor = [ 'adUnitCode', 'auctionId', 'bidder', 'bidderCode', 'bidId', 'cpm', 'creativeId', 'currency', 'width', 'height', 'mediaType', 'netRevenue', 'originalCpm', 'originalCurrency', 'requestId', 'size', 'source', 'status', 'timeToRespond', 'transactionId', 'ttl', 'sizes', 'mediaTypes', 'src', 'userId', 'labelAny', 'adId' ];
5
7
  const LOG_PREFIX = 'oxxionRtdProvider submodule: ';
6
8
 
7
9
  const allAdUnits = [];
10
+ const bidderAliasRegistry = adapterManager.aliasRegistry || {};
8
11
 
9
12
  /** @type {RtdSubmodule} */
10
13
  export const oxxionSubmodule = {
@@ -12,23 +15,56 @@ export const oxxionSubmodule = {
12
15
  init: init,
13
16
  getBidRequestData: getAdUnits,
14
17
  onBidResponseEvent: insertVideoTracking,
18
+ getRequestsList: getRequestsList,
19
+ getFilteredAdUnitsOnBidRates: getFilteredAdUnitsOnBidRates,
15
20
  };
16
21
 
17
22
  function init(config, userConsent) {
18
- if (!config.params || !config.params.domain || !config.params.contexts || !Array.isArray(config.params.contexts) || config.params.contexts.length == 0) {
19
- return false
20
- }
21
- return true;
23
+ if (!config.params || !config.params.domain) { return false }
24
+ if (config.params.contexts && Array.isArray(config.params.contexts) && config.params.contexts.length > 0) { return true; }
25
+ if (typeof config.params.threshold != 'undefined' && typeof config.params.samplingRate == 'number') { return true }
26
+ return false;
22
27
  }
23
28
 
24
29
  function getAdUnits(reqBidsConfigObj, callback, config, userConsent) {
25
- const reqAdUnits = reqBidsConfigObj.adUnits;
26
- if (Array.isArray(reqAdUnits)) {
27
- reqAdUnits.forEach(adunit => {
28
- if (config.params.contexts.includes(deepAccess(adunit, 'mediaTypes.video.context'))) {
29
- allAdUnits.push(adunit);
30
+ logInfo(LOG_PREFIX + 'started with ', config);
31
+ if (typeof config.params.threshold != 'undefined' && typeof config.params.samplingRate == 'number') {
32
+ let filteredBids;
33
+ const requests = getRequestsList(reqBidsConfigObj);
34
+ const gdpr = userConsent && userConsent.gdpr ? userConsent.gdpr.consentString : null;
35
+ const payload = {
36
+ gdpr,
37
+ requests
38
+ };
39
+ const endpoint = 'https://' + config.params.domain + '.oxxion.io/analytics/bid_rate_interests';
40
+ getPromisifiedAjax(endpoint, JSON.stringify(payload), {
41
+ method: 'POST',
42
+ withCredentials: true
43
+ }).then(bidsRateInterests => {
44
+ if (bidsRateInterests.length) {
45
+ [reqBidsConfigObj.adUnits, filteredBids] = getFilteredAdUnitsOnBidRates(bidsRateInterests, reqBidsConfigObj.adUnits, config.params, true);
30
46
  }
31
- });
47
+ if (filteredBids.length > 0) {
48
+ getPromisifiedAjax('https://' + config.params.domain + '.oxxion.io/analytics/request_rejecteds', JSON.stringify({'bids': filteredBids, 'gdpr': gdpr}), {
49
+ method: 'POST',
50
+ withCredentials: true
51
+ });
52
+ }
53
+ if (typeof callback == 'function') { callback(); }
54
+ }).catch(error => logError(LOG_PREFIX, 'bidInterestError', error));
55
+ }
56
+ if (config.params.contexts && Array.isArray(config.params.contexts) && config.params.contexts.length > 0) {
57
+ const reqAdUnits = reqBidsConfigObj.adUnits;
58
+ if (Array.isArray(reqAdUnits)) {
59
+ reqAdUnits.forEach(adunit => {
60
+ if (config.params.contexts.includes(deepAccess(adunit, 'mediaTypes.video.context'))) {
61
+ allAdUnits.push(adunit);
62
+ }
63
+ });
64
+ }
65
+ if (!(typeof config.params.threshold != 'undefined' && typeof config.params.samplingRate == 'number') && typeof callback == 'function') {
66
+ callback();
67
+ }
32
68
  }
33
69
  }
34
70
 
@@ -94,4 +130,81 @@ function getImpUrl(config, data, maxCpm) {
94
130
  return trackingImpUrl + 'cpmIncrement=' + cpmIncrement + '&context=' + context;
95
131
  }
96
132
 
133
+ function getPromisifiedAjax (url, data = {}, options = {}) {
134
+ return new Promise((resolve, reject) => {
135
+ const callbacks = {
136
+ success(responseText, { response }) {
137
+ resolve(JSON.parse(response));
138
+ },
139
+ error(error) {
140
+ reject(error);
141
+ }
142
+ };
143
+ ajax(url, callbacks, data, options);
144
+ })
145
+ }
146
+
147
+ function getFilteredAdUnitsOnBidRates (bidsRateInterests, adUnits, params, useSampling) {
148
+ const { threshold, samplingRate } = params;
149
+ const filteredBids = [];
150
+ // Separate bidsRateInterests in two groups against threshold & samplingRate
151
+ const { interestingBidsRates, uninterestingBidsRates } = bidsRateInterests.reduce((acc, interestingBid) => {
152
+ const isBidRateUpper = typeof threshold == 'number' ? interestingBid.rate === true || interestingBid.rate > threshold : interestingBid.suggestion;
153
+ const isBidInteresting = isBidRateUpper || (getRandomNumber(100) < samplingRate && useSampling);
154
+ const key = isBidInteresting ? 'interestingBidsRates' : 'uninterestingBidsRates';
155
+ acc[key].push(interestingBid);
156
+ return acc;
157
+ }, {
158
+ interestingBidsRates: [],
159
+ uninterestingBidsRates: [] // Do something with later
160
+ });
161
+ logInfo(LOG_PREFIX, 'getFilteredAdUnitsOnBidRates()', interestingBidsRates, uninterestingBidsRates);
162
+ // Filter bids and adUnits against interesting bids rates
163
+ const newAdUnits = adUnits.filter(({ bids = [] }, adUnitIndex) => {
164
+ adUnits[adUnitIndex].bids = bids.filter(bid => {
165
+ if (!params.bidders || params.bidders.includes(bid.bidder)) {
166
+ const index = interestingBidsRates.findIndex(({ id }) => id === bid._id);
167
+ if (index == -1) {
168
+ let tmpBid = bid;
169
+ tmpBid['code'] = adUnits[adUnitIndex].code;
170
+ tmpBid['mediaTypes'] = adUnits[adUnitIndex].mediaTypes;
171
+ tmpBid['originalBidder'] = bidderAliasRegistry[bid.bidder] || bid.bidder;
172
+ if (tmpBid.floorData) {
173
+ delete tmpBid.floorData;
174
+ }
175
+ filteredBids.push(tmpBid);
176
+ }
177
+ delete bid._id;
178
+ return index !== -1;
179
+ } else {
180
+ return true;
181
+ }
182
+ });
183
+ return !!adUnits[adUnitIndex].bids.length;
184
+ });
185
+ return [newAdUnits, filteredBids];
186
+ }
187
+
188
+ function getRandomNumber (max = 10) {
189
+ return Math.round(Math.random() * max);
190
+ }
191
+
192
+ function getRequestsList(reqBidsConfigObj) {
193
+ let count = 0;
194
+ return reqBidsConfigObj.adUnits.flatMap(({
195
+ bids = [],
196
+ mediaTypes = {},
197
+ code = ''
198
+ }) => bids.reduce((acc, { bidder = '', params = {} }, index) => {
199
+ const id = count++;
200
+ bids[index]._id = id;
201
+ return acc.concat({
202
+ id,
203
+ adUnit: code,
204
+ bidder,
205
+ mediaTypes,
206
+ });
207
+ }, []));
208
+ }
209
+
97
210
  submodule('realTimeData', oxxionSubmodule);
@@ -382,6 +382,8 @@ export const spec = {
382
382
  'gdpr',
383
383
  'gdpr_consent',
384
384
  'us_privacy',
385
+ 'gpp',
386
+ 'gpp_sid',
385
387
  'rp_schain',
386
388
  ].concat(Object.keys(params).filter(item => containsUId.test(item)))
387
389
  .concat([
@@ -553,6 +555,11 @@ export const spec = {
553
555
  data['us_privacy'] = encodeURIComponent(bidderRequest.uspConsent);
554
556
  }
555
557
 
558
+ if (bidderRequest.gppConsent?.gppString) {
559
+ data['gpp'] = bidderRequest.gppConsent.gppString;
560
+ data['gpp_sid'] = bidderRequest.gppConsent?.applicableSections?.toString();
561
+ }
562
+
556
563
  data['rp_maxbids'] = bidderRequest.bidLimit || 1;
557
564
 
558
565
  applyFPD(bidRequest, BANNER, data);
@@ -695,7 +702,7 @@ export const spec = {
695
702
  return (adB.cpm || 0.0) - (adA.cpm || 0.0);
696
703
  });
697
704
  },
698
- getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) {
705
+ getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent, gppConsent) {
699
706
  if (!hasSynced && syncOptions.iframeEnabled) {
700
707
  // data is only assigned if params are available to pass to syncEndpoint
701
708
  let params = {};
@@ -713,6 +720,11 @@ export const spec = {
713
720
  params['us_privacy'] = encodeURIComponent(uspConsent);
714
721
  }
715
722
 
723
+ if (gppConsent?.gppString) {
724
+ params['gpp'] = gppConsent.gppString;
725
+ params['gpp_sid'] = gppConsent.applicableSections?.toString();
726
+ }
727
+
716
728
  params = Object.keys(params).length ? `?${formatQS(params)}` : '';
717
729
 
718
730
  hasSynced = true;
@@ -114,11 +114,12 @@ function extractUserSyncUrls(syncOptions, pixels) {
114
114
  */
115
115
  function updateConsentQueryParams(url, consentData) {
116
116
  const parameterMap = {
117
- 'gdpr_consent': consentData.gdpr.consentString,
118
- 'gdpr': consentData.gdpr.gdprApplies ? '1' : '0',
119
- 'us_privacy': consentData.uspConsent,
120
- 'gpp': consentData.gpp.gppString,
121
- 'gpp_sid': consentData.gpp.applicableSections ? consentData.gpp.applicableSections.join(',') : ''
117
+ 'gdpr_consent': consentData.gdpr ? consentData.gdpr.consentString : '',
118
+ 'gdpr': consentData.gdpr && consentData.gdpr.gdprApplies ? '1' : '0',
119
+ 'us_privacy': consentData.uspConsent ? consentData.uspConsent : '',
120
+ 'gpp': consentData.gpp ? consentData.gpp.gppString : '',
121
+ 'gpp_sid': consentData.gpp && Array.isArray(consentData.gpp.applicableSections)
122
+ ? consentData.gpp.applicableSections.join(',') : ''
122
123
  }
123
124
 
124
125
  const existingUrl = new URL(url);
@@ -276,8 +277,8 @@ function generateOpenRtbObject(bidderRequest, bid) {
276
277
  ext: {
277
278
  'us_privacy': bidderRequest.uspConsent ? bidderRequest.uspConsent : '',
278
279
  gdpr: bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies ? 1 : 0,
279
- gpp: bidderRequest.gppConsent.gppString,
280
- gpp_sid: bidderRequest.gppConsent.applicableSections
280
+ gpp: bidderRequest.gppConsent ? bidderRequest.gppConsent.gppString : '',
281
+ gpp_sid: bidderRequest.gppConsent ? bidderRequest.gppConsent.applicableSections : []
281
282
  }
282
283
  },
283
284
  source: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prebid.js",
3
- "version": "7.54.0",
3
+ "version": "7.54.2",
4
4
  "description": "Header Bidding Management Library",
5
5
  "main": "src/prebid.js",
6
6
  "scripts": {