prebid.js 6.6.0 → 6.10.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 (271) hide show
  1. package/.eslintrc.js +8 -1
  2. package/allowedModules.js +4 -7
  3. package/integrationExamples/gpt/amp/creative.html +11 -33
  4. package/integrationExamples/gpt/{haloRtdProvider_example.html → hadronRtdProvider_example.html} +9 -9
  5. package/integrationExamples/gpt/idImportLibrary_example.html +2 -2
  6. package/integrationExamples/gpt/userId_example.html +2 -2
  7. package/integrationExamples/gpt/weboramaRtdProvider_example.html +154 -115
  8. package/integrationExamples/gpt/x-domain/creative.html +63 -29
  9. package/modules/.submodules.json +3 -0
  10. package/modules/adagioBidAdapter.js +1 -9
  11. package/modules/adagioBidAdapter.md +1 -1
  12. package/modules/adbookpspBidAdapter.js +29 -12
  13. package/modules/adhashBidAdapter.js +4 -4
  14. package/modules/adkernelBidAdapter.js +2 -2
  15. package/modules/adlooxAnalyticsAdapter.js +1 -1
  16. package/modules/adlooxRtdProvider.js +1 -1
  17. package/modules/adnowBidAdapter.js +1 -1
  18. package/modules/adnuntiusRtdProvider.js +96 -0
  19. package/modules/adnuntiusRtdProvider.md +41 -0
  20. package/modules/adomikAnalyticsAdapter.js +2 -2
  21. package/modules/adotBidAdapter.js +1 -1
  22. package/modules/adpod.js +14 -17
  23. package/modules/adrelevantisBidAdapter.js +2 -2
  24. package/modules/adtargetBidAdapter.js +1 -1
  25. package/modules/adtelligentBidAdapter.js +1 -1
  26. package/modules/advangelistsBidAdapter.js +2 -2
  27. package/modules/adxpremiumAnalyticsAdapter.js +1 -1
  28. package/modules/adyoulikeBidAdapter.js +1 -1
  29. package/modules/afpBidAdapter.js +1 -1
  30. package/modules/appnexusBidAdapter.js +16 -4
  31. package/modules/asealBidAdapter.js +58 -0
  32. package/modules/asealBidAdapter.md +52 -0
  33. package/modules/beachfrontBidAdapter.js +2 -2
  34. package/modules/betweenBidAdapter.js +1 -1
  35. package/modules/bidViewability.js +1 -1
  36. package/modules/bluebillywigBidAdapter.js +1 -1
  37. package/modules/brandmetricsRtdProvider.js +168 -0
  38. package/modules/brandmetricsRtdProvider.md +40 -0
  39. package/modules/bridgewellBidAdapter.js +1 -1
  40. package/modules/browsiRtdProvider.js +2 -2
  41. package/modules/cleanmedianetBidAdapter.js +1 -1
  42. package/modules/colossussspBidAdapter.js +12 -8
  43. package/modules/colossussspBidAdapter.md +15 -1
  44. package/modules/compassBidAdapter.js +1 -1
  45. package/modules/connectIdSystem.js +1 -1
  46. package/modules/consentManagement.js +2 -3
  47. package/modules/consumableBidAdapter.md +1 -1
  48. package/modules/conversantBidAdapter.js +7 -0
  49. package/modules/craftBidAdapter.js +2 -2
  50. package/modules/criteoBidAdapter.js +10 -1
  51. package/modules/currency.js +27 -5
  52. package/modules/cwireBidAdapter.js +1 -1
  53. package/modules/dailyhuntBidAdapter.js +1 -1
  54. package/modules/dchain.js +1 -1
  55. package/modules/displayioBidAdapter.js +157 -0
  56. package/modules/displayioBidAdapter.md +148 -0
  57. package/modules/dspxBidAdapter.js +69 -29
  58. package/modules/dspxBidAdapter.md +2 -1
  59. package/modules/e_volutionBidAdapter.js +158 -0
  60. package/modules/emx_digitalBidAdapter.js +2 -2
  61. package/modules/fluctBidAdapter.js +0 -1
  62. package/modules/gamoshiBidAdapter.js +1 -1
  63. package/modules/gdprEnforcement.js +2 -2
  64. package/modules/glomexBidAdapter.js +1 -1
  65. package/modules/gnetBidAdapter.js +3 -3
  66. package/modules/gnetBidAdapter.md +4 -4
  67. package/modules/goldbachBidAdapter.js +2 -2
  68. package/modules/gptPreAuction.js +1 -1
  69. package/modules/gridBidAdapter.js +15 -1
  70. package/modules/gumgumBidAdapter.js +57 -43
  71. package/modules/hadronIdSystem.js +96 -0
  72. package/modules/hadronIdSystem.md +35 -0
  73. package/modules/hadronRtdProvider.js +254 -0
  74. package/modules/hadronRtdProvider.md +126 -0
  75. package/modules/haloIdSystem.md +4 -35
  76. package/modules/haloRtdProvider.md +3 -126
  77. package/modules/hybridBidAdapter.js +1 -1
  78. package/modules/improvedigitalBidAdapter.js +6 -1
  79. package/modules/insticatorBidAdapter.js +1 -1
  80. package/modules/interactiveOffersBidAdapter.js +9 -6
  81. package/modules/intersectionRtdProvider.js +1 -1
  82. package/modules/ixBidAdapter.js +2 -2
  83. package/modules/jwplayerRtdProvider.js +72 -7
  84. package/modules/jwplayerRtdProvider.md +27 -11
  85. package/modules/kargoBidAdapter.js +2 -2
  86. package/modules/livewrappedBidAdapter.js +1 -1
  87. package/modules/lunamediahbBidAdapter.js +32 -4
  88. package/modules/malltvBidAdapter.js +7 -3
  89. package/modules/malltvBidAdapter.md +64 -51
  90. package/modules/mass.js +3 -5
  91. package/modules/mediakeysBidAdapter.js +2 -2
  92. package/modules/medianetAnalyticsAdapter.js +2 -2
  93. package/modules/medianetRtdProvider.js +1 -1
  94. package/modules/mediasquareBidAdapter.js +1 -0
  95. package/modules/nextMillenniumBidAdapter.js +1 -0
  96. package/modules/nextrollBidAdapter.js +1 -1
  97. package/modules/oguryBidAdapter.js +7 -14
  98. package/modules/onetagBidAdapter.js +1 -1
  99. package/modules/openwebBidAdapter.js +1 -1
  100. package/modules/openxAnalyticsAdapter.js +2 -2
  101. package/modules/openxBidAdapter.js +1 -1
  102. package/modules/parrableIdSystem.js +1 -1
  103. package/modules/permutiveRtdProvider.js +1 -1
  104. package/modules/pilotxBidAdapter.js +147 -0
  105. package/modules/pilotxBidAdapter.md +50 -0
  106. package/modules/pixfutureBidAdapter.js +2 -2
  107. package/modules/prebidServerBidAdapter/index.js +63 -41
  108. package/modules/priceFloors.js +15 -14
  109. package/modules/pubmaticBidAdapter.js +1 -1
  110. package/modules/quantcastBidAdapter.js +1 -1
  111. package/modules/reconciliationRtdProvider.js +1 -1
  112. package/modules/richaudienceBidAdapter.js +7 -2
  113. package/modules/riseBidAdapter.js +17 -6
  114. package/modules/roxotAnalyticsAdapter.js +1 -1
  115. package/modules/rtbhouseBidAdapter.js +1 -1
  116. package/modules/rtdModule/index.js +9 -11
  117. package/modules/rubiconAnalyticsAdapter.js +8 -2
  118. package/modules/rubiconBidAdapter.js +1 -1
  119. package/modules/saambaaBidAdapter.js +420 -420
  120. package/modules/seedingAllianceBidAdapter.js +3 -3
  121. package/modules/sharethroughBidAdapter.js +12 -17
  122. package/modules/sigmoidAnalyticsAdapter.js +1 -1
  123. package/modules/sirdataRtdProvider.js +1 -1
  124. package/modules/sizeMappingV2.js +2 -9
  125. package/modules/smarticoBidAdapter.js +1 -1
  126. package/modules/sortableAnalyticsAdapter.js +5 -4
  127. package/modules/sovrnAnalyticsAdapter.js +2 -2
  128. package/modules/sovrnBidAdapter.js +93 -18
  129. package/modules/sovrnBidAdapter.md +80 -2
  130. package/modules/sspBCBidAdapter.js +54 -21
  131. package/modules/synacormediaBidAdapter.js +32 -11
  132. package/modules/targetVideoBidAdapter.js +1 -1
  133. package/modules/telariaBidAdapter.js +22 -29
  134. package/modules/trustpidSystem.js +197 -0
  135. package/modules/trustpidSystem.md +45 -0
  136. package/modules/undertoneBidAdapter.js +17 -1
  137. package/modules/userId/eids.js +16 -1
  138. package/modules/userId/eids.md +10 -2
  139. package/modules/userId/index.js +2 -2
  140. package/modules/userId/userId.md +17 -2
  141. package/modules/ventesBidAdapter.js +1 -1
  142. package/modules/verizonMediaIdSystem.js +1 -1
  143. package/modules/vibrantmediaBidAdapter.js +220 -0
  144. package/modules/vibrantmediaBidAdapter.md +92 -0
  145. package/modules/viewability.js +177 -0
  146. package/modules/viewability.md +87 -0
  147. package/modules/viewdeosDXBidAdapter.js +1 -1
  148. package/modules/voxBidAdapter.js +1 -1
  149. package/modules/waardexBidAdapter.js +1 -1
  150. package/modules/weboramaRtdProvider.js +264 -34
  151. package/modules/weboramaRtdProvider.md +110 -40
  152. package/modules/widespaceBidAdapter.js +2 -2
  153. package/modules/winrBidAdapter.js +7 -7
  154. package/modules/yahoosspBidAdapter.js +3 -1
  155. package/modules/yieldlabBidAdapter.js +1 -1
  156. package/modules/yieldmoBidAdapter.js +2 -2
  157. package/modules/yieldoneBidAdapter.js +6 -0
  158. package/modules/yuktamediaAnalyticsAdapter.js +1 -1
  159. package/package.json +3 -1
  160. package/plugins/poly/arrayFrom.js +3 -0
  161. package/plugins/poly/find.js +3 -0
  162. package/plugins/poly/findIndex.js +3 -0
  163. package/plugins/poly/includes.js +3 -0
  164. package/plugins/poly/package.json +8 -0
  165. package/src/Renderer.js +1 -1
  166. package/src/adRendering.js +38 -0
  167. package/src/adapterManager.js +33 -28
  168. package/src/adapters/bidderFactory.js +13 -11
  169. package/src/adloader.js +3 -2
  170. package/src/auction.js +140 -117
  171. package/src/auctionIndex.js +85 -0
  172. package/src/auctionManager.js +4 -1
  173. package/src/bidderSettings.js +69 -0
  174. package/src/bidfactory.js +18 -6
  175. package/src/config.js +3 -4
  176. package/src/cpmBucketManager.js +1 -1
  177. package/src/native.js +30 -22
  178. package/src/prebid.js +4 -20
  179. package/src/secureCreatives.js +133 -49
  180. package/src/sizeMapping.js +1 -1
  181. package/src/storageManager.js +1 -1
  182. package/src/targeting.js +13 -4
  183. package/src/userSync.js +1 -1
  184. package/src/utils.js +16 -19
  185. package/src/video.js +11 -12
  186. package/src/videoCache.js +10 -9
  187. package/test/fixtures/fixtures.js +2 -1
  188. package/test/helpers/indexStub.js +28 -0
  189. package/test/helpers/syncPromise.js +71 -0
  190. package/test/spec/auctionmanager_spec.js +269 -90
  191. package/test/spec/config_spec.js +24 -1
  192. package/test/spec/e2e/longform/basic_w_bidderSettings.spec.js +1 -1
  193. package/test/spec/e2e/longform/basic_w_custom_adserver_translation.spec.js +1 -1
  194. package/test/spec/e2e/longform/basic_w_priceGran.spec.js +1 -1
  195. package/test/spec/e2e/longform/basic_w_requireExactDuration.spec.js +1 -1
  196. package/test/spec/e2e/longform/basic_wo_brandCategoryExclusion.spec.js +1 -1
  197. package/test/spec/e2e/longform/basic_wo_requireExactDuration.spec.js +1 -1
  198. package/test/spec/modules/adagioBidAdapter_spec.js +0 -10
  199. package/test/spec/modules/adbookpspBidAdapter_spec.js +17 -3
  200. package/test/spec/modules/adhashBidAdapter_spec.js +2 -2
  201. package/test/spec/modules/adnuntiusRtdProvider_spec.js +145 -0
  202. package/test/spec/modules/adpod_spec.js +91 -156
  203. package/test/spec/modules/afpBidAdapter_spec.js +1 -1
  204. package/test/spec/modules/appnexusBidAdapter_spec.js +27 -0
  205. package/test/spec/modules/asealBidAdapter_spec.js +144 -0
  206. package/test/spec/modules/brandmetricsRtdProvider_spec.js +191 -0
  207. package/test/spec/modules/colossussspBidAdapter_spec.js +5 -2
  208. package/test/spec/modules/conversantBidAdapter_spec.js +54 -2
  209. package/test/spec/modules/criteoBidAdapter_spec.js +21 -0
  210. package/test/spec/modules/currency_spec.js +36 -15
  211. package/test/spec/modules/deepintentDpesIdsystem_spec.js +1 -1
  212. package/test/spec/modules/displayioBidAdapter_spec.js +239 -0
  213. package/test/spec/modules/dspxBidAdapter_spec.js +20 -15
  214. package/test/spec/modules/e_volutionBidAdapter_spec.js +242 -0
  215. package/test/spec/modules/eids_spec.js +2 -2
  216. package/test/spec/modules/eplanningAnalyticsAdapter_spec.js +1 -1
  217. package/test/spec/modules/fintezaAnalyticsAdapter_spec.js +1 -1
  218. package/test/spec/modules/gnetBidAdapter_spec.js +6 -6
  219. package/test/spec/modules/gridBidAdapter_spec.js +18 -0
  220. package/test/spec/modules/gumgumBidAdapter_spec.js +49 -3
  221. package/test/spec/modules/hadronIdSystem_spec.js +57 -0
  222. package/test/spec/modules/hadronRtdProvider_spec.js +762 -0
  223. package/test/spec/modules/idxIdSystem_spec.js +1 -1
  224. package/test/spec/modules/improvedigitalBidAdapter_spec.js +19 -0
  225. package/test/spec/modules/jwplayerRtdProvider_spec.js +195 -2
  226. package/test/spec/modules/kargoBidAdapter_spec.js +1 -1
  227. package/test/spec/modules/lunamediahbBidAdapter_spec.js +27 -1
  228. package/test/spec/modules/mass_spec.js +2 -14
  229. package/test/spec/modules/mediakeysBidAdapter_spec.js +1 -1
  230. package/test/spec/modules/multibid_spec.js +1 -1
  231. package/test/spec/modules/oguryBidAdapter_spec.js +63 -5
  232. package/test/spec/modules/onetagBidAdapter_spec.js +1 -1
  233. package/test/spec/modules/openxAnalyticsAdapter_spec.js +1 -1
  234. package/test/spec/modules/parrableIdSystem_spec.js +1 -1
  235. package/test/spec/modules/pilotxBidAdapter_spec.js +244 -0
  236. package/test/spec/modules/prebidServerBidAdapter_spec.js +43 -6
  237. package/test/spec/modules/priceFloors_spec.js +37 -24
  238. package/test/spec/modules/pubmaticBidAdapter_spec.js +40 -0
  239. package/test/spec/modules/realTimeDataModule_spec.js +51 -2
  240. package/test/spec/modules/riseBidAdapter_spec.js +30 -4
  241. package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +61 -1
  242. package/test/spec/modules/rubiconBidAdapter_spec.js +1 -1
  243. package/test/spec/modules/sharethroughBidAdapter_spec.js +91 -6
  244. package/test/spec/modules/sortableAnalyticsAdapter_spec.js +2 -3
  245. package/test/spec/modules/sovrnBidAdapter_spec.js +413 -333
  246. package/test/spec/modules/sspBCBidAdapter_spec.js +7 -7
  247. package/test/spec/modules/stroeerCoreBidAdapter_spec.js +1 -1
  248. package/test/spec/modules/synacormediaBidAdapter_spec.js +70 -0
  249. package/test/spec/modules/telariaBidAdapter_spec.js +1 -3
  250. package/test/spec/modules/trustpidSystem_spec.js +232 -0
  251. package/test/spec/modules/undertoneBidAdapter_spec.js +55 -2
  252. package/test/spec/modules/userId_spec.js +40 -40
  253. package/test/spec/modules/vibrantmediaBidAdapter_spec.js +1237 -0
  254. package/test/spec/modules/viewability_spec.js +280 -0
  255. package/test/spec/modules/weboramaRtdProvider_spec.js +536 -20
  256. package/test/spec/modules/widespaceBidAdapter_spec.js +1 -1
  257. package/test/spec/modules/yahoosspBidAdapter_spec.js +10 -0
  258. package/test/spec/modules/yieldoneBidAdapter_spec.js +33 -0
  259. package/test/spec/modules/zeotapIdPlusIdSystem_spec.js +1 -1
  260. package/test/spec/native_spec.js +62 -40
  261. package/test/spec/sizeMapping_spec.js +1 -1
  262. package/test/spec/unit/core/adapterManager_spec.js +24 -2
  263. package/test/spec/unit/core/auctionIndex_spec.js +129 -0
  264. package/test/spec/unit/core/bidderFactory_spec.js +65 -12
  265. package/test/spec/unit/core/bidderSettings_spec.js +123 -0
  266. package/test/spec/unit/core/targeting_spec.js +93 -0
  267. package/test/spec/unit/pbjs_api_spec.js +81 -43
  268. package/test/spec/unit/secureCreatives_spec.js +143 -24
  269. package/test/spec/videoCache_spec.js +18 -19
  270. package/test/spec/video_spec.js +51 -61
  271. package/webpack.conf.js +1 -1
@@ -3,8 +3,8 @@ import { config } from '../src/config.js';
3
3
  import { registerBidder } from '../src/adapters/bidderFactory.js';
4
4
  import { Renderer } from '../src/Renderer.js';
5
5
  import { VIDEO, BANNER } from '../src/mediaTypes.js';
6
- import find from 'core-js-pure/features/array/find.js';
7
- import includes from 'core-js-pure/features/array/includes.js';
6
+ import find from 'prebidjs-polyfill/find.js';
7
+ import includes from 'prebidjs-polyfill/includes.js';
8
8
 
9
9
  const ADAPTER_VERSION = '1.19';
10
10
  const ADAPTER_NAME = 'BFIO_PREBID';
@@ -6,7 +6,7 @@ const BIDDER_CODE = 'between';
6
6
  let ENDPOINT = 'https://ads.betweendigital.com/adjson?t=prebid';
7
7
  const CODE_TYPES = ['inpage', 'preroll', 'midroll', 'postroll'];
8
8
 
9
- const includes = require('core-js-pure/features/array/includes.js');
9
+ const includes = require('prebidjs-polyfill/includes.js');
10
10
  export const spec = {
11
11
  code: BIDDER_CODE,
12
12
  aliases: ['btw'],
@@ -8,7 +8,7 @@ import CONSTANTS from '../src/constants.json';
8
8
  import { logWarn, isFn, triggerPixel } from '../src/utils.js';
9
9
  import { getGlobal } from '../src/prebidGlobal.js';
10
10
  import adapterManager, { gdprDataHandler, uspDataHandler } from '../src/adapterManager.js';
11
- import find from 'core-js-pure/features/array/find.js';
11
+ import find from 'prebidjs-polyfill/find.js';
12
12
 
13
13
  const MODULE_NAME = 'bidViewability';
14
14
  const CONFIG_ENABLED = 'enabled';
@@ -1,5 +1,5 @@
1
1
  import { deepAccess, deepSetValue, deepClone, logWarn, logError } from '../src/utils.js';
2
- import find from 'core-js-pure/features/array/find.js';
2
+ import find from 'prebidjs-polyfill/find.js';
3
3
  import { registerBidder } from '../src/adapters/bidderFactory.js';
4
4
  import { VIDEO } from '../src/mediaTypes.js';
5
5
  import { config } from '../src/config.js';
@@ -0,0 +1,168 @@
1
+ /**
2
+ * This module adds brandmetrics provider to the real time data module
3
+ * The {@link module:modules/realTimeData} module is required
4
+ * The module will load load the brandmetrics script and set survey- targeting to ad units of specific bidders.
5
+ * @module modules/brandmetricsRtdProvider
6
+ * @requires module:modules/realTimeData
7
+ */
8
+ import { config } from '../src/config.js'
9
+ import { submodule } from '../src/hook.js'
10
+ import { deepSetValue, mergeDeep, logError, deepAccess } from '../src/utils.js'
11
+ import {loadExternalScript} from '../src/adloader.js'
12
+ const MODULE_NAME = 'brandmetrics'
13
+ const MODULE_CODE = MODULE_NAME
14
+ const RECEIVED_EVENTS = []
15
+ const GVL_ID = 422
16
+ const TCF_PURPOSES = [1, 7]
17
+
18
+ function init (config, userConsent) {
19
+ const hasConsent = checkConsent(userConsent)
20
+
21
+ if (hasConsent) {
22
+ const moduleConfig = getMergedConfig(config)
23
+ initializeBrandmetrics(moduleConfig.params.scriptId)
24
+ }
25
+ return hasConsent
26
+ }
27
+
28
+ /**
29
+ * Checks TCF and USP consents
30
+ * @param {Object} userConsent
31
+ * @returns {boolean}
32
+ */
33
+ function checkConsent (userConsent) {
34
+ let consent = false
35
+
36
+ if (userConsent && userConsent.gdpr && userConsent.gdpr.gdprApplies) {
37
+ const gdpr = userConsent.gdpr
38
+
39
+ if (gdpr.vendorData) {
40
+ const vendor = gdpr.vendorData.vendor
41
+ const purpose = gdpr.vendorData.purpose
42
+
43
+ let vendorConsent = false
44
+ if (vendor.consents) {
45
+ vendorConsent = vendor.consents[GVL_ID]
46
+ }
47
+
48
+ if (vendor.legitimateInterests) {
49
+ vendorConsent = vendorConsent || vendor.legitimateInterests[GVL_ID]
50
+ }
51
+
52
+ const purposes = TCF_PURPOSES.map(id => {
53
+ return (purpose.consents && purpose.consents[id]) || (purpose.legitimateInterests && purpose.legitimateInterests[id])
54
+ })
55
+ const purposesValid = purposes.filter(p => p === true).length === TCF_PURPOSES.length
56
+ consent = vendorConsent && purposesValid
57
+ }
58
+ } else if (userConsent.usp) {
59
+ const usp = userConsent.usp
60
+ consent = usp[1] !== 'N' && usp[2] !== 'Y'
61
+ }
62
+
63
+ return consent
64
+ }
65
+
66
+ /**
67
+ * Add event- listeners to hook in to brandmetrics events
68
+ * @param {Object} reqBidsConfigObj
69
+ * @param {function} callback
70
+ */
71
+ function processBrandmetricsEvents (reqBidsConfigObj, moduleConfig, callback) {
72
+ const callBidTargeting = (event) => {
73
+ if (event.available && event.conf) {
74
+ const targetingConf = event.conf.displayOption || {}
75
+ if (targetingConf.type === 'pbjs') {
76
+ setBidderTargeting(reqBidsConfigObj, moduleConfig, targetingConf.targetKey || 'brandmetrics_survey', event.survey.measurementId)
77
+ }
78
+ }
79
+ callback()
80
+ }
81
+
82
+ if (RECEIVED_EVENTS.length > 0) {
83
+ callBidTargeting(RECEIVED_EVENTS[RECEIVED_EVENTS.length - 1])
84
+ } else {
85
+ window._brandmetrics = window._brandmetrics || []
86
+ window._brandmetrics.push({
87
+ cmd: '_addeventlistener',
88
+ val: {
89
+ event: 'surveyloaded',
90
+ reEmitLast: true,
91
+ handler: (ev) => {
92
+ RECEIVED_EVENTS.push(ev)
93
+ if (RECEIVED_EVENTS.length === 1) {
94
+ // Call bid targeting only for the first received event, if called subsequently, last event from the RECEIVED_EVENTS array is used
95
+ callBidTargeting(ev)
96
+ }
97
+ },
98
+ }
99
+ })
100
+ }
101
+ }
102
+
103
+ /**
104
+ * Sets bid targeting of specific bidders
105
+ * @param {Object} reqBidsConfigObj
106
+ * @param {string} key Targeting key
107
+ * @param {string} val Targeting value
108
+ */
109
+ function setBidderTargeting (reqBidsConfigObj, moduleConfig, key, val) {
110
+ const bidders = deepAccess(moduleConfig, 'params.bidders')
111
+ if (bidders && bidders.length > 0) {
112
+ const ortb2 = {}
113
+ deepSetValue(ortb2, 'ortb2.user.ext.data.' + key, val)
114
+ config.setBidderConfig({
115
+ bidders: bidders,
116
+ config: ortb2
117
+ })
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Add the brandmetrics script to the page.
123
+ * @param {string} scriptId - The script- id provided by brandmetrics or brandmetrics partner
124
+ */
125
+ function initializeBrandmetrics(scriptId) {
126
+ if (scriptId) {
127
+ const path = 'https://cdn.brandmetrics.com/survey/script/'
128
+ const file = scriptId + '.js'
129
+ const url = path + file
130
+
131
+ loadExternalScript(url, MODULE_CODE)
132
+ }
133
+ }
134
+
135
+ /**
136
+ * Merges a provided config with default values
137
+ * @param {Object} customConfig
138
+ * @returns
139
+ */
140
+ function getMergedConfig(customConfig) {
141
+ return mergeDeep({
142
+ waitForIt: false,
143
+ params: {
144
+ bidders: [],
145
+ scriptId: undefined,
146
+ }
147
+ }, customConfig)
148
+ }
149
+
150
+ /** @type {RtdSubmodule} */
151
+ export const brandmetricsSubmodule = {
152
+ name: MODULE_NAME,
153
+ getBidRequestData: function (reqBidsConfigObj, callback, customConfig) {
154
+ try {
155
+ const moduleConfig = getMergedConfig(customConfig)
156
+ if (moduleConfig.waitForIt) {
157
+ processBrandmetricsEvents(reqBidsConfigObj, moduleConfig, callback)
158
+ } else {
159
+ callback()
160
+ }
161
+ } catch (e) {
162
+ logError(e)
163
+ }
164
+ },
165
+ init: init
166
+ }
167
+
168
+ submodule('realTimeData', brandmetricsSubmodule)
@@ -0,0 +1,40 @@
1
+ # Brandmetrics Real-time Data Submodule
2
+ This module is intended to be used by brandmetrics (https://brandmetrics.com) partners and sets targeting keywords to bids if the browser is eligeble to see a brandmetrics survey.
3
+ The module hooks in to brandmetrics events and requires a brandmetrics script to be running. The module can optionally load and initialize brandmetrics by providing the 'scriptId'- parameter.
4
+
5
+ ## Usage
6
+ Compile the Brandmetrics RTD module into your Prebid build:
7
+ ```
8
+ gulp build --modules=rtdModule,brandmetricsRtdProvider
9
+ ```
10
+
11
+ > Note that the global RTD module, `rtdModule`, is a prerequisite of the Brandmetrics RTD module.
12
+
13
+ Enable the Brandmetrics RTD in your Prebid configuration, using the below format:
14
+
15
+ ```javascript
16
+ pbjs.setConfig({
17
+ ...,
18
+ realTimeData: {
19
+ auctionDelay: 500, // auction delay
20
+ dataProviders: [{
21
+ name: 'brandmetrics',
22
+ waitForIt: true // should be true if there's an `auctionDelay`,
23
+ params: {
24
+ scriptId: '00000000-0000-0000-0000-000000000000',
25
+ bidders: ['ozone']
26
+ }
27
+ }]
28
+ },
29
+ ...
30
+ })
31
+ ```
32
+
33
+ ## Parameters
34
+ | Name | Type | Description | Default |
35
+ | ----------------- | -------------------- | ------------------ | ------------------ |
36
+ | name | String | This should always be `brandmetrics` | - |
37
+ | waitForIt | Boolean | Should be `true` if there's an `auctionDelay` defined (recommended) | `false` |
38
+ | params | Object | | - |
39
+ | params.bidders | String[] | An array of bidders which should receive targeting keys. | `[]` |
40
+ | params.scriptId | String | A script- id GUID if the brandmetrics- script should be initialized. | `undefined` |
@@ -1,7 +1,7 @@
1
1
  import { _each, inIframe, deepSetValue } from '../src/utils.js';
2
2
  import { registerBidder } from '../src/adapters/bidderFactory.js';
3
3
  import { BANNER, NATIVE } from '../src/mediaTypes.js';
4
- import find from 'core-js-pure/features/array/find.js';
4
+ import find from 'prebidjs-polyfill/find.js';
5
5
 
6
6
  const BIDDER_CODE = 'bridgewell';
7
7
  const REQUEST_ENDPOINT = 'https://prebid.scupio.com/recweb/prebid.aspx?cb=';
@@ -20,9 +20,9 @@ import {submodule} from '../src/hook.js';
20
20
  import {ajaxBuilder} from '../src/ajax.js';
21
21
  import {loadExternalScript} from '../src/adloader.js';
22
22
  import {getStorageManager} from '../src/storageManager.js';
23
- import find from 'core-js-pure/features/array/find.js';
23
+ import find from 'prebidjs-polyfill/find.js';
24
24
  import {getGlobal} from '../src/prebidGlobal.js';
25
- import includes from 'core-js-pure/features/array/includes.js';
25
+ import includes from 'prebidjs-polyfill/includes.js';
26
26
 
27
27
  const storage = getStorageManager();
28
28
 
@@ -3,7 +3,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
3
3
  import {config} from '../src/config.js';
4
4
  import {Renderer} from '../src/Renderer.js';
5
5
  import {BANNER, VIDEO} from '../src/mediaTypes.js';
6
- import includes from 'core-js-pure/features/array/includes.js';
6
+ import includes from 'prebidjs-polyfill/includes.js';
7
7
 
8
8
  export const helper = {
9
9
  getTopWindowDomain: function (url) {
@@ -47,7 +47,10 @@ export const spec = {
47
47
  * @return boolean True if this is a valid bid, and false otherwise.
48
48
  */
49
49
  isBidRequestValid: (bid) => {
50
- return Boolean(bid.bidId && bid.params && !isNaN(bid.params.placement_id));
50
+ const validPlacamentId = bid.params && !isNaN(bid.params.placement_id);
51
+ const validGroupId = bid.params && !isNaN(bid.params.group_id);
52
+
53
+ return Boolean(bid.bidId && (validPlacamentId || validGroupId));
51
54
  },
52
55
 
53
56
  /**
@@ -61,13 +64,13 @@ export const spec = {
61
64
  const location = winTop.location;
62
65
  let placements = [];
63
66
  let request = {
64
- 'deviceWidth': winTop.screen.width,
65
- 'deviceHeight': winTop.screen.height,
66
- 'language': (navigator && navigator.language) ? navigator.language : '',
67
- 'secure': location.protocol === 'https:' ? 1 : 0,
68
- 'host': location.host,
69
- 'page': location.pathname,
70
- 'placements': placements,
67
+ deviceWidth: winTop.screen.width,
68
+ deviceHeight: winTop.screen.height,
69
+ language: (navigator && navigator.language) ? navigator.language : '',
70
+ secure: location.protocol === 'https:' ? 1 : 0,
71
+ host: location.host,
72
+ page: location.pathname,
73
+ placements: placements,
71
74
  };
72
75
 
73
76
  if (bidderRequest) {
@@ -85,6 +88,7 @@ export const spec = {
85
88
  let traff = bid.params.traffic || BANNER
86
89
  let placement = {
87
90
  placementId: bid.params.placement_id,
91
+ groupId: bid.params.group_id,
88
92
  bidId: bid.bidId,
89
93
  sizes: bid.mediaTypes[traff].sizes,
90
94
  traffic: traff,
@@ -26,5 +26,19 @@ Module that connects to Colossus SSP demand sources
26
26
  traffic: 'banner'
27
27
  }
28
28
  }]
29
- ];
29
+ }, {
30
+ code: 'placementid_1',
31
+ mediaTypes: {
32
+ banner: {
33
+ sizes: [[300, 250], [300,600]]
34
+ }
35
+ },
36
+ bids: [{
37
+ bidder: 'colossusssp',
38
+ params: {
39
+ group_id: 0,
40
+ traffic: 'banner'
41
+ }
42
+ }]
43
+ }];
30
44
  ```
@@ -97,7 +97,7 @@ export const spec = {
97
97
 
98
98
  isBidRequestValid: (bid = {}) => {
99
99
  const { params, bidId, mediaTypes } = bid;
100
- let valid = Boolean(bidId && params && params.placementId);
100
+ let valid = Boolean(bidId && params && (params.placementId || params.endpointId));
101
101
 
102
102
  if (mediaTypes && mediaTypes[BANNER]) {
103
103
  valid = valid && Boolean(mediaTypes[BANNER] && mediaTypes[BANNER].sizes);
@@ -8,7 +8,7 @@
8
8
  import {ajax} from '../src/ajax.js';
9
9
  import {submodule} from '../src/hook.js';
10
10
  import {logError, formatQS} from '../src/utils.js';
11
- import includes from 'core-js-pure/features/array/includes.js';
11
+ import includes from 'prebidjs-polyfill/includes.js';
12
12
 
13
13
  const MODULE_NAME = 'connectId';
14
14
  const VENDOR_ID = 25;
@@ -8,8 +8,7 @@
8
8
  import { logInfo, isFn, getAdUnitSizes, logWarn, isStr, isPlainObject, logError, isNumber } from '../src/utils.js';
9
9
  import { config } from '../src/config.js';
10
10
  import { gdprDataHandler } from '../src/adapterManager.js';
11
- import includes from 'core-js-pure/features/array/includes.js';
12
- import strIncludes from 'core-js-pure/features/string/includes.js';
11
+ import includes from 'prebidjs-polyfill/includes.js';
13
12
 
14
13
  const DEFAULT_CMP = 'iab';
15
14
  const DEFAULT_CONSENT_TIMEOUT = 10000;
@@ -249,7 +248,7 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) {
249
248
 
250
249
  function readPostMessageResponse(event) {
251
250
  let cmpDataPkgName = `${apiName}Return`;
252
- let json = (typeof event.data === 'string' && strIncludes(event.data, cmpDataPkgName)) ? JSON.parse(event.data) : event.data;
251
+ let json = (typeof event.data === 'string' && includes(event.data, cmpDataPkgName)) ? JSON.parse(event.data) : event.data;
253
252
  if (json[cmpDataPkgName] && json[cmpDataPkgName].callId) {
254
253
  let payload = json[cmpDataPkgName];
255
254
  // TODO - clean up this logic (move listeners?); we have duplicate messages responses because 2 eventlisteners are active from the 2 cmp requests running in parallel
@@ -4,7 +4,7 @@ Module Name: Consumable Bid Adapter
4
4
 
5
5
  Module Type: Consumable Adapter
6
6
 
7
- Maintainer: naffis@consumable.com
7
+ Maintainer: prebid@consumable.com
8
8
 
9
9
  # Description
10
10
 
@@ -2,6 +2,7 @@ import { logWarn, isStr, deepAccess, isArray, getBidIdParameter, deepSetValue, i
2
2
  import {registerBidder} from '../src/adapters/bidderFactory.js';
3
3
  import {BANNER, VIDEO} from '../src/mediaTypes.js';
4
4
  import {getStorageManager} from '../src/storageManager.js';
5
+ import { config } from '../src/config.js';
5
6
 
6
7
  const GVLID = 24;
7
8
  export const storage = getStorageManager(GVLID);
@@ -76,6 +77,9 @@ export const spec = {
76
77
  displaymanager: 'Prebid.js',
77
78
  displaymanagerver: '$prebid.version$'
78
79
  };
80
+ if (bid.ortb2Imp) {
81
+ mergeDeep(imp, bid.ortb2Imp);
82
+ }
79
83
 
80
84
  copyOptProperty(bid.params.tag_id, imp, 'tagid');
81
85
 
@@ -167,6 +171,9 @@ export const spec = {
167
171
  payload.user = {ext: userExt};
168
172
  }
169
173
 
174
+ const firstPartyData = config.getConfig('ortb2') || {};
175
+ mergeDeep(payload, firstPartyData);
176
+
170
177
  return {
171
178
  method: 'POST',
172
179
  url: bidurl,
@@ -2,8 +2,8 @@ import { logError, convertTypes, convertCamelToUnderscore, isArray, deepAccess,
2
2
  import { registerBidder } from '../src/adapters/bidderFactory.js';
3
3
  import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
4
4
  import { auctionManager } from '../src/auctionManager.js';
5
- import find from 'core-js-pure/features/array/find.js';
6
- import includes from 'core-js-pure/features/array/includes.js';
5
+ import find from 'prebidjs-polyfill/find.js';
6
+ import includes from 'prebidjs-polyfill/includes.js';
7
7
  import { getStorageManager } from '../src/storageManager.js';
8
8
  import {ajax} from '../src/ajax.js';
9
9
 
@@ -3,7 +3,7 @@ import {loadExternalScript} from '../src/adloader.js';
3
3
  import {registerBidder} from '../src/adapters/bidderFactory.js';
4
4
  import {config} from '../src/config.js';
5
5
  import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
6
- import find from 'core-js-pure/features/array/find.js';
6
+ import find from 'prebidjs-polyfill/find.js';
7
7
  import { verify } from 'criteo-direct-rsa-validate/build/verify.js'; // ref#2
8
8
  import { getStorageManager } from '../src/storageManager.js';
9
9
 
@@ -281,6 +281,7 @@ function checkNativeSendId(bidRequest) {
281
281
  */
282
282
  function buildCdbRequest(context, bidRequests, bidderRequest) {
283
283
  let networkId;
284
+ let schain;
284
285
  const request = {
285
286
  publisher: {
286
287
  url: context.url,
@@ -288,6 +289,7 @@ function buildCdbRequest(context, bidRequests, bidderRequest) {
288
289
  },
289
290
  slots: bidRequests.map(bidRequest => {
290
291
  networkId = bidRequest.params.networkId || networkId;
292
+ schain = bidRequest.schain || schain;
291
293
  const slot = {
292
294
  impid: bidRequest.adUnitCode,
293
295
  transactionid: bidRequest.transactionId,
@@ -344,6 +346,13 @@ function buildCdbRequest(context, bidRequests, bidderRequest) {
344
346
  if (networkId) {
345
347
  request.publisher.networkid = networkId;
346
348
  }
349
+ if (schain) {
350
+ request.source = {
351
+ ext: {
352
+ schain: schain
353
+ }
354
+ }
355
+ };
347
356
  request.user = {
348
357
  ext: bidderRequest.userExt
349
358
  };
@@ -20,6 +20,25 @@ export var currencyRates = {};
20
20
  var bidderCurrencyDefault = {};
21
21
  var defaultRates;
22
22
 
23
+ export const ready = (() => {
24
+ let isDone, resolver, promise;
25
+ function reset() {
26
+ isDone = false;
27
+ resolver = null;
28
+ promise = new Promise((resolve) => {
29
+ resolver = resolve;
30
+ if (isDone) resolve();
31
+ })
32
+ }
33
+ function done() {
34
+ isDone = true;
35
+ if (resolver != null) { resolver() }
36
+ }
37
+ reset();
38
+
39
+ return {done, reset, promise: () => promise}
40
+ })();
41
+
23
42
  /**
24
43
  * Configuration function for currency
25
44
  * @param {string} [config.adServerCurrency = 'USD']
@@ -138,11 +157,15 @@ function initCurrency(url) {
138
157
  logInfo('currencyRates set to ' + JSON.stringify(currencyRates));
139
158
  currencyRatesLoaded = true;
140
159
  processBidResponseQueue();
160
+ ready.done();
141
161
  } catch (e) {
142
162
  errorSettingsRates('Failed to parse currencyRates response: ' + response);
143
163
  }
144
164
  },
145
- error: errorSettingsRates
165
+ error: function (...args) {
166
+ errorSettingsRates(...args);
167
+ ready.done();
168
+ }
146
169
  }
147
170
  );
148
171
  }
@@ -197,6 +220,8 @@ export function addBidResponseHook(fn, adUnitCode, bid) {
197
220
  bidResponseQueue.push(wrapFunction(fn, this, [adUnitCode, bid]));
198
221
  if (!currencySupportEnabled || currencyRatesLoaded) {
199
222
  processBidResponseQueue();
223
+ } else {
224
+ fn.bail(ready.promise());
200
225
  }
201
226
  }
202
227
 
@@ -219,10 +244,7 @@ function wrapFunction(fn, context, params) {
219
244
  }
220
245
  } catch (e) {
221
246
  logWarn('Returning NO_BID, getCurrencyConversion threw error: ', e);
222
- params[1] = createBid(CONSTANTS.STATUS.NO_BID, {
223
- bidder: bid.bidderCode || bid.bidder,
224
- bidId: bid.requestId
225
- });
247
+ params[1] = createBid(CONSTANTS.STATUS.NO_BID, bid.getIdentifiers());
226
248
  }
227
249
  }
228
250
  return fn.apply(context, params);
@@ -16,7 +16,7 @@ import {
16
16
  logWarn,
17
17
  } from '../src/utils.js';
18
18
  import { Renderer } from '../src/Renderer.js';
19
- import find from 'core-js-pure/features/array/find.js';
19
+ import find from 'prebidjs-polyfill/find.js';
20
20
 
21
21
  // ------------------------------------
22
22
  const BIDDER_CODE = 'cwire';
@@ -2,7 +2,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js';
2
2
  import * as mediaTypes from '../src/mediaTypes.js';
3
3
  import {deepAccess, _map, isEmpty} from '../src/utils.js';
4
4
  import { ajax } from '../src/ajax.js';
5
- import find from 'core-js-pure/features/array/find.js';
5
+ import find from 'prebidjs-polyfill/find.js';
6
6
  import { OUTSTREAM, INSTREAM } from '../src/video.js';
7
7
 
8
8
  const BIDDER_CODE = 'dailyhunt';
package/modules/dchain.js CHANGED
@@ -1,4 +1,4 @@
1
- import includes from 'core-js-pure/features/array/includes.js';
1
+ import includes from 'prebidjs-polyfill/includes.js';
2
2
  import { config } from '../src/config.js';
3
3
  import { getHook } from '../src/hook.js';
4
4
  import { _each, isStr, isArray, isPlainObject, hasOwn, deepClone, deepAccess, logWarn, logError } from '../src/utils.js';