prebid.js 7.44.0 → 7.46.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 (309) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/acuityAdsBidAdapter.js +1 -1
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/admaticBidAdapter.js +1 -1
  8. package/dist/adnuntiusBidAdapter.js +1 -1
  9. package/dist/adrelevantisBidAdapter.js +1 -1
  10. package/dist/adtrgtmeBidAdapter.js +1 -1
  11. package/dist/adxcgBidAdapter.js +1 -1
  12. package/dist/adyoulikeBidAdapter.js +1 -1
  13. package/dist/ajaBidAdapter.js +1 -1
  14. package/dist/amxBidAdapter.js +1 -1
  15. package/dist/amxIdSystem.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/appushBidAdapter.js +1 -1
  19. package/dist/asoBidAdapter.js +1 -1
  20. package/dist/axonixBidAdapter.js +1 -1
  21. package/dist/beyondmediaBidAdapter.js +1 -1
  22. package/dist/bidglassBidAdapter.js +1 -1
  23. package/dist/bidwatchAnalyticsAdapter.js +1 -1
  24. package/dist/big-richmediaBidAdapter.js +1 -1
  25. package/dist/braveBidAdapter.js +1 -1
  26. package/dist/bridgewellBidAdapter.js +1 -1
  27. package/dist/brightMountainMediaBidAdapter.js +1 -1
  28. package/dist/brightcomBidAdapter.js +1 -1
  29. package/dist/brightcomSSPBidAdapter.js +1 -1
  30. package/dist/carodaBidAdapter.js +1 -1
  31. package/dist/chtnwBidAdapter.js +1 -1
  32. package/dist/coinzillaBidAdapter.js +1 -1
  33. package/dist/compassBidAdapter.js +1 -1
  34. package/dist/concertBidAdapter.js +1 -1
  35. package/dist/connectIdSystem.js +1 -1
  36. package/dist/connectadBidAdapter.js +1 -1
  37. package/dist/consumableBidAdapter.js +1 -1
  38. package/dist/contentexchangeBidAdapter.js +1 -1
  39. package/dist/conversantAnalyticsAdapter.js +1 -1
  40. package/dist/conversantBidAdapter.js +1 -1
  41. package/dist/craftBidAdapter.js +1 -1
  42. package/dist/criteoBidAdapter.js +1 -1
  43. package/dist/cwireBidAdapter.js +1 -1
  44. package/dist/debugging-standalone.js +1 -1
  45. package/dist/dependencies.json +15 -0
  46. package/dist/domainOverrideToRootDomain.js +1 -0
  47. package/dist/dspxBidAdapter.js +1 -1
  48. package/dist/eplanningBidAdapter.js +1 -1
  49. package/dist/eskimiBidAdapter.js +1 -0
  50. package/dist/feedadBidAdapter.js +1 -1
  51. package/dist/finativeBidAdapter.js +1 -1
  52. package/dist/freewheel-sspBidAdapter.js +1 -1
  53. package/dist/glimpseBidAdapter.js +1 -1
  54. package/dist/globalsunBidAdapter.js +1 -1
  55. package/dist/gmosspBidAdapter.js +1 -1
  56. package/dist/goldbachBidAdapter.js +1 -1
  57. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  58. package/dist/gridBidAdapter.js +1 -1
  59. package/dist/growthCodeIdSystem.js +1 -1
  60. package/dist/gumgumBidAdapter.js +1 -1
  61. package/dist/h12mediaBidAdapter.js +1 -1
  62. package/dist/id5IdSystem.js +1 -1
  63. package/dist/improvedigitalBidAdapter.js +1 -1
  64. package/dist/inmarBidAdapter.js +1 -1
  65. package/dist/insticatorBidAdapter.js +1 -1
  66. package/dist/iqzoneBidAdapter.js +1 -1
  67. package/dist/ivsBidAdapter.js +1 -0
  68. package/dist/ixBidAdapter.js +1 -1
  69. package/dist/justpremiumBidAdapter.js +1 -1
  70. package/dist/jwplayerVideoProvider.js +1 -1
  71. package/dist/kargoBidAdapter.js +1 -1
  72. package/dist/koblerBidAdapter.js +1 -1
  73. package/dist/konduitAnalyticsAdapter.js +1 -1
  74. package/dist/kueezBidAdapter.js +1 -1
  75. package/dist/kueezRtbBidAdapter.js +1 -1
  76. package/dist/kulturemediaBidAdapter.js +1 -1
  77. package/dist/lassoBidAdapter.js +1 -1
  78. package/dist/lifestreetBidAdapter.js +1 -1
  79. package/dist/liveIntentIdSystem.js +1 -1
  80. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  81. package/dist/logicadBidAdapter.js +1 -1
  82. package/dist/loglyliftBidAdapter.js +1 -1
  83. package/dist/luponmediaBidAdapter.js +1 -1
  84. package/dist/magniteAnalyticsAdapter.js +1 -1
  85. package/dist/malltvAnalyticsAdapter.js +1 -1
  86. package/dist/marsmediaBidAdapter.js +1 -1
  87. package/dist/mathildeadsBidAdapter.js +1 -1
  88. package/dist/mediafuseBidAdapter.js +1 -1
  89. package/dist/medianetBidAdapter.js +1 -1
  90. package/dist/mediasquareBidAdapter.js +1 -1
  91. package/dist/mgidBidAdapter.js +1 -1
  92. package/dist/minutemediaBidAdapter.js +1 -1
  93. package/dist/minutemediaplusBidAdapter.js +1 -1
  94. package/dist/nativoBidAdapter.js +1 -1
  95. package/dist/neuwoRtdProvider.js +1 -1
  96. package/dist/nexx360BidAdapter.js +1 -1
  97. package/dist/not-for-prod/prebid.js +165 -162
  98. package/dist/oguryBidAdapter.js +1 -1
  99. package/dist/onetagBidAdapter.js +1 -1
  100. package/dist/onomagicBidAdapter.js +1 -1
  101. package/dist/ooloAnalyticsAdapter.js +1 -1
  102. package/dist/openxBidAdapter.js +1 -1
  103. package/dist/openxOrtbBidAdapter.js +1 -1
  104. package/dist/operaadsBidAdapter.js +1 -1
  105. package/dist/optidigitalBidAdapter.js +1 -1
  106. package/dist/ortbConverter.js +1 -1
  107. package/dist/outbrainBidAdapter.js +1 -1
  108. package/dist/pairIdSystem.js +1 -0
  109. package/dist/parrableIdSystem.js +1 -1
  110. package/dist/pixfutureBidAdapter.js +1 -1
  111. package/dist/prebid-core.js +1 -1
  112. package/dist/publinkIdSystem.js +1 -1
  113. package/dist/pubmaticBidAdapter.js +1 -1
  114. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  115. package/dist/pubxBidAdapter.js +1 -1
  116. package/dist/pxyzBidAdapter.js +1 -1
  117. package/dist/quantcastBidAdapter.js +1 -1
  118. package/dist/readpeakBidAdapter.js +1 -1
  119. package/dist/relaidoBidAdapter.js +1 -1
  120. package/dist/rhythmoneBidAdapter.js +1 -1
  121. package/dist/riseBidAdapter.js +1 -1
  122. package/dist/rubiconAnalyticsAdapter.js +1 -1
  123. package/dist/rubiconBidAdapter.js +1 -1
  124. package/dist/seedingAllianceBidAdapter.js +1 -1
  125. package/dist/seedtagBidAdapter.js +1 -1
  126. package/dist/sharedIdSystem.js +1 -1
  127. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  128. package/dist/sharethroughBidAdapter.js +1 -1
  129. package/dist/shinezBidAdapter.js +1 -1
  130. package/dist/smaatoBidAdapter.js +1 -1
  131. package/dist/smartadserverBidAdapter.js +1 -1
  132. package/dist/smarthubBidAdapter.js +1 -1
  133. package/dist/smartxBidAdapter.js +1 -1
  134. package/dist/smilewantedBidAdapter.js +1 -1
  135. package/dist/sonobiBidAdapter.js +1 -1
  136. package/dist/sovrnAnalyticsAdapter.js +1 -1
  137. package/dist/sovrnBidAdapter.js +1 -1
  138. package/dist/sspBCBidAdapter.js +1 -1
  139. package/dist/stvBidAdapter.js +1 -1
  140. package/dist/sublimeBidAdapter.js +1 -1
  141. package/dist/synacormediaBidAdapter.js +1 -1
  142. package/dist/targetVideoBidAdapter.js +1 -1
  143. package/dist/teadsBidAdapter.js +1 -1
  144. package/dist/trionBidAdapter.js +1 -1
  145. package/dist/tripleliftBidAdapter.js +1 -1
  146. package/dist/truereachBidAdapter.js +1 -1
  147. package/dist/ttdBidAdapter.js +1 -1
  148. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  149. package/dist/uid2IdSystem.js +1 -1
  150. package/dist/underdogmediaBidAdapter.js +1 -1
  151. package/dist/undertoneBidAdapter.js +1 -1
  152. package/dist/userId.js +1 -1
  153. package/dist/vidazooBidAdapter.js +1 -1
  154. package/dist/videobyteBidAdapter.js +1 -1
  155. package/dist/videoheroesBidAdapter.js +1 -1
  156. package/dist/vidoomyBidAdapter.js +1 -1
  157. package/dist/visiblemeasuresBidAdapter.js +1 -1
  158. package/dist/visxBidAdapter.js +1 -1
  159. package/dist/vrtcalBidAdapter.js +1 -1
  160. package/dist/vuukleBidAdapter.js +1 -1
  161. package/dist/widespaceBidAdapter.js +1 -1
  162. package/dist/winrBidAdapter.js +1 -1
  163. package/dist/yahoosspBidAdapter.js +1 -1
  164. package/dist/yieldmoBidAdapter.js +1 -1
  165. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  166. package/dist/yieldoneBidAdapter.js +1 -1
  167. package/integrationExamples/gpt/fledge_example.html +103 -0
  168. package/integrationExamples/gpt/prebidServer_fledge_example.html +111 -0
  169. package/libraries/domainOverrideToRootDomain/index.js +39 -0
  170. package/libraries/ortbConverter/processors/video.js +1 -0
  171. package/modules/acuityAdsBidAdapter.js +1 -1
  172. package/modules/admaticBidAdapter.js +7 -2
  173. package/modules/adnuntiusBidAdapter.js +3 -1
  174. package/modules/amxBidAdapter.js +1 -1
  175. package/modules/amxIdSystem.js +23 -20
  176. package/modules/amxIdSystem.md +7 -7
  177. package/modules/appnexusBidAdapter.js +108 -102
  178. package/modules/appushBidAdapter.js +1 -1
  179. package/modules/beyondmediaBidAdapter.js +1 -1
  180. package/modules/bidwatchAnalyticsAdapter.js +2 -0
  181. package/modules/braveBidAdapter.js +1 -1
  182. package/modules/brightcomBidAdapter.js +1 -1
  183. package/modules/brightcomSSPBidAdapter.js +1 -1
  184. package/modules/coinzillaBidAdapter.js +1 -2
  185. package/modules/compassBidAdapter.js +1 -1
  186. package/modules/connectIdSystem.js +96 -21
  187. package/modules/connectIdSystem.md +6 -5
  188. package/modules/contentexchangeBidAdapter.js +1 -1
  189. package/modules/conversantBidAdapter.js +3 -0
  190. package/modules/criteoBidAdapter.js +5 -1
  191. package/modules/eskimiBidAdapter.js +72 -0
  192. package/modules/eskimiBidAdapter.md +34 -0
  193. package/modules/freewheel-sspBidAdapter.js +8 -0
  194. package/modules/glimpseBidAdapter.js +1 -2
  195. package/modules/globalsunBidAdapter.js +1 -1
  196. package/modules/gridBidAdapter.js +43 -20
  197. package/modules/growthCodeIdSystem.js +18 -15
  198. package/modules/gumgumBidAdapter.js +1 -1
  199. package/modules/iqzoneBidAdapter.js +1 -1
  200. package/modules/ivsBidAdapter.js +85 -0
  201. package/modules/ivsBidAdapter.md +34 -0
  202. package/modules/ixBidAdapter.js +72 -105
  203. package/modules/jwplayerVideoProvider.js +25 -32
  204. package/modules/kargoBidAdapter.js +473 -246
  205. package/modules/koblerBidAdapter.js +1 -2
  206. package/modules/kueezBidAdapter.js +1 -1
  207. package/modules/kueezRtbBidAdapter.js +16 -4
  208. package/modules/liveIntentIdSystem.js +8 -0
  209. package/modules/luponmediaBidAdapter.js +1 -1
  210. package/modules/magniteAnalyticsAdapter.js +76 -3
  211. package/modules/mathildeadsBidAdapter.js +1 -1
  212. package/modules/medianetBidAdapter.js +1 -1
  213. package/modules/mediasquareBidAdapter.js +2 -1
  214. package/modules/mgidBidAdapter.js +178 -26
  215. package/modules/minutemediaBidAdapter.js +1 -1
  216. package/modules/minutemediaplusBidAdapter.js +16 -4
  217. package/modules/nativoBidAdapter.js +110 -21
  218. package/modules/neuwoRtdProvider.js +0 -2
  219. package/modules/oguryBidAdapter.js +3 -2
  220. package/modules/onomagicBidAdapter.js +1 -2
  221. package/modules/openxBidAdapter.js +192 -563
  222. package/modules/openxBidAdapter.md +22 -20
  223. package/modules/openxOrtbBidAdapter.js +13 -11
  224. package/modules/openxOrtbBidAdapter.md +5 -3
  225. package/modules/operaadsBidAdapter.js +1 -1
  226. package/modules/pairIdSystem.js +79 -0
  227. package/modules/pubmaticBidAdapter.js +13 -10
  228. package/modules/pubxBidAdapter.js +5 -2
  229. package/modules/riseBidAdapter.js +1 -1
  230. package/modules/sharedIdSystem.js +4 -27
  231. package/modules/sharethroughBidAdapter.js +1 -1
  232. package/modules/shinezBidAdapter.js +1 -1
  233. package/modules/smarthubBidAdapter.js +1 -1
  234. package/modules/synacormediaBidAdapter.js +1 -3
  235. package/modules/truereachBidAdapter.js +1 -2
  236. package/modules/userId/eids.js +24 -0
  237. package/modules/userId/eids.md +16 -0
  238. package/modules/videoheroesBidAdapter.js +1 -1
  239. package/modules/vidoomyBidAdapter.js +33 -4
  240. package/modules/visiblemeasuresBidAdapter.js +1 -1
  241. package/modules/vrtcalBidAdapter.js +1 -1
  242. package/modules/yieldmoBidAdapter.js +15 -5
  243. package/modules/yieldoneBidAdapter.js +1 -1
  244. package/package.json +1 -1
  245. package/src/Renderer.js +2 -1
  246. package/src/config.js +78 -127
  247. package/src/native.js +5 -1
  248. package/test/spec/auctionmanager_spec.js +2 -2
  249. package/test/spec/libraries/domainOverrideToRootDomain/index_spec.js +77 -0
  250. package/test/spec/modules/1plusXRtdProvider_spec.js +8 -7
  251. package/test/spec/modules/acuityAdsBidAdapter_spec.js +2 -1
  252. package/test/spec/modules/adagioBidAdapter_spec.js +0 -25
  253. package/test/spec/modules/admaticBidAdapter_spec.js +1 -1
  254. package/test/spec/modules/adnuntiusBidAdapter_spec.js +2 -1
  255. package/test/spec/modules/amxIdSystem_spec.js +13 -26
  256. package/test/spec/modules/appnexusBidAdapter_spec.js +464 -448
  257. package/test/spec/modules/appushBidAdapter_spec.js +2 -1
  258. package/test/spec/modules/axonixBidAdapter_spec.js +0 -27
  259. package/test/spec/modules/beyondmediaBidAdapter_spec.js +2 -1
  260. package/test/spec/modules/big-richmediaBidAdapter_spec.js +68 -64
  261. package/test/spec/modules/compassBidAdapter_spec.js +2 -1
  262. package/test/spec/modules/connectIdSystem_spec.js +420 -242
  263. package/test/spec/modules/contentexchangeBidAdapter_spec.js +2 -1
  264. package/test/spec/modules/conversantBidAdapter_spec.js +1 -0
  265. package/test/spec/modules/criteoBidAdapter_spec.js +33 -1
  266. package/test/spec/modules/eids_spec.js +30 -0
  267. package/test/spec/modules/eskimiBidAdapter_spec.js +155 -0
  268. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +37 -0
  269. package/test/spec/modules/globalsunBidAdapter_spec.js +2 -1
  270. package/test/spec/modules/gridBidAdapter_spec.js +8 -0
  271. package/test/spec/modules/iqzoneBidAdapter_spec.js +2 -1
  272. package/test/spec/modules/ivsBidAdapter_spec.js +197 -0
  273. package/test/spec/modules/ixBidAdapter_spec.js +141 -71
  274. package/test/spec/modules/kargoBidAdapter_spec.js +297 -140
  275. package/test/spec/modules/koblerBidAdapter_spec.js +0 -20
  276. package/test/spec/modules/kueezRtbBidAdapter_spec.js +22 -2
  277. package/test/spec/modules/liveIntentIdSystem_spec.js +10 -0
  278. package/test/spec/modules/luponmediaBidAdapter_spec.js +1 -1
  279. package/test/spec/modules/magniteAnalyticsAdapter_spec.js +129 -1
  280. package/test/spec/modules/mathildeadsBidAdapter_spec.js +2 -1
  281. package/test/spec/modules/mgidBidAdapter_spec.js +184 -36
  282. package/test/spec/modules/minutemediaplusBidAdapter_spec.js +22 -2
  283. package/test/spec/modules/nativoBidAdapter_spec.js +101 -0
  284. package/test/spec/modules/neuwoRtdProvider_spec.js +0 -1
  285. package/test/spec/modules/oguryBidAdapter_spec.js +19 -4
  286. package/test/spec/modules/ooloAnalyticsAdapter_spec.js +1 -1
  287. package/test/spec/modules/openxBidAdapter_spec.js +1157 -1936
  288. package/test/spec/modules/openxOrtbBidAdapter_spec.js +12 -39
  289. package/test/spec/modules/pairIdSystem_spec.js +68 -0
  290. package/test/spec/modules/pubCommonId_spec.js +0 -17
  291. package/test/spec/modules/pubmaticBidAdapter_spec.js +868 -867
  292. package/test/spec/modules/pubxBidAdapter_spec.js +10 -2
  293. package/test/spec/modules/realvuAnalyticsAdapter_spec.js +0 -5
  294. package/test/spec/modules/sharedIdSystem_spec.js +0 -46
  295. package/test/spec/modules/sharethroughBidAdapter_spec.js +2 -1
  296. package/test/spec/modules/smarthubBidAdapter_spec.js +2 -1
  297. package/test/spec/modules/synacormediaBidAdapter_spec.js +0 -26
  298. package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +17 -4
  299. package/test/spec/modules/vidoomyBidAdapter_spec.js +58 -0
  300. package/test/spec/modules/visiblemeasuresBidAdapter_spec.js +2 -1
  301. package/test/spec/modules/vrtcalBidAdapter_spec.js +3 -2
  302. package/test/spec/modules/yieldmoBidAdapter_spec.js +19 -1
  303. package/test/spec/renderer_spec.js +1 -2
  304. package/test/spec/unit/pbjs_api_spec.js +19 -3
  305. package/test/test_index.js +13 -3
  306. package/dist/gridNMBidAdapter.js +0 -1
  307. package/modules/gridNMBidAdapter.js +0 -422
  308. package/modules/gridNMBidAdapter.md +0 -39
  309. package/test/spec/modules/gridNMBidAdapter_spec.js +0 -636
@@ -1,295 +1,522 @@
1
- import { _each, buildUrl, deepAccess, pick, triggerPixel } from '../src/utils.js';
1
+ import { _each, isEmpty, buildUrl, deepAccess, pick, triggerPixel } from '../src/utils.js';
2
2
  import { config } from '../src/config.js';
3
3
  import { registerBidder } from '../src/adapters/bidderFactory.js';
4
4
  import { getStorageManager } from '../src/storageManager.js';
5
5
  import { BANNER, VIDEO } from '../src/mediaTypes.js';
6
6
 
7
- const BIDDER_CODE = 'kargo';
8
- const HOST = 'https://krk.kargo.com';
9
- const SYNC = 'https://crb.kargo.com/api/v1/initsyncrnd/{UUID}?seed={SEED}&idx={INDEX}&gdpr={GDPR}&gdpr_consent={GDPR_CONSENT}&us_privacy={US_PRIVACY}';
10
- const PREBID_VERSION = '$prebid.version$';
11
- const SYNC_COUNT = 5;
12
- const GVLID = 972;
13
- const SUPPORTED_MEDIA_TYPES = [BANNER, VIDEO];
14
- const storage = getStorageManager({bidderCode: BIDDER_CODE});
7
+ const PREBID_VERSION = '$prebid.version$'
8
+
9
+ const BIDDER = Object.freeze({
10
+ CODE: 'kargo',
11
+ HOST: 'krk2.kargo.com',
12
+ REQUEST_METHOD: 'POST',
13
+ REQUEST_ENDPOINT: '/api/v1/prebid',
14
+ TIMEOUT_ENDPOINT: '/api/v1/event/timeout',
15
+ GVLID: 972,
16
+ SUPPORTED_MEDIA_TYPES: [BANNER, VIDEO],
17
+ });
18
+
19
+ const STORAGE = getStorageManager({bidderCode: BIDDER.CODE});
20
+
21
+ const CURRENCY = Object.freeze({
22
+ KEY: 'currency',
23
+ US_DOLLAR: 'USD',
24
+ });
25
+
26
+ const REQUEST_KEYS = Object.freeze({
27
+ SOCIAL_CANVAS: 'params.socialCanvas',
28
+ SUA: 'ortb2.device.sua',
29
+ TDID_ADAPTER: 'userId.tdid',
30
+ });
31
+
32
+ const SUA = Object.freeze({
33
+ BROWSERS: 'browsers',
34
+ MOBILE: 'mobile',
35
+ MODEL: 'model',
36
+ PLATFORM: 'platform',
37
+ SOURCE: 'source',
38
+ });
39
+
40
+ const SUA_ATTRIBUTES = [
41
+ SUA.BROWSERS,
42
+ SUA.MOBILE,
43
+ SUA.MODEL,
44
+ SUA.SOURCE,
45
+ SUA.PLATFORM,
46
+ ];
47
+
48
+ const CERBERUS = Object.freeze({
49
+ KEY: 'krg_crb',
50
+ SYNC_URL: 'https://crb.kargo.com/api/v1/initsyncrnd/{UUID}?seed={SEED}&idx={INDEX}&gdpr={GDPR}&gdpr_consent={GDPR_CONSENT}&us_privacy={US_PRIVACY}&gpp={GPP_STRING}&gpp_sid={GPP_SID}',
51
+ SYNC_COUNT: 5,
52
+ PAGE_VIEW_ID: 'pageViewId',
53
+ PAGE_VIEW_TIMESTAMP: 'pageViewTimestamp',
54
+ PAGE_VIEW_URL: 'pageViewUrl'
55
+ });
15
56
 
16
57
  let sessionId,
17
58
  lastPageUrl,
18
59
  requestCounter;
19
60
 
20
- export const spec = {
21
- gvlid: GVLID,
22
- code: BIDDER_CODE,
23
- isBidRequestValid: function(bid) {
24
- if (!bid || !bid.params) {
25
- return false;
26
- }
61
+ function isBidRequestValid(bid) {
62
+ if (!bid || !bid.params) {
63
+ return false;
64
+ }
27
65
 
28
- return !!bid.params.placementId;
29
- },
30
- buildRequests: function(validBidRequests, bidderRequest) {
31
- const currencyObj = config.getConfig('currency');
32
- const currency = (currencyObj && currencyObj.adServerCurrency) || 'USD';
33
- const bidIDs = {};
34
- const bidSizes = {};
35
-
36
- _each(validBidRequests, bid => {
37
- bidIDs[bid.bidId] = bid.params.placementId;
38
- bidSizes[bid.bidId] = bid.sizes;
39
- });
66
+ return !!bid.params.placementId;
67
+ }
68
+
69
+ function buildRequests(validBidRequests, bidderRequest) {
70
+ const currencyObj = config.getConfig(CURRENCY.KEY);
71
+ const currency = (currencyObj && currencyObj.adServerCurrency) ? currencyObj.adServerCurrency : null;
72
+ const impressions = [];
73
+
74
+ _each(validBidRequests, bid => {
75
+ impressions.push(getImpression(bid))
76
+ });
77
+
78
+ const firstBidRequest = validBidRequests[0];
79
+ const tdidAdapter = deepAccess(firstBidRequest, REQUEST_KEYS.TDID_ADAPTER);
80
+
81
+ const metadata = getAllMetadata(bidderRequest);
82
+
83
+ const krakenParams = Object.assign({}, {
84
+ pbv: PREBID_VERSION,
85
+ aid: firstBidRequest.auctionId,
86
+ sid: _getSessionId(),
87
+ url: metadata.pageURL,
88
+ timeout: bidderRequest.timeout,
89
+ ts: new Date().getTime(),
90
+ device: {
91
+ size: [
92
+ window.screen.width,
93
+ window.screen.height
94
+ ]
95
+ },
96
+ imp: impressions,
97
+ user: getUserIds(tdidAdapter, bidderRequest.uspConsent, bidderRequest.gdprConsent, firstBidRequest.userIdAsEids, bidderRequest.gppConsent),
98
+ });
99
+
100
+ const reqCount = getRequestCount()
101
+ if (reqCount != null) {
102
+ krakenParams.requestCount = reqCount;
103
+ }
40
104
 
41
- const firstBidRequest = validBidRequests[0];
42
-
43
- const tdid = deepAccess(firstBidRequest, 'userId.tdid')
44
-
45
- const transformedParams = Object.assign({}, {
46
- sessionId: spec._getSessionId(),
47
- requestCount: spec._getRequestCount(),
48
- timeout: bidderRequest.timeout,
49
- currency,
50
- cpmGranularity: 1,
51
- timestamp: (new Date()).getTime(),
52
- cpmRange: {
53
- floor: 0,
54
- ceil: 20
55
- },
56
- bidIDs,
57
- bidSizes,
58
- device: {
59
- width: window.screen.width,
60
- height: window.screen.height
61
- },
62
- prebidRawBidRequests: validBidRequests,
63
- prebidVersion: PREBID_VERSION
64
- }, spec._getAllMetadata(bidderRequest, tdid));
65
-
66
- // User Agent Client Hints / SUA
67
- const uaClientHints = deepAccess(firstBidRequest, 'ortb2.device.sua');
68
- if (uaClientHints) {
69
- transformedParams.device.sua = pick(uaClientHints, ['browsers', 'platform', 'mobile', 'model']);
70
- }
105
+ if (currency != null && currency != CURRENCY.US_DOLLAR) {
106
+ krakenParams.cur = currency;
107
+ }
71
108
 
72
- // Pull Social Canvas segments and embed URL
73
- const socialCanvas = deepAccess(firstBidRequest, 'params.socialCanvas');
74
- if (socialCanvas) {
75
- transformedParams.socialCanvasSegments = socialCanvas.segments;
76
- transformedParams.socialEmbedURL = socialCanvas.embedURL;
77
- }
109
+ if (metadata.rawCRB != null) {
110
+ krakenParams.rawCRB = metadata.rawCRB
111
+ }
78
112
 
79
- const encodedParams = encodeURIComponent(JSON.stringify(transformedParams));
80
- return Object.assign({}, bidderRequest, {
81
- method: 'GET',
82
- url: `${HOST}/api/v2/bid`,
83
- data: `json=${encodedParams}`,
84
- currency: currency
85
- });
86
- },
87
- interpretResponse: function(response, bidRequest) {
88
- let bids = response.body;
89
- const bidResponses = [];
90
- for (let bidId in bids) {
91
- let adUnit = bids[bidId];
92
- let meta = {
93
- mediaType: BANNER
94
- };
95
-
96
- if (adUnit.metadata && adUnit.metadata.landingPageDomain) {
97
- meta.clickUrl = adUnit.metadata.landingPageDomain[0];
98
- meta.advertiserDomains = adUnit.metadata.landingPageDomain;
113
+ if (metadata.rawCRBLocalStorage != null) {
114
+ krakenParams.rawCRBLocalStorage = metadata.rawCRBLocalStorage
115
+ }
116
+
117
+ // Pull Social Canvas segments and embed URL
118
+ const socialCanvas = deepAccess(firstBidRequest, REQUEST_KEYS.SOCIAL_CANVAS);
119
+
120
+ if (socialCanvas != null) {
121
+ krakenParams.socan = socialCanvas;
122
+ }
123
+
124
+ // User Agent Client Hints / SUA
125
+ const uaClientHints = deepAccess(firstBidRequest, REQUEST_KEYS.SUA);
126
+ if (uaClientHints) {
127
+ const suaValidAttributes = []
128
+
129
+ SUA_ATTRIBUTES.forEach(suaKey => {
130
+ const suaValue = uaClientHints[suaKey];
131
+ if (!suaValue) {
132
+ return;
99
133
  }
100
134
 
101
- if (adUnit.mediaType && SUPPORTED_MEDIA_TYPES.includes(adUnit.mediaType)) {
102
- meta.mediaType = adUnit.mediaType;
135
+ // Do not pass any empty strings
136
+ if (typeof suaValue == 'string' && suaValue.trim() === '') {
137
+ return;
103
138
  }
104
139
 
105
- const bidResponse = {
106
- ad: adUnit.adm,
107
- requestId: bidId,
108
- cpm: Number(adUnit.cpm),
109
- width: adUnit.width,
110
- height: adUnit.height,
111
- ttl: 300,
112
- creativeId: adUnit.id,
113
- dealId: adUnit.targetingCustom,
114
- netRevenue: true,
115
- currency: adUnit.currency || bidRequest.currency,
116
- mediaType: meta.mediaType,
117
- meta: meta
118
- };
119
-
120
- if (meta.mediaType == VIDEO) {
121
- if (adUnit.admUrl) {
122
- bidResponse.vastUrl = adUnit.admUrl;
123
- } else {
124
- bidResponse.vastXml = adUnit.adm;
125
- }
140
+ switch (suaKey) {
141
+ case SUA.MOBILE && suaValue < 1: // Do not pass 0 value for mobile
142
+ case SUA.SOURCE && suaValue < 1: // Do not pass 0 value for source
143
+ break;
144
+ default:
145
+ suaValidAttributes.push(suaKey);
126
146
  }
147
+ });
127
148
 
128
- bidResponses.push(bidResponse);
129
- }
149
+ krakenParams.device.sua = pick(uaClientHints, suaValidAttributes);
150
+ }
151
+
152
+ const validPageId = getLocalStorageSafely(CERBERUS.PAGE_VIEW_ID) != null
153
+ const validPageTimestamp = getLocalStorageSafely(CERBERUS.PAGE_VIEW_TIMESTAMP) != null
154
+ const validPageUrl = getLocalStorageSafely(CERBERUS.PAGE_VIEW_URL) != null
155
+
156
+ const page = {}
157
+ if (validPageId) {
158
+ page.id = getLocalStorageSafely(CERBERUS.PAGE_VIEW_ID);
159
+ }
160
+ if (validPageTimestamp) {
161
+ page.timestamp = Number(getLocalStorageSafely(CERBERUS.PAGE_VIEW_TIMESTAMP));
162
+ }
163
+ if (validPageUrl) {
164
+ page.url = getLocalStorageSafely(CERBERUS.PAGE_VIEW_URL);
165
+ }
166
+ if (!isEmpty(page)) {
167
+ krakenParams.page = page;
168
+ }
130
169
 
170
+ return Object.assign({}, bidderRequest, {
171
+ method: BIDDER.REQUEST_METHOD,
172
+ url: `https://${BIDDER.HOST}${BIDDER.REQUEST_ENDPOINT}`,
173
+ data: krakenParams,
174
+ currency: currency
175
+ });
176
+ }
177
+
178
+ function interpretResponse(response, bidRequest) {
179
+ let bids = response.body;
180
+ const bidResponses = [];
181
+
182
+ if (isEmpty(bids)) {
131
183
  return bidResponses;
132
- },
133
- getUserSyncs: function(syncOptions, responses, gdprConsent, usPrivacy) {
134
- const syncs = [];
135
- const seed = spec._generateRandomUuid();
136
- const clientId = spec._getClientId();
137
- var gdpr = (gdprConsent && gdprConsent.gdprApplies) ? 1 : 0;
138
- var gdprConsentString = (gdprConsent && gdprConsent.consentString) ? gdprConsent.consentString : '';
139
- // don't sync if opted out via usPrivacy
140
- if (typeof usPrivacy == 'string' && usPrivacy.length == 4 && usPrivacy[0] == 1 && usPrivacy[2] == 'Y') {
141
- return syncs;
184
+ }
185
+
186
+ if (typeof bids !== 'object') {
187
+ return bidResponses;
188
+ }
189
+
190
+ Object.entries(bids).forEach((entry) => {
191
+ const [bidID, adUnit] = entry;
192
+
193
+ let meta = {
194
+ mediaType: adUnit.mediaType && BIDDER.SUPPORTED_MEDIA_TYPES.includes(adUnit.mediaType) ? adUnit.mediaType : BANNER
195
+ };
196
+
197
+ if (adUnit.metadata && adUnit.metadata.landingPageDomain) {
198
+ meta.clickUrl = adUnit.metadata.landingPageDomain[0];
199
+ meta.advertiserDomains = adUnit.metadata.landingPageDomain;
142
200
  }
143
- if (syncOptions.iframeEnabled && seed && clientId) {
144
- for (let i = 0; i < SYNC_COUNT; i++) {
145
- syncs.push({
146
- type: 'iframe',
147
- url: SYNC.replace('{UUID}', clientId).replace('{SEED}', seed)
148
- .replace('{INDEX}', i)
149
- .replace('{GDPR}', gdpr)
150
- .replace('{GDPR_CONSENT}', gdprConsentString)
151
- .replace('{US_PRIVACY}', usPrivacy || '')
152
- });
201
+
202
+ const bidResponse = {
203
+ requestId: bidID,
204
+ cpm: Number(adUnit.cpm),
205
+ width: adUnit.width,
206
+ height: adUnit.height,
207
+ ttl: 300,
208
+ creativeId: adUnit.id,
209
+ dealId: adUnit.targetingCustom,
210
+ netRevenue: true,
211
+ currency: adUnit.currency || bidRequest.currency,
212
+ mediaType: meta.mediaType,
213
+ meta: meta
214
+ };
215
+
216
+ if (meta.mediaType == VIDEO) {
217
+ if (adUnit.admUrl) {
218
+ bidResponse.vastUrl = adUnit.admUrl;
219
+ } else {
220
+ bidResponse.vastXml = adUnit.adm;
153
221
  }
222
+ } else {
223
+ bidResponse.ad = adUnit.adm;
154
224
  }
225
+
226
+ bidResponses.push(bidResponse);
227
+ })
228
+
229
+ return bidResponses;
230
+ }
231
+
232
+ function getUserSyncs(syncOptions, _, gdprConsent, usPrivacy, gppConsent) {
233
+ const syncs = [];
234
+ const seed = _generateRandomUUID();
235
+ const clientId = getClientId();
236
+
237
+ var gdpr = (gdprConsent && gdprConsent.gdprApplies) ? 1 : 0;
238
+ var gdprConsentString = (gdprConsent && gdprConsent.consentString) ? gdprConsent.consentString : '';
239
+
240
+ var gppString = (gppConsent && gppConsent.consentString) ? gppConsent.consentString : '';
241
+ var gppApplicableSections = (gppConsent && gppConsent.applicableSections && Array.isArray(gppConsent.applicableSections)) ? gppConsent.applicableSections.join(',') : '';
242
+
243
+ // don't sync if opted out via usPrivacy
244
+ if (typeof usPrivacy == 'string' && usPrivacy.length == 4 && usPrivacy[0] == 1 && usPrivacy[2] == 'Y') {
155
245
  return syncs;
156
- },
157
- supportedMediaTypes: SUPPORTED_MEDIA_TYPES,
158
- onTimeout: function(timeoutData) {
159
- if (timeoutData == null) {
160
- return;
246
+ }
247
+ if (syncOptions.iframeEnabled && seed && clientId) {
248
+ for (let i = 0; i < CERBERUS.SYNC_COUNT; i++) {
249
+ syncs.push({
250
+ type: 'iframe',
251
+ url: CERBERUS.SYNC_URL.replace('{UUID}', clientId)
252
+ .replace('{SEED}', seed)
253
+ .replace('{INDEX}', i)
254
+ .replace('{GDPR}', gdpr)
255
+ .replace('{GDPR_CONSENT}', gdprConsentString)
256
+ .replace('{US_PRIVACY}', usPrivacy || '')
257
+ .replace('{GPP_STRING}', gppString)
258
+ .replace('{GPP_SID}', gppApplicableSections)
259
+ });
161
260
  }
261
+ }
262
+ return syncs;
263
+ }
162
264
 
163
- timeoutData.forEach((bid) => {
164
- this._sendTimeoutData(bid.auctionId, bid.timeout);
165
- });
166
- },
167
-
168
- _getCrbFromCookie() {
169
- try {
170
- const crb = JSON.parse(storage.getCookie('krg_crb'));
171
- if (crb && crb.v) {
172
- let vParsed = JSON.parse(atob(crb.v));
173
- if (vParsed) {
174
- return vParsed;
175
- }
265
+ function onTimeout(timeoutData) {
266
+ if (timeoutData == null) {
267
+ return;
268
+ }
269
+
270
+ timeoutData.forEach((bid) => {
271
+ sendTimeoutData(bid.auctionId, bid.timeout);
272
+ });
273
+ }
274
+
275
+ function _generateRandomUUID() {
276
+ try {
277
+ // crypto.getRandomValues is supported everywhere but Opera Mini for years
278
+ var buffer = new Uint8Array(16);
279
+ crypto.getRandomValues(buffer);
280
+ buffer[6] = (buffer[6] & ~176) | 64;
281
+ buffer[8] = (buffer[8] & ~64) | 128;
282
+ var hex = Array.prototype.map.call(new Uint8Array(buffer), function(x) {
283
+ return ('00' + x.toString(16)).slice(-2);
284
+ }).join('');
285
+ return hex.slice(0, 8) + '-' + hex.slice(8, 12) + '-' + hex.slice(12, 16) + '-' + hex.slice(16, 20) + '-' + hex.slice(20);
286
+ } catch (e) {
287
+ return '';
288
+ }
289
+ }
290
+
291
+ function _getCrb() {
292
+ let localStorageCrb = getCrbFromLocalStorage();
293
+ if (Object.keys(localStorageCrb).length) {
294
+ return localStorageCrb;
295
+ }
296
+ return getCrbFromCookie();
297
+ }
298
+
299
+ function _getSessionId() {
300
+ if (!sessionId) {
301
+ sessionId = _generateRandomUUID();
302
+ }
303
+ return sessionId;
304
+ }
305
+
306
+ function getCrbFromCookie() {
307
+ try {
308
+ const crb = JSON.parse(STORAGE.getCookie(CERBERUS.KEY));
309
+ if (crb && crb.v) {
310
+ let vParsed = JSON.parse(atob(crb.v));
311
+ if (vParsed) {
312
+ return vParsed;
176
313
  }
177
- return {};
178
- } catch (e) {
179
- return {};
180
314
  }
181
- },
315
+ return {};
316
+ } catch (e) {
317
+ return {};
318
+ }
319
+ }
320
+
321
+ function getCrbFromLocalStorage() {
322
+ try {
323
+ return JSON.parse(atob(getLocalStorageSafely(CERBERUS.KEY)));
324
+ } catch (e) {
325
+ return {};
326
+ }
327
+ }
328
+
329
+ function getLocalStorageSafely(key) {
330
+ try {
331
+ return STORAGE.getDataFromLocalStorage(key);
332
+ } catch (e) {
333
+ return null;
334
+ }
335
+ }
336
+
337
+ function getUserIds(tdidAdapter, usp, gdpr, eids, gpp) {
338
+ const crb = spec._getCrb();
339
+ const userIds = {
340
+ crbIDs: crb.syncIds || {}
341
+ };
342
+
343
+ // Pull Trade Desk ID from adapter
344
+ if (tdidAdapter) {
345
+ userIds.tdID = tdidAdapter;
346
+ }
347
+
348
+ // Pull Trade Desk ID from our storage
349
+ if (!tdidAdapter && crb.tdID) {
350
+ userIds.tdID = crb.tdID;
351
+ }
182
352
 
183
- _getCrbFromLocalStorage() {
184
- try {
185
- return JSON.parse(atob(spec._getLocalStorageSafely('krg_crb')));
186
- } catch (e) {
187
- return {};
353
+ if (usp) {
354
+ userIds.usp = usp;
355
+ }
356
+
357
+ try {
358
+ if (gdpr) {
359
+ userIds['gdpr'] = {
360
+ consent: gdpr.consentString || '',
361
+ applies: !!gdpr.gdprApplies,
362
+ }
188
363
  }
189
- },
364
+ } catch (e) {
365
+ }
190
366
 
191
- _getCrb() {
192
- let localStorageCrb = spec._getCrbFromLocalStorage();
193
- if (Object.keys(localStorageCrb).length) {
194
- return localStorageCrb;
367
+ if (crb.lexId != null) {
368
+ userIds.kargoID = crb.lexId;
369
+ }
370
+
371
+ if (crb.clientId != null) {
372
+ userIds.clientID = crb.clientId;
373
+ }
374
+
375
+ if (crb.optOut != null) {
376
+ userIds.optOut = crb.optOut;
377
+ }
378
+
379
+ if (eids != null) {
380
+ userIds.sharedIDEids = eids;
381
+ }
382
+
383
+ if (gpp) {
384
+ const parsedGPP = {}
385
+ if (gpp && gpp.consentString) {
386
+ parsedGPP.gppString = gpp.consentString
195
387
  }
196
- return spec._getCrbFromCookie();
197
- },
198
-
199
- _getLocalStorageSafely(key) {
200
- try {
201
- return storage.getDataFromLocalStorage(key);
202
- } catch (e) {
203
- return null;
388
+ if (gpp && gpp.applicableSections) {
389
+ parsedGPP.applicableSections = gpp.applicableSections
204
390
  }
205
- },
206
-
207
- _getUserIds(tdid, usp, gdpr) {
208
- const crb = spec._getCrb();
209
- const userIds = {
210
- kargoID: crb.lexId,
211
- clientID: crb.clientId,
212
- crbIDs: crb.syncIds || {},
213
- optOut: crb.optOut,
214
- usp: usp
215
- };
391
+ if (!isEmpty(parsedGPP)) {
392
+ userIds.gpp = parsedGPP
393
+ }
394
+ }
216
395
 
217
- try {
218
- if (gdpr) {
219
- userIds['gdpr'] = {
220
- consent: gdpr.consentString || '',
221
- applies: !!gdpr.gdprApplies,
222
- }
223
- }
224
- } catch (e) {
396
+ return userIds;
397
+ }
398
+
399
+ function getClientId() {
400
+ const crb = spec._getCrb();
401
+ return crb.clientId;
402
+ }
403
+
404
+ function getAllMetadata(bidderRequest) {
405
+ return {
406
+ pageURL: bidderRequest?.refererInfo?.page,
407
+ rawCRB: STORAGE.getCookie(CERBERUS.KEY),
408
+ rawCRBLocalStorage: getLocalStorageSafely(CERBERUS.KEY)
409
+ };
410
+ }
411
+
412
+ function getRequestCount() {
413
+ if (lastPageUrl === window.location.pathname) {
414
+ return ++requestCounter;
415
+ }
416
+ lastPageUrl = window.location.pathname;
417
+ return requestCounter = 0;
418
+ }
419
+
420
+ function sendTimeoutData(auctionId, auctionTimeout) {
421
+ let params = {
422
+ aid: auctionId,
423
+ ato: auctionTimeout
424
+ };
425
+
426
+ try {
427
+ let timeoutRequestUrl = buildUrl({
428
+ protocol: 'https',
429
+ hostname: BIDDER.HOST,
430
+ pathname: BIDDER.TIMEOUT_ENDPOINT,
431
+ search: params
432
+ });
433
+
434
+ triggerPixel(timeoutRequestUrl);
435
+ } catch (e) {}
436
+ }
437
+
438
+ function getImpression(bid) {
439
+ const imp = {
440
+ id: bid.bidId,
441
+ tid: bid.transactionId,
442
+ pid: bid.params.placementId,
443
+ code: bid.adUnitCode
444
+ };
445
+
446
+ if (bid.floorData != null && bid.floorData.floorMin > 0) {
447
+ imp.floor = bid.floorData.floorMin;
448
+ }
449
+
450
+ if (bid.bidRequestsCount > 0) {
451
+ imp.bidRequestCount = bid.bidRequestsCount;
452
+ }
453
+
454
+ if (bid.bidderRequestsCount > 0) {
455
+ imp.bidderRequestCount = bid.bidderRequestsCount;
456
+ }
457
+
458
+ if (bid.bidderWinsCount > 0) {
459
+ imp.bidderWinCount = bid.bidderWinsCount;
460
+ }
461
+
462
+ const gpid = getGPID(bid)
463
+ if (gpid != null && gpid != '') {
464
+ imp.fpd = {
465
+ gpid: gpid
225
466
  }
226
- if (tdid) {
227
- userIds.tdID = tdid;
467
+ }
468
+
469
+ if (bid.mediaTypes != null) {
470
+ if (bid.mediaTypes.banner != null) {
471
+ imp.banner = bid.mediaTypes.banner;
228
472
  }
229
- return userIds;
230
- },
231
-
232
- _getClientId() {
233
- const crb = spec._getCrb();
234
- return crb.clientId;
235
- },
236
-
237
- _getAllMetadata(bidderRequest, tdid) {
238
- return {
239
- userIDs: spec._getUserIds(tdid, bidderRequest.uspConsent, bidderRequest.gdprConsent),
240
- pageURL: bidderRequest?.refererInfo?.page,
241
- rawCRB: storage.getCookie('krg_crb'),
242
- rawCRBLocalStorage: spec._getLocalStorageSafely('krg_crb')
243
- };
244
- },
245
473
 
246
- _getSessionId() {
247
- if (!sessionId) {
248
- sessionId = spec._generateRandomUuid();
474
+ if (bid.mediaTypes.video != null) {
475
+ imp.video = bid.mediaTypes.video;
249
476
  }
250
- return sessionId;
251
- },
252
477
 
253
- _getRequestCount() {
254
- if (lastPageUrl === window.location.pathname) {
255
- return ++requestCounter;
478
+ if (bid.mediaTypes.native != null) {
479
+ imp.native = bid.mediaTypes.native;
256
480
  }
257
- lastPageUrl = window.location.pathname;
258
- return requestCounter = 0;
259
- },
260
-
261
- _generateRandomUuid() {
262
- try {
263
- // crypto.getRandomValues is supported everywhere but Opera Mini for years
264
- var buffer = new Uint8Array(16);
265
- crypto.getRandomValues(buffer);
266
- buffer[6] = (buffer[6] & ~176) | 64;
267
- buffer[8] = (buffer[8] & ~64) | 128;
268
- var hex = Array.prototype.map.call(new Uint8Array(buffer), function(x) {
269
- return ('00' + x.toString(16)).slice(-2);
270
- }).join('');
271
- return hex.slice(0, 8) + '-' + hex.slice(8, 12) + '-' + hex.slice(12, 16) + '-' + hex.slice(16, 20) + '-' + hex.slice(20);
272
- } catch (e) {
273
- return '';
481
+ }
482
+
483
+ return imp
484
+ }
485
+
486
+ function getGPID(bid) {
487
+ if (bid.ortb2Imp != null) {
488
+ if (bid.ortb2Imp.gpid != null && bid.ortb2Imp.gpid != '') {
489
+ return bid.ortb2Imp.gpid;
274
490
  }
275
- },
276
491
 
277
- _sendTimeoutData(auctionId, auctionTimeout) {
278
- let params = {
279
- aid: auctionId,
280
- ato: auctionTimeout,
281
- };
492
+ if (bid.ortb2Imp.ext != null && bid.ortb2Imp.ext.data != null) {
493
+ if (bid.ortb2Imp.ext.data.pbAdSlot != null && bid.ortb2Imp.ext.data.pbAdSlot != '') {
494
+ return bid.ortb2Imp.ext.data.pbAdSlot;
495
+ }
282
496
 
283
- try {
284
- let timeoutRequestUrl = buildUrl({
285
- protocol: 'https',
286
- hostname: 'krk.kargo.com',
287
- pathname: '/api/v1/event/timeout',
288
- search: params
289
- });
497
+ if (bid.ortb2Imp.ext.data.adServer != null && bid.ortb2Imp.ext.data.adServer.adSlot != null && bid.ortb2Imp.ext.data.adServer.adSlot != '') {
498
+ return bid.ortb2Imp.ext.data.adServer.adSlot;
499
+ }
500
+ }
501
+ }
290
502
 
291
- triggerPixel(timeoutRequestUrl);
292
- } catch (e) {}
503
+ if (bid.adUnitCode != null && bid.adUnitCode != '') {
504
+ return bid.adUnitCode;
293
505
  }
506
+ return '';
507
+ }
508
+
509
+ export const spec = {
510
+ gvlid: BIDDER.GVLID,
511
+ code: BIDDER.CODE,
512
+ isBidRequestValid,
513
+ buildRequests,
514
+ interpretResponse,
515
+ getUserSyncs,
516
+ supportedMediaTypes: BIDDER.SUPPORTED_MEDIA_TYPES,
517
+ onTimeout,
518
+ _getCrb,
519
+ _getSessionId
294
520
  };
521
+
295
522
  registerBidder(spec);