prebid.js 9.46.0 → 9.48.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 (325) hide show
  1. package/.github/codeql/queries/jsonRequestContentType.ql +18 -0
  2. package/AGENTS.md +42 -0
  3. package/CLAUDE.md +1 -0
  4. package/babelConfig.js +1 -1
  5. package/dist/33acrossAnalyticsAdapter.js +1 -1
  6. package/dist/33acrossBidAdapter.js +1 -1
  7. package/dist/33acrossIdSystem.js +1 -1
  8. package/dist/BTBidAdapter.js +1 -1
  9. package/dist/adagioAnalyticsAdapter.js +1 -1
  10. package/dist/adagioBidAdapter.js +1 -1
  11. package/dist/adagioUtils.js +1 -1
  12. package/dist/addefendBidAdapter.js +1 -1
  13. package/dist/adgenerationBidAdapter.js +1 -1
  14. package/dist/adlooxRtdProvider.js +1 -1
  15. package/dist/adqueryBidAdapter.js +1 -1
  16. package/dist/adrelevantisBidAdapter.js +1 -1
  17. package/dist/adstirBidAdapter.js +1 -1
  18. package/dist/adtrgtmeBidAdapter.js +1 -1
  19. package/dist/advangUtils.js +1 -1
  20. package/dist/adverxoBidAdapter.js +1 -1
  21. package/dist/adxcgAnalyticsAdapter.js +1 -1
  22. package/dist/adxcgBidAdapter.js +1 -1
  23. package/dist/adyoulikeBidAdapter.js +1 -1
  24. package/dist/agmaAnalyticsAdapter.js +1 -1
  25. package/dist/ajaBidAdapter.js +1 -1
  26. package/dist/amxBidAdapter.js +1 -1
  27. package/dist/amxIdSystem.js +1 -1
  28. package/dist/aniviewBidAdapter.js +1 -1
  29. package/dist/appierAnalyticsAdapter.js +1 -1
  30. package/dist/appnexusBidAdapter.js +1 -1
  31. package/dist/asoBidAdapter.js +1 -1
  32. package/dist/axonixBidAdapter.js +1 -1
  33. package/dist/beopBidAdapter.js +1 -1
  34. package/dist/bidglassBidAdapter.js +1 -1
  35. package/dist/big-richmediaBidAdapter.js +1 -1
  36. package/dist/bitmediaBidAdapter.js +1 -1
  37. package/dist/blueBidAdapter.js +1 -1
  38. package/dist/blueUtils.js +1 -0
  39. package/dist/bmsBidAdapter.js +1 -1
  40. package/dist/bridBidAdapter.js +1 -1
  41. package/dist/bridgeuppBidAdapter.js +1 -1
  42. package/dist/bridgewellBidAdapter.js +1 -1
  43. package/dist/brightMountainMediaBidAdapter.js +1 -1
  44. package/dist/browsiUtils.js +1 -1
  45. package/dist/carodaBidAdapter.js +1 -1
  46. package/dist/chtnwBidAdapter.js +1 -1
  47. package/dist/chunk-core.js +1 -1
  48. package/dist/concertBidAdapter.js +1 -1
  49. package/dist/connectadBidAdapter.js +1 -1
  50. package/dist/consumableBidAdapter.js +1 -1
  51. package/dist/contxtfulBidAdapter.js +1 -1
  52. package/dist/conversantAnalyticsAdapter.js +1 -1
  53. package/dist/conversantBidAdapter.js +1 -1
  54. package/dist/craftBidAdapter.js +1 -1
  55. package/dist/criteoBidAdapter.js +1 -1
  56. package/dist/cwireBidAdapter.js +1 -1
  57. package/dist/czechAdIdSystem.js +1 -1
  58. package/dist/dailymotionBidAdapter.js +1 -1
  59. package/dist/debugging-standalone.js +1 -1
  60. package/dist/dependencies.json +16 -2
  61. package/dist/dspxBidAdapter.js +1 -1
  62. package/dist/dxkultureBidAdapter.js +1 -1
  63. package/dist/dynamicAdBoostRtdProvider.js +1 -1
  64. package/dist/eplanningBidAdapter.js +1 -1
  65. package/dist/eskimiBidAdapter.js +1 -1
  66. package/dist/euidIdSystem.js +1 -1
  67. package/dist/exadsBidAdapter.js +1 -1
  68. package/dist/excoBidAdapter.js +1 -1
  69. package/dist/feedadBidAdapter.js +1 -1
  70. package/dist/finativeBidAdapter.js +1 -1
  71. package/dist/freewheel-sspBidAdapter.js +1 -1
  72. package/dist/gmosspBidAdapter.js +1 -1
  73. package/dist/gptUtils.js +1 -1
  74. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  75. package/dist/greenbidsBidAdapter.js +1 -1
  76. package/dist/greenbidsRtdProvider.js +1 -1
  77. package/dist/gridBidAdapter.js +1 -1
  78. package/dist/gumgumBidAdapter.js +1 -1
  79. package/dist/h12mediaBidAdapter.js +1 -1
  80. package/dist/hypelabBidAdapter.js +1 -1
  81. package/dist/id5AnalyticsAdapter.js +1 -1
  82. package/dist/id5IdSystem.js +1 -1
  83. package/dist/imdsBidAdapter.js +1 -1
  84. package/dist/improvedigitalBidAdapter.js +1 -1
  85. package/dist/inmobiBidAdapter.js +1 -1
  86. package/dist/insticatorBidAdapter.js +1 -1
  87. package/dist/intentIqAnalyticsAdapter.js +1 -1
  88. package/dist/ixBidAdapter.js +1 -1
  89. package/dist/jixieBidAdapter.js +1 -1
  90. package/dist/justpremiumBidAdapter.js +1 -1
  91. package/dist/kargoBidAdapter.js +1 -1
  92. package/dist/kimberliteBidAdapter.js +1 -1
  93. package/dist/konduitAnalyticsAdapter.js +1 -1
  94. package/dist/kueezBidAdapter.js +1 -1
  95. package/dist/lassoBidAdapter.js +1 -1
  96. package/dist/lifestreetBidAdapter.js +1 -1
  97. package/dist/liveIntentId.js +1 -1
  98. package/dist/logicadBidAdapter.js +1 -1
  99. package/dist/loglyliftBidAdapter.js +1 -1
  100. package/dist/luceadBidAdapter.js +1 -1
  101. package/dist/luponmediaBidAdapter.js +1 -1
  102. package/dist/mabidderBidAdapter.js +1 -1
  103. package/dist/madsenseBidAdapter.js +1 -1
  104. package/dist/magniteAnalyticsAdapter.js +1 -1
  105. package/dist/malltvAnalyticsAdapter.js +1 -1
  106. package/dist/marsmediaBidAdapter.js +1 -1
  107. package/dist/mediafuseBidAdapter.js +1 -1
  108. package/dist/medianetBidAdapter.js +1 -1
  109. package/dist/medianetUtils.js +1 -1
  110. package/dist/mediasquareBidAdapter.js +1 -1
  111. package/dist/mgidBidAdapter.js +1 -1
  112. package/dist/missenaBidAdapter.js +1 -1
  113. package/dist/mobilefuseBidAdapter.js +1 -1
  114. package/dist/nativeryBidAdapter.js +1 -0
  115. package/dist/nextMillenniumBidAdapter.js +1 -1
  116. package/dist/nexx360Utils.js +1 -1
  117. package/dist/nobidAnalyticsAdapter.js +1 -1
  118. package/dist/nobidBidAdapter.js +1 -1
  119. package/dist/nodalsAiRtdProvider.js +1 -1
  120. package/dist/not-for-prod/prebid.js +187 -184
  121. package/dist/oguryBidAdapter.js +1 -1
  122. package/dist/onetagBidAdapter.js +1 -1
  123. package/dist/ooloAnalyticsAdapter.js +1 -1
  124. package/dist/openxBidAdapter.js +1 -1
  125. package/dist/optidigitalBidAdapter.js +1 -1
  126. package/dist/orbidderBidAdapter.js +1 -1
  127. package/dist/outbrainBidAdapter.js +1 -1
  128. package/dist/pinkLionBidAdapter.js +1 -0
  129. package/dist/pixfutureBidAdapter.js +1 -1
  130. package/dist/prebidServerBidAdapter.js +1 -1
  131. package/dist/priceFloors.js +1 -1
  132. package/dist/publinkIdSystem.js +1 -1
  133. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  134. package/dist/pubmaticBidAdapter.js +1 -1
  135. package/dist/pubmaticRtdProvider.js +1 -1
  136. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  137. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  138. package/dist/pubxaiRtdProvider.js +1 -1
  139. package/dist/pxyzBidAdapter.js +1 -1
  140. package/dist/quantcastBidAdapter.js +1 -1
  141. package/dist/readpeakBidAdapter.js +1 -1
  142. package/dist/relaidoBidAdapter.js +1 -1
  143. package/dist/retailspotBidAdapter.js +1 -1
  144. package/dist/rhythmoneBidAdapter.js +1 -1
  145. package/dist/riseUtils.js +1 -1
  146. package/dist/rtbhouseBidAdapter.js +1 -1
  147. package/dist/rubiconBidAdapter.js +1 -1
  148. package/dist/seedingAllianceBidAdapter.js +1 -1
  149. package/dist/seedtagBidAdapter.js +1 -1
  150. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  151. package/dist/sharethroughBidAdapter.js +1 -1
  152. package/dist/showheroes-bsBidAdapter.js +1 -1
  153. package/dist/smaatoBidAdapter.js +1 -1
  154. package/dist/smartadserverBidAdapter.js +1 -1
  155. package/dist/smartxBidAdapter.js +1 -1
  156. package/dist/smilewantedBidAdapter.js +1 -1
  157. package/dist/snigelBidAdapter.js +1 -1
  158. package/dist/sonobiBidAdapter.js +1 -1
  159. package/dist/sovrnBidAdapter.js +1 -1
  160. package/dist/sparteoBidAdapter.js +1 -1
  161. package/dist/sspBCBidAdapter.js +1 -1
  162. package/dist/stroeerCoreBidAdapter.js +1 -1
  163. package/dist/stvBidAdapter.js +1 -1
  164. package/dist/sublimeBidAdapter.js +1 -1
  165. package/dist/taboolaBidAdapter.js +1 -1
  166. package/dist/tappxBidAdapter.js +1 -1
  167. package/dist/targetVideoBidAdapter.js +1 -1
  168. package/dist/teadsBidAdapter.js +1 -1
  169. package/dist/terceptAnalyticsAdapter.js +1 -1
  170. package/dist/themoneytizerBidAdapter.js +1 -1
  171. package/dist/trionBidAdapter.js +1 -1
  172. package/dist/tripleliftBidAdapter.js +1 -1
  173. package/dist/ttdBidAdapter.js +1 -1
  174. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  175. package/dist/uid2IdSystem.js +1 -1
  176. package/dist/underdogmediaBidAdapter.js +1 -1
  177. package/dist/undertoneBidAdapter.js +1 -1
  178. package/dist/unifiedIdSystem.js +1 -1
  179. package/dist/unrulyBidAdapter.js +1 -1
  180. package/dist/userId.js +1 -1
  181. package/dist/vidazooUtils.js +1 -1
  182. package/dist/videobyteBidAdapter.js +1 -1
  183. package/dist/visxBidAdapter.js +1 -1
  184. package/dist/vuukleBidAdapter.js +1 -1
  185. package/dist/weboramaRtdProvider.js +1 -1
  186. package/dist/widespaceBidAdapter.js +1 -1
  187. package/dist/winrBidAdapter.js +1 -1
  188. package/dist/xeUtils.js +1 -1
  189. package/dist/yahooAdsBidAdapter.js +1 -1
  190. package/dist/yandexBidAdapter.js +1 -1
  191. package/dist/yieldmoBidAdapter.js +1 -1
  192. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  193. package/eslint.config.js +1 -3
  194. package/gulpHelpers.js +3 -6
  195. package/gulpfile.js +25 -24
  196. package/karma.conf.maker.js +1 -3
  197. package/libraries/advangUtils/index.js +3 -4
  198. package/libraries/blueUtils/bidderUtils.js +113 -0
  199. package/libraries/browsiUtils/browsiUtils.js +1 -2
  200. package/libraries/gptUtils/gptUtils.js +1 -2
  201. package/libraries/liveIntentId/shared.js +4 -0
  202. package/libraries/xeUtils/bidderUtils.js +3 -4
  203. package/modules/adagioBidAdapter.js +1 -2
  204. package/modules/addefendBidAdapter.md +1 -1
  205. package/modules/adtrgtmeBidAdapter.js +6 -8
  206. package/modules/aduptechBidAdapter.md +1 -1
  207. package/modules/adverxoBidAdapter.js +3 -3
  208. package/modules/blueBidAdapter.js +24 -104
  209. package/modules/bmsBidAdapter.js +25 -105
  210. package/modules/concertBidAdapter.md +1 -1
  211. package/modules/contxtfulBidAdapter.js +56 -10
  212. package/modules/conversantBidAdapter.js +0 -58
  213. package/modules/cwireBidAdapter.js +8 -0
  214. package/modules/czechAdIdSystem.js +13 -3
  215. package/modules/dynamicAdBoostRtdProvider.js +16 -33
  216. package/modules/dynamicAdBoostRtdProvider.md +1 -6
  217. package/modules/ixBidAdapter.js +2 -3
  218. package/modules/luponmediaBidAdapter.js +117 -522
  219. package/modules/luponmediaBidAdapter.md +2 -3
  220. package/modules/mediasquareBidAdapter.js +14 -20
  221. package/modules/microadBidAdapter.js +0 -1
  222. package/modules/nativeryBidAdapter.js +135 -0
  223. package/modules/nativeryBidAdapter.md +95 -0
  224. package/modules/nativoBidAdapter.js +3 -3
  225. package/modules/onetagBidAdapter.js +0 -1
  226. package/modules/pinkLionBidAdapter.js +17 -0
  227. package/modules/pinkLionBidAdapter.md +79 -0
  228. package/modules/prebidServerBidAdapter/ortbConverter.js +1 -1
  229. package/modules/priceFloors.js +2 -2
  230. package/modules/pubmaticBidAdapter.js +4 -1
  231. package/modules/qortexRtdProvider.md +1 -1
  232. package/modules/reconciliationRtdProvider.md +4 -4
  233. package/modules/rtbhouseBidAdapter.js +4 -83
  234. package/modules/rubiconBidAdapter.js +1 -1
  235. package/modules/sspBCBidAdapter.js +1 -1
  236. package/modules/stroeerCoreBidAdapter.js +3 -3
  237. package/modules/stvBidAdapter.js +19 -14
  238. package/modules/topicsFpdModule.md +1 -1
  239. package/modules/unifiedIdSystem.js +8 -1
  240. package/modules/userId/eids.js +15 -0
  241. package/modules/videoModule/index.js +0 -1
  242. package/modules/videoModule/videoImpressionVerifier.js +0 -1
  243. package/modules/yieldlabBidAdapter.js +1 -2
  244. package/modules/yieldmoBidAdapter.js +1 -2
  245. package/package.json +13 -20
  246. package/src/Renderer.js +1 -2
  247. package/src/adapterManager.js +14 -4
  248. package/src/auction.js +2 -3
  249. package/src/config.js +1 -2
  250. package/src/cpmBucketManager.js +1 -2
  251. package/src/secureCreatives.js +2 -3
  252. package/src/targeting.js +1 -2
  253. package/test/fake-server/README.md +3 -3
  254. package/test/helpers/index_adapter_utils.js +2 -2
  255. package/test/helpers/testing-utils.js +1 -1
  256. package/test/spec/auctionmanager_spec.js +2 -3
  257. package/test/spec/fpd/enrichment_spec.js +1 -1
  258. package/test/spec/libraries/greedy/greedyPromise_spec.js +2 -2
  259. package/test/spec/modules/adfBidAdapter_spec.js +1 -1
  260. package/test/spec/modules/adnuntiusBidAdapter_spec.js +25 -9
  261. package/test/spec/modules/adtrgtmeBidAdapter_spec.js +2 -4
  262. package/test/spec/modules/adverxoBidAdapter_spec.js +25 -1
  263. package/test/spec/modules/afpBidAdapter_spec.js +0 -1
  264. package/test/spec/modules/bliinkBidAdapter_spec.js +15 -7
  265. package/test/spec/modules/contxtfulBidAdapter_spec.js +606 -82
  266. package/test/spec/modules/conversantBidAdapter_spec.js +1 -139
  267. package/test/spec/modules/cwireBidAdapter_spec.js +2 -2
  268. package/test/spec/modules/czechAdIdSystem_spec.js +4 -4
  269. package/test/spec/modules/displayioBidAdapter_spec.js +1 -1
  270. package/test/spec/modules/dynamicAdBoostRtdProvider_spec.js +0 -42
  271. package/test/spec/modules/enrichmentLiftMeasurement_spec.js +8 -8
  272. package/test/spec/modules/hypelabBidAdapter_spec.js +17 -11
  273. package/test/spec/modules/iasRtdProvider_spec.js +2 -2
  274. package/test/spec/modules/id5IdSystem_spec.js +1 -1
  275. package/test/spec/modules/idxIdSystem_spec.js +1 -2
  276. package/test/spec/modules/intentIqAnalyticsAdapter_spec.js +25 -25
  277. package/test/spec/modules/intentIqIdSystem_spec.js +32 -32
  278. package/test/spec/modules/kargoBidAdapter_spec.js +11 -5
  279. package/test/spec/modules/liveIntentIdSystem_spec.js +14 -0
  280. package/test/spec/modules/lmpIdSystem_spec.js +1 -2
  281. package/test/spec/modules/lockrAIMIdSystem_spec.js +2 -2
  282. package/test/spec/modules/luceadBidAdapter_spec.js +1 -1
  283. package/test/spec/modules/luponmediaBidAdapter_spec.js +186 -324
  284. package/test/spec/modules/mediaeyesBidAdapter_spec.js +1 -1
  285. package/test/spec/modules/mediakeysBidAdapter_spec.js +1 -2
  286. package/test/spec/modules/mediasquareBidAdapter_spec.js +13 -2
  287. package/test/spec/modules/missenaBidAdapter_spec.js +1 -1
  288. package/test/spec/modules/nativeryBidAdapter_spec.js +195 -0
  289. package/test/spec/modules/nexx360BidAdapter_spec.js +6 -6
  290. package/test/spec/modules/oguryBidAdapter_spec.js +2 -2
  291. package/test/spec/modules/omsBidAdapter_spec.js +1 -1
  292. package/test/spec/modules/onetagBidAdapter_spec.js +1 -2
  293. package/test/spec/modules/onomagicBidAdapter_spec.js +2 -2
  294. package/test/spec/modules/overtoneRtdProvider_spec.mjs +1 -1
  295. package/test/spec/modules/permutiveIdentityManagerIdSystem_spec.js +17 -14
  296. package/test/spec/modules/pinkLionBidAdapter_spec.js +480 -0
  297. package/test/spec/modules/prebidServerBidAdapter_spec.js +2 -2
  298. package/test/spec/modules/previousAuctionInfo_spec.js +2 -2
  299. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +1 -1
  300. package/test/spec/modules/pubmaticBidAdapter_spec.js +19 -1
  301. package/test/spec/modules/pubmaticRtdProvider_spec.js +16 -17
  302. package/test/spec/modules/pubwiseAnalyticsAdapter_spec.js +2 -2
  303. package/test/spec/modules/rtbhouseBidAdapter_spec.js +0 -182
  304. package/test/spec/modules/rubiconBidAdapter_spec.js +3 -4
  305. package/test/spec/modules/sizeMappingV2_spec.js +1 -1
  306. package/test/spec/modules/sizeMapping_spec.js +2 -3
  307. package/test/spec/modules/stroeerCoreBidAdapter_spec.js +36 -26
  308. package/test/spec/modules/stvBidAdapter_spec.js +108 -40
  309. package/test/spec/modules/topLevelPaapi_spec.js +1 -1
  310. package/test/spec/modules/tpmnBidAdapter_spec.js +1 -1
  311. package/test/spec/modules/ttdBidAdapter_spec.js +1 -1
  312. package/test/spec/modules/unifiedIdSystem_spec.js +20 -0
  313. package/test/spec/modules/userId_spec.js +1 -1
  314. package/test/spec/modules/vibrantmediaBidAdapter_spec.js +1 -1
  315. package/test/spec/modules/videoModule/submodules/videojsVideoProvider_spec.js +1 -1
  316. package/test/spec/modules/yieldmoBidAdapter_spec.js +2 -2
  317. package/test/spec/modules/zeotapIdPlusIdSystem_spec.js +1 -2
  318. package/test/spec/unit/core/adapterManager_spec.js +29 -17
  319. package/test/spec/unit/core/targeting_spec.js +1 -1
  320. package/test/spec/unit/pbjs_api_spec.js +4 -5
  321. package/test/spec/utils_spec.js +20 -12
  322. package/test/test_deps.js +1 -1
  323. package/nightwatch.browserstack.json +0 -46
  324. package/nightwatch.conf.js +0 -36
  325. package/nightwatch.json +0 -40
@@ -1,6 +1,6 @@
1
1
  import { registerBidder } from '../src/adapters/bidderFactory.js';
2
2
  import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
3
- import { _each, buildUrl, isStr, isEmptyStr, logInfo, logError } from '../src/utils.js';
3
+ import { _each, buildUrl, isStr, isEmptyStr, logInfo, logError, safeJSONEncode } from '../src/utils.js';
4
4
  import { sendBeacon, ajax } from '../src/ajax.js';
5
5
  import { config as pbjsConfig } from '../src/config.js';
6
6
  import {
@@ -162,16 +162,60 @@ const logBidderError = ({ error, bidderRequest }) => {
162
162
  logEvent('onBidderError', { error, bidderRequest });
163
163
  };
164
164
 
165
+ const safeStringify = (data, keysToExclude = []) => {
166
+ try {
167
+ const seen = new WeakSet();
168
+ return JSON.stringify(data, function (key, value) {
169
+ try {
170
+ if (keysToExclude.includes(key)) {
171
+ return '[Excluded]';
172
+ }
173
+ // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#exceptions
174
+ if (typeof value === "bigint") {
175
+ return value.toString();
176
+ }
177
+
178
+ // Handle browser objects
179
+ if (typeof value === "object" && value !== null) {
180
+ // In case we try to stringify some html object, it could throw a SecurityError before detecting the circular reference
181
+ if (value === window ||
182
+ (typeof Window !== 'undefined' && value instanceof Window) ||
183
+ (typeof Document !== 'undefined' && value instanceof Document) ||
184
+ (typeof HTMLElement !== 'undefined' && value instanceof HTMLElement) ||
185
+ (typeof Node !== 'undefined' && value instanceof Node)) {
186
+ return '[Browser Object]';
187
+ }
188
+
189
+ // Check for circular references
190
+ if (seen.has(value)) {
191
+ return "[Circular]";
192
+ }
193
+ seen.add(value);
194
+ }
195
+
196
+ return value;
197
+ } catch (error) {
198
+ // Handle any property access errors (like cross-origin SecurityError)
199
+ return '[Inaccessible Object]';
200
+ }
201
+ });
202
+ } catch (error) {
203
+ return safeJSONEncode({ traceId: data?.traceId || '[Unknown]', error: error?.toString() });
204
+ }
205
+ };
206
+
165
207
  // Handles the logging of events
166
208
  const logEvent = (eventType, data) => {
167
209
  try {
168
- // Log event
169
- logInfo(BIDDER_CODE, `[${eventType}] ${JSON.stringify(data)}`);
170
-
171
210
  // Get Config
172
211
  const bidderConfig = pbjsConfig.getConfig();
173
212
  const { version, customer } = extractParameters(bidderConfig);
174
213
 
214
+ // Construct a fail-safe payload
215
+ const stringifiedPayload = safeStringify(data, ["renderer"]);
216
+
217
+ logInfo(BIDDER_CODE, `[${eventType}] ${stringifiedPayload}`);
218
+
175
219
  // Sampled monitoring
176
220
  if (['onBidBillable', 'onAdRenderSucceeded'].includes(eventType)) {
177
221
  const randomNumber = Math.random();
@@ -184,7 +228,6 @@ const logEvent = (eventType, data) => {
184
228
  return;
185
229
  }
186
230
 
187
- const payload = { type: eventType, data };
188
231
  const eventUrl = buildUrl({
189
232
  protocol: 'https',
190
233
  host: MONITORING_ENDPOINT,
@@ -192,19 +235,19 @@ const logEvent = (eventType, data) => {
192
235
  });
193
236
 
194
237
  // Try sending a beacon
195
- if (sendBeacon(eventUrl, JSON.stringify(payload))) {
196
- logInfo(BIDDER_CODE, `[${eventType}] Logging data sent using Beacon and payload: ${JSON.stringify(data)}`);
238
+ if (sendBeacon(eventUrl, stringifiedPayload)) {
239
+ logInfo(BIDDER_CODE, `[${eventType}] Logging data sent using Beacon and payload: ${stringifiedPayload}`);
197
240
  } else {
198
241
  // Fallback to using ajax
199
- ajax(eventUrl, null, JSON.stringify(payload), {
242
+ ajax(eventUrl, null, stringifiedPayload, {
200
243
  method: 'POST',
201
244
  contentType: 'application/json',
202
245
  withCredentials: true,
203
246
  });
204
- logInfo(BIDDER_CODE, `[${eventType}] Logging data sent using Ajax and payload: ${JSON.stringify(data)}`);
247
+ logInfo(BIDDER_CODE, `[${eventType}] Logging data sent using Ajax and payload: ${stringifiedPayload}`);
205
248
  }
206
249
  } catch (error) {
207
- logError(BIDDER_CODE, `Failed to log event: ${eventType}`);
250
+ logError(BIDDER_CODE, `Failed to log event: ${eventType}. Error: ${error.toString()}.`);
208
251
  }
209
252
  };
210
253
 
@@ -225,4 +268,7 @@ export const spec = {
225
268
  onBidderError: logBidderError,
226
269
  };
227
270
 
271
+ // Export for testing
272
+ export { safeStringify };
273
+
228
274
  registerBidder(spec);
@@ -1,20 +1,17 @@
1
1
  import {
2
2
  buildUrl,
3
3
  deepAccess,
4
- deepSetValue,
5
4
  getBidIdParameter,
6
5
  isArray,
7
6
  isFn,
8
7
  isPlainObject,
9
8
  isStr,
10
- logError,
11
9
  logWarn,
12
10
  mergeDeep,
13
11
  parseUrl,
14
12
  } from '../src/utils.js';
15
13
  import {registerBidder} from '../src/adapters/bidderFactory.js';
16
14
  import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
17
- import {getStorageManager} from '../src/storageManager.js';
18
15
  import {ortbConverter} from '../libraries/ortbConverter/converter.js';
19
16
  import {ORTB_MTYPES} from '../libraries/ortbConverter/processors/mediaType.js';
20
17
 
@@ -30,7 +27,6 @@ import {ORTB_MTYPES} from '../libraries/ortbConverter/processors/mediaType.js';
30
27
  const GVLID = 24;
31
28
 
32
29
  const BIDDER_CODE = 'conversant';
33
- export const storage = getStorageManager({gvlid: GVLID, bidderCode: BIDDER_CODE});
34
30
  const URL = 'https://web.hb.ad.cpe.dotomi.com/cvx/client/hb/ortb/25';
35
31
 
36
32
  function setSiteId(bidRequest, request) {
@@ -44,14 +40,6 @@ function setSiteId(bidRequest, request) {
44
40
  }
45
41
  }
46
42
 
47
- function setPubcid(bidRequest, request) {
48
- // Add common id if available
49
- const pubcid = getPubcid(bidRequest);
50
- if (pubcid) {
51
- deepSetValue(request, 'user.ext.fpc', pubcid);
52
- }
53
- }
54
-
55
43
  const converter = ortbConverter({
56
44
  context: {
57
45
  netRevenue: true,
@@ -64,7 +52,6 @@ const converter = ortbConverter({
64
52
  if (context.bidRequests) {
65
53
  const bidRequest = context.bidRequests[0];
66
54
  setSiteId(bidRequest, request);
67
- setPubcid(bidRequest, request);
68
55
  }
69
56
 
70
57
  return request;
@@ -224,20 +211,6 @@ export const spec = {
224
211
  }
225
212
  };
226
213
 
227
- function getPubcid(bidRequest) {
228
- let pubcid = null;
229
- if (bidRequest.userId && bidRequest.userId.pubcid) {
230
- pubcid = bidRequest.userId.pubcid;
231
- } else if (bidRequest.crumbs && bidRequest.crumbs.pubcid) {
232
- pubcid = bidRequest.crumbs.pubcid;
233
- }
234
- if (!pubcid) {
235
- const pubcidName = getBidIdParameter('pubcid_name', bidRequest.params) || '_pubcid';
236
- pubcid = readStoredValue(pubcidName);
237
- }
238
- return pubcid;
239
- }
240
-
241
214
  /**
242
215
  * Check if it's a video bid request
243
216
  *
@@ -261,37 +234,6 @@ function copyOptProperty(src, dst, dstName) {
261
234
  }
262
235
  }
263
236
 
264
- /**
265
- * Look for a stored value from both cookie and local storage and return the first value found.
266
- * @param key Key for the search
267
- * @return {string} Stored value
268
- */
269
- function readStoredValue(key) {
270
- let storedValue;
271
- try {
272
- // check cookies first
273
- storedValue = storage.getCookie(key);
274
-
275
- if (!storedValue) {
276
- // check expiration time before reading local storage
277
- const storedValueExp = storage.getDataFromLocalStorage(`${key}_exp`);
278
- if (storedValueExp === '' || (storedValueExp && (new Date(storedValueExp)).getTime() - Date.now() > 0)) {
279
- storedValue = storage.getDataFromLocalStorage(key);
280
- storedValue = storedValue ? decodeURIComponent(storedValue) : storedValue;
281
- }
282
- }
283
-
284
- // deserialize JSON if needed
285
- if (isStr(storedValue) && storedValue.charAt(0) === '{') {
286
- storedValue = JSON.parse(storedValue);
287
- }
288
- } catch (e) {
289
- logError(e);
290
- }
291
-
292
- return storedValue;
293
- }
294
-
295
237
  /**
296
238
  * Get the floor price from bid.params for backward compatibility.
297
239
  * If not found, then check floor module.
@@ -86,6 +86,13 @@ function getRefGroups() {
86
86
  return []
87
87
  }
88
88
 
89
+ /**
90
+ * Returns the downlink speed of the connection in Mbps or an empty string if not available.
91
+ */
92
+ function getConnectionDownLink(nav) {
93
+ return nav && nav.connection && nav.connection.downlink >= 0 ? nav.connection.downlink.toString() : '';
94
+ }
95
+
89
96
  /**
90
97
  * Reads the CWID from local storage.
91
98
  */
@@ -190,6 +197,7 @@ export const spec = {
190
197
  httpRef: referrer,
191
198
  // TODO: Verify whether the auctionId and the usage of pageViewId make sense.
192
199
  pageViewId: pageViewId,
200
+ networkBandwidth: getConnectionDownLink(window.navigator),
193
201
  sdk: {
194
202
  version: '$prebid.version$'
195
203
  },
@@ -18,11 +18,18 @@ import {MODULE_TYPE_UID} from '../src/activities/modules.js';
18
18
  export const storage = getStorageManager({ moduleType: MODULE_TYPE_UID, moduleName: 'czechAdId' })
19
19
 
20
20
  // Returns the id string from either cookie or localstorage
21
- const readId = () => { return storage.getCookie('czaid') || storage.getDataFromLocalStorage('czaid') }
21
+ const readId = () => {
22
+ const id = storage.getCookie('czaid') || storage.getDataFromLocalStorage('czaid')
23
+ return id && isValidUUID(id) ? id : null
24
+ }
25
+ const isValidUUID = (str) => {
26
+ const uuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/
27
+ return uuidRegex.test(str)
28
+ }
22
29
 
23
30
  /** @type {Submodule} */
24
31
  export const czechAdIdSubmodule = {
25
- version: '0.1.0',
32
+ version: '0.1.1',
26
33
  /**
27
34
  * used to link submodule with config
28
35
  * @type {string}
@@ -38,7 +45,10 @@ export const czechAdIdSubmodule = {
38
45
  * @function decode
39
46
  * @returns {(Object|undefined)}
40
47
  */
41
- decode () { return { czechAdId: readId() } },
48
+ decode () {
49
+ const id = readId()
50
+ return id ? { czechAdId: readId() } : undefined
51
+ },
42
52
  /**
43
53
  * performs action to obtain id and return a value in the callback's response argument
44
54
  * @function
@@ -7,7 +7,7 @@
7
7
  import { submodule } from '../src/hook.js'
8
8
  import { loadExternalScript } from '../src/adloader.js';
9
9
  import { getGlobal } from '../src/prebidGlobal.js';
10
- import { deepAccess, deepSetValue, isEmptyStr } from '../src/utils.js';
10
+ import { deepAccess, deepSetValue } from '../src/utils.js';
11
11
  import { MODULE_TYPE_RTD } from '../src/activities/modules.js';
12
12
 
13
13
  /**
@@ -29,7 +29,7 @@ let dabStartTime;
29
29
  // Array of div IDs to track
30
30
  let dynamicAdBoostAdUnits = {};
31
31
 
32
- function init(config, userConsent) {
32
+ function init() {
33
33
  dabStartDate = new Date();
34
34
  dabStartTime = dabStartDate.getTime();
35
35
  if (!CLIENT_SUPPORTS_IO) {
@@ -37,47 +37,30 @@ function init(config, userConsent) {
37
37
  }
38
38
  // Create an Intersection Observer instance
39
39
  observer = new IntersectionObserver(dabHandleIntersection, dabOptions);
40
- if (config.params.keyId) {
41
- let keyId = config.params.keyId;
42
- if (keyId && !isEmptyStr(keyId)) {
43
- let dabDivIdsToTrack = config.params.adUnits;
44
- let dabInterval = setInterval(function() {
45
- // Observe each div by its ID
46
- dabDivIdsToTrack.forEach(divId => {
47
- let div = document.getElementById(divId);
48
- if (div) {
49
- observer.observe(div);
50
- }
51
- });
40
+ let keyId = 'rtd-' + window.location.hostname;
52
41
 
53
- let dabDateNow = new Date();
54
- let dabTimeNow = dabDateNow.getTime();
55
- let dabElapsedSeconds = Math.floor((dabTimeNow - dabStartTime) / 1000);
56
- let elapsedThreshold = 30;
57
- if (config.params.threshold) {
58
- elapsedThreshold = config.params.threshold;
59
- }
60
- if (dabElapsedSeconds >= elapsedThreshold) {
61
- clearInterval(dabInterval); // Stop
62
- loadLmScript(keyId);
63
- }
64
- }, 1000);
42
+ let dabInterval = setInterval(function() {
43
+ let dabDateNow = new Date();
44
+ let dabTimeNow = dabDateNow.getTime();
45
+ let dabElapsedSeconds = Math.floor((dabTimeNow - dabStartTime) / 1000);
46
+ let elapsedThreshold = 0;
65
47
 
66
- return true;
48
+ if (dabElapsedSeconds >= elapsedThreshold) {
49
+ clearInterval(dabInterval); // Stop
50
+ loadLmScript(keyId);
67
51
  }
68
- }
69
- return false;
52
+ }, 1000);
53
+
54
+ return true;
70
55
  }
71
56
 
72
57
  function loadLmScript(keyId) {
73
- let viewableAdUnits = Object.keys(dynamicAdBoostAdUnits);
74
- let viewableAdUnitsCSV = viewableAdUnits.join(',');
75
- const scriptUrl = `${SCRIPT_URL}/${keyId}.js?viewableAdUnits=${viewableAdUnitsCSV}`;
58
+ const scriptUrl = `${SCRIPT_URL}/${keyId}.js`;
76
59
  loadExternalScript(scriptUrl, MODULE_TYPE_RTD, MODULE_NAME);
77
60
  observer.disconnect();
78
61
  }
79
62
 
80
- function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) {
63
+ function getBidRequestData(reqBidsConfigObj, callback) {
81
64
  const reqAdUnits = reqBidsConfigObj.adUnits || getGlobal().adUnits;
82
65
 
83
66
  if (Array.isArray(reqAdUnits)) {
@@ -26,12 +26,7 @@ pbjs.setConfig(
26
26
  auctionDelay: 2000,
27
27
  dataProviders: [
28
28
  {
29
- name: "dynamicAdBoost",
30
- params: {
31
- keyId: "[PROVIDED_KEY]", // Your provided Dynamic AdBoost keyId
32
- adUnits: ["allowedAdUnit1", "allowedAdUnit2"],
33
- threshold: 35 // optional
34
- }
29
+ name: "dynamicAdBoost"
35
30
  }
36
31
  ]
37
32
  }
@@ -19,7 +19,6 @@ import {
19
19
  import { BANNER, VIDEO, NATIVE } from '../src/mediaTypes.js';
20
20
  import { config } from '../src/config.js';
21
21
  import { getStorageManager } from '../src/storageManager.js';
22
- import { find } from '../src/polyfill.js';
23
22
  import { registerBidder } from '../src/adapters/bidderFactory.js';
24
23
  import { INSTREAM, OUTSTREAM } from '../src/video.js';
25
24
  import { Renderer } from '../src/Renderer.js';
@@ -621,8 +620,8 @@ function getBidRequest(id, impressions, validBidRequests) {
621
620
  return;
622
621
  }
623
622
  const bidRequest = {
624
- ...find(validBidRequests, bid => bid.bidId === id),
625
- ...find(impressions, imp => imp.id === id)
623
+ ...validBidRequests.find(bid => bid.bidId === id),
624
+ ...impressions.find(imp => imp.id === id)
626
625
  }
627
626
 
628
627
  return bidRequest;