prebid.js 7.18.0 → 7.19.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 (197) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/adagioBidAdapter.js +1 -1
  3. package/dist/adbookpspBidAdapter.js +1 -1
  4. package/dist/adfBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/adqueryIdSystem.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/ajaBidAdapter.js +1 -1
  11. package/dist/amxBidAdapter.js +1 -1
  12. package/dist/amxIdSystem.js +1 -1
  13. package/dist/appierAnalyticsAdapter.js +1 -1
  14. package/dist/appnexusBidAdapter.js +1 -1
  15. package/dist/asoBidAdapter.js +1 -1
  16. package/dist/axonixBidAdapter.js +1 -1
  17. package/dist/{andBeyondMediaBidAdapter.js → beyondmediaBidAdapter.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/cleanioRtdProvider.js +1 -1
  24. package/dist/colossussspBidAdapter.js +1 -1
  25. package/dist/concertBidAdapter.js +1 -1
  26. package/dist/connectadBidAdapter.js +1 -1
  27. package/dist/consumableBidAdapter.js +1 -1
  28. package/dist/conversantAnalyticsAdapter.js +1 -0
  29. package/dist/conversantBidAdapter.js +1 -1
  30. package/dist/craftBidAdapter.js +1 -1
  31. package/dist/criteoBidAdapter.js +1 -1
  32. package/dist/debugging-standalone.js +1 -1
  33. package/dist/debugging.js +1 -1
  34. package/dist/dependencies.json +6 -0
  35. package/dist/dgkeywordRtdProvider.js +1 -1
  36. package/dist/dianomiBidAdapter.js +1 -1
  37. package/dist/dspxBidAdapter.js +1 -1
  38. package/dist/enrichmentFpdModule.js +1 -1
  39. package/dist/eplanningBidAdapter.js +1 -1
  40. package/dist/finativeBidAdapter.js +1 -1
  41. package/dist/fpd.js +1 -0
  42. package/dist/glimpseBidAdapter.js +1 -1
  43. package/dist/gmosspBidAdapter.js +1 -1
  44. package/dist/goldbachBidAdapter.js +1 -1
  45. package/dist/gridBidAdapter.js +1 -1
  46. package/dist/gridNMBidAdapter.js +1 -1
  47. package/dist/gumgumBidAdapter.js +1 -1
  48. package/dist/h12mediaBidAdapter.js +1 -1
  49. package/dist/id5IdSystem.js +1 -1
  50. package/dist/improvedigitalBidAdapter.js +1 -1
  51. package/dist/inmarBidAdapter.js +1 -1
  52. package/dist/insticatorBidAdapter.js +1 -1
  53. package/dist/ixBidAdapter.js +1 -1
  54. package/dist/justpremiumBidAdapter.js +1 -1
  55. package/dist/konduitAnalyticsAdapter.js +1 -1
  56. package/dist/kueezBidAdapter.js +1 -1
  57. package/dist/lassoBidAdapter.js +1 -1
  58. package/dist/lifestreetBidAdapter.js +1 -1
  59. package/dist/liveIntentIdSystem.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/malltvAnalyticsAdapter.js +1 -1
  64. package/dist/marsmediaBidAdapter.js +1 -1
  65. package/dist/mediafuseBidAdapter.js +1 -1
  66. package/dist/mediakeysBidAdapter.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/nativoBidAdapter.js +1 -1
  71. package/dist/not-for-prod/prebid.js +123 -121
  72. package/dist/oguryBidAdapter.js +1 -1
  73. package/dist/onetagBidAdapter.js +1 -1
  74. package/dist/ooloAnalyticsAdapter.js +1 -1
  75. package/dist/outbrainBidAdapter.js +1 -1
  76. package/dist/parrableIdSystem.js +1 -1
  77. package/dist/pixfutureBidAdapter.js +1 -1
  78. package/dist/prebid-core.js +1 -1
  79. package/dist/prebidServerBidAdapter.js +1 -1
  80. package/dist/publinkIdSystem.js +1 -1
  81. package/dist/pubmaticBidAdapter.js +1 -1
  82. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  83. package/dist/pxyzBidAdapter.js +1 -1
  84. package/dist/quantcastBidAdapter.js +1 -1
  85. package/dist/readpeakBidAdapter.js +1 -1
  86. package/dist/relaidoBidAdapter.js +1 -1
  87. package/dist/rhythmoneBidAdapter.js +1 -1
  88. package/dist/riseBidAdapter.js +1 -1
  89. package/dist/rubiconAnalyticsAdapter.js +1 -1
  90. package/dist/rubiconBidAdapter.js +1 -1
  91. package/dist/seedingAllianceBidAdapter.js +1 -1
  92. package/dist/seedtagBidAdapter.js +1 -1
  93. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  94. package/dist/sharethroughBidAdapter.js +1 -1
  95. package/dist/shinezBidAdapter.js +1 -1
  96. package/dist/smaatoBidAdapter.js +1 -1
  97. package/dist/smartadserverBidAdapter.js +1 -1
  98. package/dist/smartxBidAdapter.js +1 -1
  99. package/dist/smilewantedBidAdapter.js +1 -1
  100. package/dist/sonobiBidAdapter.js +1 -1
  101. package/dist/sovrnAnalyticsAdapter.js +1 -1
  102. package/dist/sovrnBidAdapter.js +1 -1
  103. package/dist/sspBCBidAdapter.js +1 -1
  104. package/dist/sublimeBidAdapter.js +1 -1
  105. package/dist/synacormediaBidAdapter.js +1 -1
  106. package/dist/taboolaBidAdapter.js +1 -1
  107. package/dist/targetVideoBidAdapter.js +1 -1
  108. package/dist/teadsBidAdapter.js +1 -1
  109. package/dist/trionBidAdapter.js +1 -1
  110. package/dist/tripleliftBidAdapter.js +1 -1
  111. package/dist/ttdBidAdapter.js +1 -1
  112. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  113. package/dist/underdogmediaBidAdapter.js +1 -1
  114. package/dist/undertoneBidAdapter.js +1 -1
  115. package/dist/vidazooBidAdapter.js +1 -1
  116. package/dist/videobyteBidAdapter.js +1 -1
  117. package/dist/visxBidAdapter.js +1 -1
  118. package/dist/vuukleBidAdapter.js +1 -1
  119. package/dist/widespaceBidAdapter.js +1 -1
  120. package/dist/winrBidAdapter.js +1 -1
  121. package/dist/yahoosspBidAdapter.js +1 -1
  122. package/dist/yandexBidAdapter.js +1 -1
  123. package/dist/yieldmoBidAdapter.js +1 -1
  124. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  125. package/libraries/fpd/sua.js +98 -0
  126. package/modules/adfBidAdapter.js +1 -1
  127. package/modules/adkernelAdnBidAdapter.js +1 -0
  128. package/modules/adqueryIdSystem.js +8 -8
  129. package/modules/adxcgBidAdapter.js +1 -1
  130. package/modules/amxBidAdapter.js +1 -1
  131. package/modules/{andBeyondMediaBidAdapter.js → beyondmediaBidAdapter.js} +0 -0
  132. package/modules/{andBeyondMediaBidAdapter.md → beyondmediaBidAdapter.md} +1 -1
  133. package/modules/cleanioRtdProvider.js +3 -4
  134. package/modules/colossussspBidAdapter.js +2 -1
  135. package/modules/conversantAnalyticsAdapter.js +560 -0
  136. package/modules/conversantAnalyticsAdapter.md +47 -0
  137. package/modules/criteoBidAdapter.js +1 -1
  138. package/modules/debugging/bidInterceptor.js +2 -2
  139. package/modules/debugging/debugging.js +10 -2
  140. package/modules/dgkeywordRtdProvider.js +21 -3
  141. package/modules/dianomiBidAdapter.js +1 -1
  142. package/modules/enrichmentFpdModule.js +33 -14
  143. package/modules/finativeBidAdapter.js +1 -1
  144. package/modules/gridBidAdapter.js +187 -117
  145. package/modules/improvedigitalBidAdapter.js +2 -2
  146. package/modules/ixBidAdapter.js +94 -23
  147. package/modules/liveIntentIdSystem.js +39 -5
  148. package/modules/mediakeysBidAdapter.js +6 -1
  149. package/modules/mediakeysBidAdapter.md +50 -40
  150. package/modules/nativoBidAdapter.js +1 -1
  151. package/modules/prebidServerBidAdapter/index.js +44 -13
  152. package/modules/readpeakBidAdapter.js +1 -1
  153. package/modules/rubiconBidAdapter.js +2 -3
  154. package/modules/seedingAllianceBidAdapter.js +1 -1
  155. package/modules/sharethroughBidAdapter.js +1 -1
  156. package/modules/taboolaBidAdapter.js +1 -1
  157. package/modules/talkadsBidAdapter.js +1 -0
  158. package/modules/truereachBidAdapter.js +1 -0
  159. package/modules/ttdBidAdapter.js +1 -1
  160. package/modules/vuukleBidAdapter.js +34 -3
  161. package/modules/yahoosspBidAdapter.js +3 -1
  162. package/modules/yandexBidAdapter.js +31 -8
  163. package/package.json +2 -2
  164. package/src/adapterManager.js +2 -4
  165. package/src/cpmBucketManager.js +22 -3
  166. package/src/native.js +1 -5
  167. package/src/prebid.js +3 -3
  168. package/test/spec/cpmBucketManager_spec.js +239 -177
  169. package/test/spec/fpd/sua_spec.js +244 -0
  170. package/test/spec/modules/adfBidAdapter_spec.js +2 -3
  171. package/test/spec/modules/adqueryIdSystem_spec.js +0 -2
  172. package/test/spec/modules/adxcgBidAdapter_spec.js +2 -3
  173. package/test/spec/modules/amxBidAdapter_spec.js +3 -2
  174. package/test/spec/modules/{andBeyondMediaBidAdapter_spec.js → beyondmediaBidAdapter_spec.js} +1 -1
  175. package/test/spec/modules/colossussspBidAdapter_spec.js +4 -2
  176. package/test/spec/modules/conversantAnalyticsAdapter_spec.js +963 -0
  177. package/test/spec/modules/debugging_mod_spec.js +9 -0
  178. package/test/spec/modules/dgkeywordRtdProvider_spec.js +83 -1
  179. package/test/spec/modules/dianomiBidAdapter_spec.js +2 -3
  180. package/test/spec/modules/enrichmentFpdModule_spec.js +50 -7
  181. package/test/spec/modules/fpdModule_spec.js +9 -0
  182. package/test/spec/modules/gridBidAdapter_spec.js +87 -31
  183. package/test/spec/modules/ixBidAdapter_spec.js +221 -2
  184. package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +62 -8
  185. package/test/spec/modules/liveIntentIdSystem_spec.js +62 -8
  186. package/test/spec/modules/mediakeysBidAdapter_spec.js +20 -3
  187. package/test/spec/modules/nativoBidAdapter_spec.js +13 -2
  188. package/test/spec/modules/prebidServerBidAdapter_spec.js +159 -4
  189. package/test/spec/modules/seedtagBidAdapter_spec.js +15 -18
  190. package/test/spec/modules/sharethroughBidAdapter_spec.js +2 -1
  191. package/test/spec/modules/taboolaBidAdapter_spec.js +2 -2
  192. package/test/spec/modules/ttdBidAdapter_spec.js +3 -3
  193. package/test/spec/modules/vuukleBidAdapter_spec.js +87 -0
  194. package/test/spec/modules/yahoosspBidAdapter_spec.js +3 -1
  195. package/test/spec/modules/yandexBidAdapter_spec.js +8 -5
  196. package/test/spec/native_spec.js +5 -0
  197. package/test/spec/unit/pbjs_api_spec.js +44 -0
@@ -1,18 +1,24 @@
1
- import { parseSizesInput } from '../src/utils.js';
1
+ import { parseSizesInput, deepAccess } from '../src/utils.js';
2
2
  import { registerBidder } from '../src/adapters/bidderFactory.js';
3
+ import { BANNER } from '../src/mediaTypes.js';
4
+ import { config } from '../src/config.js';
3
5
 
4
6
  const BIDDER_CODE = 'vuukle';
5
7
  const URL = 'https://pb.vuukle.com/adapter';
6
8
  const TIME_TO_LIVE = 360;
9
+ const VENDOR_ID = 1004;
7
10
 
8
11
  export const spec = {
9
12
  code: BIDDER_CODE,
13
+ gvlid: VENDOR_ID,
14
+ supportedMediaTypes: [ BANNER ],
10
15
 
11
16
  isBidRequestValid: function(bid) {
12
17
  return true
13
18
  },
14
19
 
15
- buildRequests: function(bidRequests) {
20
+ buildRequests: function(bidRequests, bidderRequest) {
21
+ bidderRequest = bidderRequest || {};
16
22
  const requests = bidRequests.map(function (bid) {
17
23
  const parseSized = parseSizesInput(bid.sizes);
18
24
  const arrSize = parseSized[0].split('x');
@@ -25,10 +31,27 @@ export const spec = {
25
31
  rnd: Math.random(),
26
32
  bidId: bid.bidId,
27
33
  source: 'pbjs',
34
+ schain: JSON.stringify(bid.schain),
35
+ requestId: bid.bidderRequestId,
36
+ tmax: bidderRequest.timeout,
37
+ gdpr: (bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies) ? 1 : 0,
38
+ consentGiven: vuukleGetConsentGiven(bidderRequest.gdprConsent),
28
39
  version: '$prebid.version$',
29
- v: 1,
40
+ v: 2,
30
41
  };
31
42
 
43
+ if (bidderRequest.uspConsent) {
44
+ params.uspConsent = bidderRequest.uspConsent;
45
+ }
46
+
47
+ if (config.getConfig('coppa') === true) {
48
+ params.coppa = 1;
49
+ }
50
+
51
+ if (bidderRequest.gdprConsent && bidderRequest.gdprConsent.consentString) {
52
+ params.consent = bidderRequest.gdprConsent.consentString;
53
+ }
54
+
32
55
  return {
33
56
  method: 'GET',
34
57
  url: URL,
@@ -65,3 +88,11 @@ export const spec = {
65
88
  },
66
89
  }
67
90
  registerBidder(spec);
91
+
92
+ function vuukleGetConsentGiven(gdprConsent) {
93
+ let consentGiven = 0;
94
+ if (typeof gdprConsent !== 'undefined') {
95
+ consentGiven = deepAccess(gdprConsent, `vendorData.vendor.consents.${VENDOR_ID}`) ? 1 : 0;
96
+ }
97
+ return consentGiven;
98
+ }
@@ -237,7 +237,9 @@ function generateOpenRtbObject(bidderRequest, bid) {
237
237
  device: {
238
238
  dnt: 0,
239
239
  ua: navigator.userAgent,
240
- ip: deepAccess(bid, 'params.bidOverride.device.ip') || deepAccess(bid, 'params.ext.ip') || undefined
240
+ ip: deepAccess(bid, 'params.bidOverride.device.ip') || deepAccess(bid, 'params.ext.ip') || undefined,
241
+ w: window.screen.width,
242
+ h: window.screen.height
241
243
  },
242
244
  regs: {
243
245
  ext: {
@@ -1,9 +1,10 @@
1
- import {formatQS, deepAccess} from '../src/utils.js';
1
+ import { formatQS, deepAccess, triggerPixel } from '../src/utils.js';
2
2
  import { registerBidder } from '../src/adapters/bidderFactory.js';
3
3
 
4
4
  const BIDDER_CODE = 'yandex';
5
- const BIDDER_URL = 'https://bs-metadsp.yandex.ru/metadsp';
5
+ const BIDDER_URL = 'https://bs.yandex.ru/metadsp';
6
6
  const DEFAULT_TTL = 180;
7
+ const DEFAULT_CURRENCY = 'EUR';
7
8
  const SSP_ID = 10500;
8
9
 
9
10
  export const spec = {
@@ -19,9 +20,13 @@ export const spec = {
19
20
  const consentString = deepAccess(bidderRequest, 'gdprConsent.consentString');
20
21
 
21
22
  let referrer = '';
23
+ let domain = '';
24
+ let page = '';
25
+
22
26
  if (bidderRequest && bidderRequest.refererInfo) {
23
- // TODO: is 'domain' the right value here?
24
- referrer = bidderRequest.refererInfo.domain
27
+ referrer = bidderRequest.refererInfo.ref;
28
+ domain = bidderRequest.refererInfo.domain;
29
+ page = bidderRequest.refererInfo.page;
25
30
  }
26
31
 
27
32
  return validBidRequests.map((bidRequest) => {
@@ -30,17 +35,25 @@ export const spec = {
30
35
 
31
36
  const queryParams = {
32
37
  'imp-id': impId,
33
- 'target-ref': targetRef || referrer,
38
+ 'target-ref': targetRef || domain,
34
39
  'ssp-id': SSP_ID,
35
40
  };
36
41
  if (gdprApplies !== undefined) {
37
42
  queryParams['gdpr'] = 1;
38
43
  queryParams['tcf-consent'] = consentString;
39
44
  }
45
+
46
+ const floorInfo = bidRequest.getFloor ? bidRequest.getFloor({
47
+ currency: DEFAULT_CURRENCY
48
+ }) : {};
49
+ const bidfloor = floorInfo.floor;
50
+ const bidfloorcur = floorInfo.currency;
51
+
40
52
  const imp = {
41
53
  id: impId,
54
+ bidfloor,
55
+ bidfloorcur,
42
56
  };
43
-
44
57
  const bannerParams = deepAccess(bidRequest, 'mediaTypes.banner');
45
58
  if (bannerParams) {
46
59
  const [ w, h ] = bannerParams.sizes[0];
@@ -58,7 +71,8 @@ export const spec = {
58
71
  id: bidRequest.bidId,
59
72
  imp: [imp],
60
73
  site: {
61
- page: referrer,
74
+ ref_url: referrer,
75
+ page_url: page,
62
76
  },
63
77
  },
64
78
  options: {
@@ -84,7 +98,7 @@ export const spec = {
84
98
  let prBid = {
85
99
  requestId: bidRequest.bidId,
86
100
  cpm: rtbBid.price,
87
- currency: cur || 'USD',
101
+ currency: cur || DEFAULT_CURRENCY,
88
102
  width: rtbBid.w,
89
103
  height: rtbBid.h,
90
104
  creativeId: rtbBid.adid,
@@ -102,6 +116,15 @@ export const spec = {
102
116
  return prBid;
103
117
  });
104
118
  },
119
+
120
+ onBidWon: function (bid) {
121
+ const nurl = bid['nurl'];
122
+
123
+ if (!nurl) {
124
+ return;
125
+ }
126
+ triggerPixel(nurl);
127
+ }
105
128
  }
106
129
 
107
130
  registerBidder(spec);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prebid.js",
3
- "version": "7.18.0",
3
+ "version": "7.19.0",
4
4
  "description": "Header Bidding Management Library",
5
5
  "main": "src/prebid.js",
6
6
  "scripts": {
@@ -126,7 +126,7 @@
126
126
  "express": "^4.15.4",
127
127
  "fun-hooks": "^0.9.9",
128
128
  "just-clone": "^1.0.2",
129
- "live-connect-js": "2.3.3"
129
+ "live-connect-js": "2.4.0"
130
130
  },
131
131
  "optionalDependencies": {
132
132
  "fsevents": "^2.3.2"
@@ -357,8 +357,6 @@ adapterManager.callBids = (adUnits, bidRequests, addBidResponse, doneCb, request
357
357
 
358
358
  let counter = 0;
359
359
 
360
- // $.source.tid MUST be a unique UUID and also THE SAME between all PBS Requests for a given Auction
361
- const sourceTid = generateUUID();
362
360
  _s2sConfigs.forEach((s2sConfig) => {
363
361
  if (s2sConfig && uniqueServerBidRequests[counter] && getS2SBidderSet(s2sConfig).has(uniqueServerBidRequests[counter].bidderCode)) {
364
362
  // s2s should get the same client side timeout as other client side requests.
@@ -374,7 +372,7 @@ adapterManager.callBids = (adUnits, bidRequests, addBidResponse, doneCb, request
374
372
  let uniqueServerRequests = serverBidRequests.filter(serverBidRequest => serverBidRequest.uniquePbsTid === uniquePbsTid);
375
373
 
376
374
  if (s2sAdapter) {
377
- let s2sBidRequest = {tid: sourceTid, 'ad_units': adUnitsS2SCopy, s2sConfig, ortb2Fragments};
375
+ let s2sBidRequest = {'ad_units': adUnitsS2SCopy, s2sConfig, ortb2Fragments};
378
376
  if (s2sBidRequest.ad_units.length) {
379
377
  let doneCbs = uniqueServerRequests.map(bidRequest => {
380
378
  bidRequest.start = timestamp();
@@ -387,7 +385,7 @@ adapterManager.callBids = (adUnits, bidRequests, addBidResponse, doneCb, request
387
385
  // fire BID_REQUESTED event for each s2s bidRequest
388
386
  uniqueServerRequests.forEach(bidRequest => {
389
387
  // add the new sourceTid
390
- events.emit(CONSTANTS.EVENTS.BID_REQUESTED, {...bidRequest, tid: sourceTid});
388
+ events.emit(CONSTANTS.EVENTS.BID_REQUESTED, {...bidRequest, tid: bidRequest.auctionId});
391
389
  });
392
390
 
393
391
  // make bid requests
@@ -1,5 +1,6 @@
1
1
  import {find} from './polyfill.js';
2
- import { isEmpty } from './utils.js';
2
+ import { isEmpty, logWarn } from './utils.js';
3
+ import { config } from './config.js';
3
4
 
4
5
  const _defaultPrecision = 2;
5
6
  const _lgPriceConfig = {
@@ -118,6 +119,11 @@ function getCpmTarget(cpm, bucket, granularityMultiplier) {
118
119
  const precision = typeof bucket.precision !== 'undefined' ? bucket.precision : _defaultPrecision;
119
120
  const increment = bucket.increment * granularityMultiplier;
120
121
  const bucketMin = bucket.min * granularityMultiplier;
122
+ let roundingFunction = Math.floor;
123
+ let customRoundingFunction = config.getConfig('cpmRoundingFunction');
124
+ if (typeof customRoundingFunction === 'function') {
125
+ roundingFunction = customRoundingFunction;
126
+ }
121
127
 
122
128
  // start increments at the bucket min and then add bucket min back to arrive at the correct rounding
123
129
  // note - we're padding the values to avoid using decimals in the math prior to flooring
@@ -125,10 +131,23 @@ function getCpmTarget(cpm, bucket, granularityMultiplier) {
125
131
  // (eg 4.01 / 0.01 = 400.99999999999994)
126
132
  // min precison should be 2 to move decimal place over.
127
133
  let pow = Math.pow(10, precision + 2);
128
- let cpmToFloor = ((cpm * pow) - (bucketMin * pow)) / (increment * pow);
129
- let cpmTarget = ((Math.floor(cpmToFloor)) * increment) + bucketMin;
134
+ let cpmToRound = ((cpm * pow) - (bucketMin * pow)) / (increment * pow);
135
+ let cpmTarget;
136
+ let invalidRounding;
137
+ // It is likely that we will be passed {cpmRoundingFunction: roundingFunction()}
138
+ // rather than the expected {cpmRoundingFunction: roundingFunction}. Default back to floor in that case
139
+ try {
140
+ cpmTarget = (roundingFunction(cpmToRound) * increment) + bucketMin;
141
+ } catch (err) {
142
+ invalidRounding = true;
143
+ }
144
+ if (invalidRounding || typeof cpmTarget !== 'number') {
145
+ logWarn('Invalid rounding function passed in config');
146
+ cpmTarget = (Math.floor(cpmToRound) * increment) + bucketMin;
147
+ }
130
148
  // force to 10 decimal places to deal with imprecise decimal/binary conversions
131
149
  // (for example 0.1 * 3 = 0.30000000000000004)
150
+
132
151
  cpmTarget = Number(cpmTarget.toFixed(10));
133
152
  return cpmTarget.toFixed(precision);
134
153
  }
package/src/native.js CHANGED
@@ -449,11 +449,7 @@ export function getAllAssetsMessage(data, adObject, {getNativeReq = getNativeReq
449
449
  * appropriate for sending in adserver targeting or placeholder replacement.
450
450
  */
451
451
  function getAssetValue(value) {
452
- if (typeof value === 'object' && value.url) {
453
- return value.url;
454
- }
455
-
456
- return value;
452
+ return value?.url || value;
457
453
  }
458
454
 
459
455
  function getNativeKeys(adUnit) {
package/src/prebid.js CHANGED
@@ -662,10 +662,10 @@ export const startAuction = hook('async', function ({ bidsBackHandler, timeout:
662
662
 
663
663
  const bidders = allBidders.filter(bidder => !s2sBidders.has(bidder));
664
664
 
665
- adUnit.transactionId = generateUUID();
666
-
665
+ const tid = adUnit.ortb2Imp?.ext?.tid || generateUUID();
666
+ adUnit.transactionId = tid;
667
667
  // Populate ortb2Imp.ext.tid with transactionId. Specifying a transaction ID per item in the ortb impression array, lets multiple transaction IDs be transmitted in a single bid request.
668
- deepSetValue(adUnit, 'ortb2Imp.ext.tid', adUnit.transactionId)
668
+ deepSetValue(adUnit, 'ortb2Imp.ext.tid', tid);
669
669
 
670
670
  bidders.forEach(bidder => {
671
671
  const adapter = bidderRegistry[bidder];