prebid.js 7.12.0 → 7.13.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 (200) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE.md +16 -10
  2. package/.github/codeql/codeql-config.yml +4 -0
  3. package/.github/workflows/codeql-analysis.yml +73 -0
  4. package/dist/33acrossBidAdapter.js +1 -1
  5. package/dist/acuityAdsBidAdapter.js +1 -0
  6. package/dist/adagioBidAdapter.js +1 -1
  7. package/dist/adbookpspBidAdapter.js +1 -1
  8. package/dist/adgenerationBidAdapter.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/aolBidAdapter.js +1 -1
  17. package/dist/appierAnalyticsAdapter.js +1 -1
  18. package/dist/appnexusBidAdapter.js +1 -1
  19. package/dist/asoBidAdapter.js +1 -1
  20. package/dist/audiencerunBidAdapter.js +1 -1
  21. package/dist/axonixBidAdapter.js +1 -1
  22. package/dist/beopBidAdapter.js +1 -1
  23. package/dist/bidglassBidAdapter.js +1 -1
  24. package/dist/big-richmediaBidAdapter.js +1 -1
  25. package/dist/bluebillywigBidAdapter.js +1 -1
  26. package/dist/brandmetricsRtdProvider.js +1 -1
  27. package/dist/bridgewellBidAdapter.js +1 -1
  28. package/dist/brightMountainMediaBidAdapter.js +1 -1
  29. package/dist/browsiRtdProvider.js +1 -1
  30. package/dist/cleanioRtdProvider.js +1 -1
  31. package/dist/concertBidAdapter.js +1 -1
  32. package/dist/connectadBidAdapter.js +1 -1
  33. package/dist/consentManagement.js +1 -1
  34. package/dist/consentManagementUsp.js +1 -1
  35. package/dist/consumableBidAdapter.js +1 -1
  36. package/dist/conversantBidAdapter.js +1 -1
  37. package/dist/craftBidAdapter.js +1 -1
  38. package/dist/criteoBidAdapter.js +1 -1
  39. package/dist/currency.js +1 -1
  40. package/dist/debugging-standalone.js +1 -1
  41. package/dist/dspxBidAdapter.js +1 -1
  42. package/dist/enrichmentFpdModule.js +1 -1
  43. package/dist/eplanningBidAdapter.js +1 -1
  44. package/dist/finativeBidAdapter.js +1 -1
  45. package/dist/glimpseBidAdapter.js +1 -1
  46. package/dist/gmosspBidAdapter.js +1 -1
  47. package/dist/goldbachBidAdapter.js +1 -1
  48. package/dist/gridBidAdapter.js +1 -1
  49. package/dist/gridNMBidAdapter.js +1 -1
  50. package/dist/gumgumBidAdapter.js +1 -1
  51. package/dist/h12mediaBidAdapter.js +1 -1
  52. package/dist/id5IdSystem.js +1 -1
  53. package/dist/imRtdProvider.js +1 -1
  54. package/dist/impactifyBidAdapter.js +1 -1
  55. package/dist/improvedigitalBidAdapter.js +1 -1
  56. package/dist/inmarBidAdapter.js +1 -1
  57. package/dist/insticatorBidAdapter.js +1 -1
  58. package/dist/ixBidAdapter.js +1 -1
  59. package/dist/jixieBidAdapter.js +1 -1
  60. package/dist/justpremiumBidAdapter.js +1 -1
  61. package/dist/konduitAnalyticsAdapter.js +1 -1
  62. package/dist/kueezBidAdapter.js +1 -1
  63. package/dist/lassoBidAdapter.js +1 -1
  64. package/dist/lifestreetBidAdapter.js +1 -0
  65. package/dist/limelightDigitalBidAdapter.js +1 -1
  66. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  67. package/dist/logicadBidAdapter.js +1 -1
  68. package/dist/loglyliftBidAdapter.js +1 -1
  69. package/dist/mabidderBidAdapter.js +1 -0
  70. package/dist/malltvAnalyticsAdapter.js +1 -1
  71. package/dist/marsmediaBidAdapter.js +1 -1
  72. package/dist/mediafuseBidAdapter.js +1 -1
  73. package/dist/mediakeysBidAdapter.js +1 -1
  74. package/dist/mediasquareBidAdapter.js +1 -1
  75. package/dist/mgidBidAdapter.js +1 -1
  76. package/dist/minutemediaBidAdapter.js +1 -1
  77. package/dist/not-for-prod/prebid.js +132 -127
  78. package/dist/oguryBidAdapter.js +1 -1
  79. package/dist/oneKeyIdSystem.js +1 -0
  80. package/dist/oneKeyRtdProvider.js +1 -0
  81. package/dist/onetagBidAdapter.js +1 -1
  82. package/dist/ooloAnalyticsAdapter.js +1 -1
  83. package/dist/outbrainBidAdapter.js +1 -1
  84. package/dist/parrableIdSystem.js +1 -1
  85. package/dist/permutiveRtdProvider.js +1 -1
  86. package/dist/pixfutureBidAdapter.js +1 -1
  87. package/dist/prebid-core.js +2 -2
  88. package/dist/publinkIdSystem.js +1 -1
  89. package/dist/pubmaticBidAdapter.js +1 -1
  90. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  91. package/dist/pxyzBidAdapter.js +1 -1
  92. package/dist/quantcastBidAdapter.js +1 -1
  93. package/dist/readpeakBidAdapter.js +1 -1
  94. package/dist/relaidoBidAdapter.js +1 -1
  95. package/dist/rhythmoneBidAdapter.js +1 -1
  96. package/dist/riseBidAdapter.js +1 -1
  97. package/dist/rtbhouseBidAdapter.js +1 -1
  98. package/dist/rubiconAnalyticsAdapter.js +1 -1
  99. package/dist/rubiconBidAdapter.js +1 -1
  100. package/dist/seedingAllianceBidAdapter.js +1 -1
  101. package/dist/seedtagBidAdapter.js +1 -1
  102. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  103. package/dist/sharethroughBidAdapter.js +1 -1
  104. package/dist/shinezBidAdapter.js +1 -1
  105. package/dist/smaatoBidAdapter.js +1 -1
  106. package/dist/smartadserverBidAdapter.js +1 -1
  107. package/dist/smartxBidAdapter.js +1 -1
  108. package/dist/smilewantedBidAdapter.js +1 -1
  109. package/dist/sonobiBidAdapter.js +1 -1
  110. package/dist/sovrnAnalyticsAdapter.js +1 -1
  111. package/dist/sovrnBidAdapter.js +1 -1
  112. package/dist/sspBCBidAdapter.js +1 -1
  113. package/dist/sublimeBidAdapter.js +1 -1
  114. package/dist/synacormediaBidAdapter.js +1 -1
  115. package/dist/targetVideoBidAdapter.js +1 -1
  116. package/dist/teadsBidAdapter.js +1 -1
  117. package/dist/trionBidAdapter.js +1 -1
  118. package/dist/tripleliftBidAdapter.js +1 -1
  119. package/dist/trustpidSystem.js +1 -1
  120. package/dist/ttdBidAdapter.js +1 -1
  121. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  122. package/dist/underdogmediaBidAdapter.js +1 -1
  123. package/dist/undertoneBidAdapter.js +1 -1
  124. package/dist/userId.js +1 -1
  125. package/dist/vidazooBidAdapter.js +1 -1
  126. package/dist/videobyteBidAdapter.js +1 -1
  127. package/dist/viewability.js +1 -1
  128. package/dist/visxBidAdapter.js +1 -1
  129. package/dist/vuukleBidAdapter.js +1 -1
  130. package/dist/widespaceBidAdapter.js +1 -1
  131. package/dist/winrBidAdapter.js +1 -1
  132. package/dist/yahoosspBidAdapter.js +1 -1
  133. package/dist/yieldmoBidAdapter.js +1 -1
  134. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  135. package/modules/.submodules.json +2 -0
  136. package/modules/acuityAdsBidAdapter.js +207 -0
  137. package/modules/acuityAdsBidAdapter.md +79 -0
  138. package/modules/adgenerationBidAdapter.js +2 -2
  139. package/modules/adriverBidAdapter.js +1 -1
  140. package/modules/appnexusBidAdapter.js +13 -93
  141. package/modules/beopBidAdapter.js +4 -4
  142. package/modules/browsiRtdProvider.js +1 -1
  143. package/modules/consentManagement.js +1 -1
  144. package/modules/consentManagementUsp.js +1 -1
  145. package/modules/consumableBidAdapter.js +23 -1
  146. package/modules/currency.js +1 -0
  147. package/modules/datawrkzBidAdapter.js +13 -13
  148. package/modules/enrichmentFpdModule.js +11 -0
  149. package/modules/id5IdSystem.js +2 -2
  150. package/modules/imRtdProvider.js +20 -7
  151. package/modules/imRtdProvider.md +3 -1
  152. package/modules/insticatorBidAdapter.js +1 -1
  153. package/modules/ixBidAdapter.js +8 -22
  154. package/modules/ixBidAdapter.md +1 -19
  155. package/modules/lifestreetBidAdapter.js +143 -0
  156. package/modules/limelightDigitalBidAdapter.js +2 -1
  157. package/modules/mabidderBidAdapter.js +60 -0
  158. package/modules/mabidderBidAdapter.md +31 -0
  159. package/modules/oneKeyIdSystem.js +78 -0
  160. package/modules/oneKeyIdSystem.md +109 -0
  161. package/modules/oneKeyRtdProvider.js +98 -0
  162. package/modules/oneKeyRtdProvider.md +127 -0
  163. package/modules/permutiveRtdProvider.js +55 -8
  164. package/modules/pubmaticBidAdapter.js +14 -0
  165. package/modules/rtbhouseBidAdapter.js +24 -0
  166. package/modules/seedtagBidAdapter.md +25 -56
  167. package/modules/tripleliftBidAdapter.js +20 -1
  168. package/modules/trustpidSystem.js +6 -42
  169. package/modules/trustpidSystem.md +10 -10
  170. package/modules/userId/eids.js +26 -0
  171. package/modules/userId/userId.md +2 -2
  172. package/modules/viewability.js +14 -14
  173. package/modules/yahoosspBidAdapter.js +1 -1
  174. package/package.json +1 -1
  175. package/src/auction.js +2 -1
  176. package/src/native.js +22 -3
  177. package/src/sizeMapping.js +4 -6
  178. package/src/utils/promise.js +3 -1
  179. package/src/utils.js +27 -0
  180. package/src/video.js +5 -4
  181. package/test/pages/instream.html +2 -2
  182. package/test/spec/modules/acuityAdsBidAdapter_spec.js +398 -0
  183. package/test/spec/modules/appnexusBidAdapter_spec.js +1 -0
  184. package/test/spec/modules/beopBidAdapter_spec.js +11 -0
  185. package/test/spec/modules/big-richmediaBidAdapter_spec.js +1 -0
  186. package/test/spec/modules/consumableBidAdapter_spec.js +19 -0
  187. package/test/spec/modules/currency_spec.js +22 -0
  188. package/test/spec/modules/enrichmentFpdModule_spec.js +14 -0
  189. package/test/spec/modules/imRtdProvider_spec.js +10 -5
  190. package/test/spec/modules/ixBidAdapter_spec.js +6 -19
  191. package/test/spec/modules/lifestreetBidAdapter_spec.js +232 -0
  192. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +59 -7
  193. package/test/spec/modules/mabidderBidAdapter_spec.js +125 -0
  194. package/test/spec/modules/oneKeyIdSystem_spec.js +107 -0
  195. package/test/spec/modules/oneKeyRtdProvider_spec.js +152 -0
  196. package/test/spec/modules/permutiveRtdProvider_spec.js +152 -2
  197. package/test/spec/modules/pubmaticBidAdapter_spec.js +16 -0
  198. package/test/spec/modules/tripleliftBidAdapter_spec.js +18 -0
  199. package/test/spec/modules/trustpidSystem_spec.js +27 -45
  200. package/test/spec/native_spec.js +17 -2
@@ -8,14 +8,18 @@
8
8
  import {getGlobal} from '../src/prebidGlobal.js';
9
9
  import {submodule} from '../src/hook.js';
10
10
  import {getStorageManager} from '../src/storageManager.js';
11
- import {deepAccess, deepSetValue, isFn, logError, mergeDeep} from '../src/utils.js';
11
+ import {deepAccess, deepSetValue, isFn, logError, mergeDeep, isPlainObject, safeJSONParse} from '../src/utils.js';
12
12
  import {includes} from '../src/polyfill.js';
13
13
 
14
14
  const MODULE_NAME = 'permutive'
15
15
 
16
+ export const PERMUTIVE_SUBMODULE_CONFIG_KEY = 'permutive-prebid-rtd'
17
+
16
18
  export const storage = getStorageManager({gvlid: null, moduleName: MODULE_NAME})
17
19
 
18
- function init (moduleConfig, userConsent) {
20
+ function init(moduleConfig, userConsent) {
21
+ readPermutiveModuleConfigFromCache()
22
+
19
23
  return true
20
24
  }
21
25
 
@@ -43,20 +47,63 @@ export function initSegments (reqBidsConfigObj, callback, customModuleConfig) {
43
47
  }
44
48
  }
45
49
 
50
+ function liftIntoParams(params) {
51
+ return isPlainObject(params) ? { params } : {}
52
+ }
53
+
54
+ let cachedPermutiveModuleConfig = {}
55
+
46
56
  /**
47
- * Merges segments into existing bidder config
57
+ * Access the submodules RTD params that are cached to LocalStorage by the Permutive SDK. This lets the RTD submodule
58
+ * apply publisher defined params set in the Permutive platform, so they may still be applied if the Permutive SDK has
59
+ * not initialised before this submodule is initialised.
60
+ */
61
+ function readPermutiveModuleConfigFromCache() {
62
+ const params = safeJSONParse(storage.getDataFromLocalStorage(PERMUTIVE_SUBMODULE_CONFIG_KEY))
63
+ return cachedPermutiveModuleConfig = liftIntoParams(params)
64
+ }
65
+
66
+ /**
67
+ * Access the submodules RTD params attached to the Permutive SDK.
68
+ *
69
+ * @return The Permutive config available by the Permutive SDK or null if the operation errors.
70
+ */
71
+ function getParamsFromPermutive() {
72
+ try {
73
+ return liftIntoParams(window.permutive.addons.prebid.getPermutiveRtdConfig())
74
+ } catch (e) {
75
+ return null
76
+ }
77
+ }
78
+
79
+ /**
80
+ * Merges segments into existing bidder config in reverse priority order. The highest priority is 1.
81
+ *
82
+ * 1. customModuleConfig <- set by publisher with pbjs.setConfig
83
+ * 2. permutiveRtdConfig <- set by the publisher using the Permutive platform
84
+ * 3. defaultConfig
85
+ *
86
+ * As items with a higher priority will be deeply merged into the previous config, deep merges are performed by
87
+ * reversing the priority order.
88
+ *
48
89
  * @param {Object} customModuleConfig - Publisher config for module
49
- * @return {Object} Merged defatul and custom config
90
+ * @return {Object} Deep merges of the default, Permutive and custom config.
50
91
  */
51
- function getModuleConfig (customModuleConfig) {
92
+ export function getModuleConfig(customModuleConfig) {
93
+ // Use the params from Permutive if available, otherwise fallback to the cached value set by Permutive.
94
+ const permutiveModuleConfig = getParamsFromPermutive() || cachedPermutiveModuleConfig
95
+
52
96
  return mergeDeep({
53
97
  waitForIt: false,
54
98
  params: {
55
99
  maxSegs: 500,
56
100
  acBidders: [],
57
- overwrites: {}
58
- }
59
- }, customModuleConfig)
101
+ overwrites: {},
102
+ },
103
+ },
104
+ permutiveModuleConfig,
105
+ customModuleConfig,
106
+ )
60
107
  }
61
108
 
62
109
  /**
@@ -1174,6 +1174,7 @@ export const spec = {
1174
1174
  if (commonFpd.bcat) {
1175
1175
  blockedIabCategories = blockedIabCategories.concat(commonFpd.bcat);
1176
1176
  }
1177
+
1177
1178
  if (commonFpd.ext?.prebid?.bidderparams?.[bidderRequest.bidderCode]?.acat) {
1178
1179
  const acatParams = commonFpd.ext.prebid.bidderparams[bidderRequest.bidderCode].acat;
1179
1180
  _allowedIabCategoriesValidation(payload, acatParams);
@@ -1181,6 +1182,19 @@ export const spec = {
1181
1182
  _allowedIabCategoriesValidation(payload, allowedIabCategories);
1182
1183
  }
1183
1184
  _blockedIabCategoriesValidation(payload, blockedIabCategories);
1185
+
1186
+ // Check if bidderRequest has timeout property if present send timeout as tmax value to translator request
1187
+ // bidderRequest has timeout property if publisher sets during calling requestBids function from page
1188
+ // if not bidderRequest contains global value set by Prebid
1189
+ if (bidderRequest?.timeout) {
1190
+ payload.tmax = bidderRequest.timeout || config.getConfig('bidderTimeout');
1191
+ } else {
1192
+ payload.tmax = window?.PWT?.versionDetails?.timeout;
1193
+ }
1194
+
1195
+ // Sending epoch timestamp in request.ext object
1196
+ payload.ext.epoch = new Date().getTime();
1197
+
1184
1198
  // Note: Do not move this block up
1185
1199
  // if site object is set in Prebid config then we need to copy required fields from site into app and unset the site object
1186
1200
  if (typeof config.getConfig('app') === 'object') {
@@ -81,6 +81,30 @@ export const spec = {
81
81
  }
82
82
  }
83
83
 
84
+ const ortb2Params = bidderRequest && bidderRequest.ortb2;
85
+ if (ortb2Params?.user) {
86
+ request.user = {
87
+ ...request.user,
88
+ ...(ortb2Params.user.data && {
89
+ data: { ...request.user?.data, ...ortb2Params.user.data },
90
+ }),
91
+ ...(ortb2Params.user.ext && {
92
+ ext: { ...request.user?.ext, ...ortb2Params.user.ext },
93
+ }),
94
+ };
95
+ }
96
+ if (ortb2Params?.site) {
97
+ request.site = {
98
+ ...request.site,
99
+ ...(ortb2Params.site.content && {
100
+ content: { ...request.site?.content, ...ortb2Params.site.content },
101
+ }),
102
+ ...(ortb2Params.site.ext && {
103
+ ext: { ...request.site?.ext, ...ortb2Params.site.ext },
104
+ }),
105
+ };
106
+ }
107
+
84
108
  return {
85
109
  method: 'POST',
86
110
  url: 'https://' + validBidRequests[0].params.region + '.' + ENDPOINT_URL,
@@ -8,19 +8,18 @@ Maintainer: prebid@seedtag.com
8
8
 
9
9
  # Description
10
10
 
11
- Module that connects to Seedtag demand sources to fetch bids.
11
+ Prebidjs seedtag bidder
12
12
 
13
- # Test Parameters
14
-
15
- ## Sample Banner Ad Unit
13
+ # Sample integration
16
14
 
15
+ ## InScreen
17
16
  ```js
18
17
  const adUnits = [
19
18
  {
20
- code: '/21804003197/prebid_test_300x250',
19
+ code: '/21804003197/prebid_test_320x100',
21
20
  mediaTypes: {
22
21
  banner: {
23
- sizes: [[300, 250]]
22
+ sizes: [[320, 100]]
24
23
  }
25
24
  },
26
25
  bids: [
@@ -29,8 +28,7 @@ const adUnits = [
29
28
  params: {
30
29
  publisherId: '0000-0000-01', // required
31
30
  adUnitId: '0000', // required
32
- placement: 'banner', // required
33
- adPosition: 0 // optional
31
+ placement: 'inScreen', // required
34
32
  }
35
33
  }
36
34
  ]
@@ -38,55 +36,26 @@ const adUnits = [
38
36
  ]
39
37
  ```
40
38
 
41
- ## Sample inStream Video Ad Unit
42
-
39
+ ## InArticle
43
40
  ```js
44
- var adUnits = [{
45
- code: 'video',
46
- mediaTypes: {
47
- video: {
48
- context: 'instream', // required
49
- playerSize: [600, 300], // required
50
- mimes: ['video/mp4'], // recommended
51
- minduration: 5, // optional
52
- maxduration: 60, // optional
53
- boxingallowed: 1, // optional
54
- skip: 1, // optional
55
- startdelay: 1, // optional
56
- linearity: 1, // optional
57
- battr: [1, 2], // optional
58
- maxbitrate: 10, // optional
59
- playbackmethod: [1], // optional
60
- delivery: [1], // optional
61
- placement: 1, // optional
62
- }
63
- },
64
- bids: [
65
- {
66
- bidder: 'seedtag',
67
- params: {
68
- publisherId: '0000-0000-01', // required
69
- adUnitId: '0000', // required
70
- placement: 'video', // required
71
- adPosition: 0, // optional
72
- video: { // optional
73
- context: 'instream', // optional
74
- playerSize: [600, 300], // optional
75
- mimes: ['video/mp4'], // optional
76
- minduration: 5, // optional
77
- maxduration: 60, // optional
78
- boxingallowed: 1, // optional
79
- skip: 1, // optional
80
- startdelay: 1, // optional
81
- linearity: 1, // optional
82
- battr: [1, 2], // optional
83
- maxbitrate: 10, // optional
84
- playbackmethod: [1], // optional
85
- delivery: [1], // optional
86
- placement: 1, // optional
41
+ const adUnits = [
42
+ {
43
+ code: '/21804003197/prebid_test_300x250',
44
+ mediaTypes: {
45
+ banner: {
46
+ sizes: [[300, 250], [1, 1]]
47
+ }
48
+ },
49
+ bids: [
50
+ {
51
+ bidder: 'seedtag',
52
+ params: {
53
+ publisherId: '0000-0000-01', // required
54
+ adUnitId: '0000', // required
55
+ placement: 'inArticle', // required
87
56
  }
88
57
  }
89
- }
90
- ]
91
- }];
58
+ ]
59
+ }
60
+ ]
92
61
  ```
@@ -139,7 +139,8 @@ function _buildPostBody(bidRequests, bidderRequest) {
139
139
  ...getUnifiedIdEids([bidRequests[0]]),
140
140
  ...getIdentityLinkEids([bidRequests[0]]),
141
141
  ...getCriteoEids([bidRequests[0]]),
142
- ...getPubCommonEids([bidRequests[0]])
142
+ ...getPubCommonEids([bidRequests[0]]),
143
+ ...getUniversalEids(bidRequests[0])
143
144
  ];
144
145
 
145
146
  if (eids.length > 0) {
@@ -312,6 +313,24 @@ function getPubCommonEids(bidRequest) {
312
313
  return getEids(bidRequest, 'pubcid', 'pubcid.org', 'pubcid');
313
314
  }
314
315
 
316
+ function getUniversalEids(bidRequest) {
317
+ let common = ['adserver.org', 'liveramp.com', 'criteo.com', 'pubcid.org'];
318
+ let eids = [];
319
+ if (bidRequest.userIdAsEids) {
320
+ bidRequest.userIdAsEids.forEach(id => {
321
+ try {
322
+ if (common.indexOf(id.source) === -1) {
323
+ let uids = id.uids.map(uid => ({ id: uid.id, ext: { rtiPartner: id.source } }));
324
+ eids.push({ source: id.source, uids });
325
+ }
326
+ } catch (err) {
327
+ logWarn(`Triplelift: Error attempting to add ${id} to bid request`, err);
328
+ }
329
+ });
330
+ }
331
+ return eids;
332
+ }
333
+
315
334
  function getEids(bidRequest, type, source, rtiPartner) {
316
335
  return bidRequest
317
336
  .map(getUserId(type)) // bids -> userIds of a certain type
@@ -10,7 +10,6 @@ import { getStorageManager } from '../src/storageManager.js';
10
10
 
11
11
  const MODULE_NAME = 'trustpid';
12
12
  const LOG_PREFIX = 'Trustpid module'
13
- let mnoAcronym = '';
14
13
  let mnoDomain = '';
15
14
 
16
15
  export const storage = getStorageManager({gvlid: null, moduleName: MODULE_NAME});
@@ -30,7 +29,6 @@ function messageHandler(event) {
30
29
  let domainURL = URL[1].split('/');
31
30
  mnoDomain = domainURL[0];
32
31
  logInfo(`${LOG_PREFIX}: Message handler set domain to ${mnoDomain}`);
33
- getDomainAcronym(mnoDomain);
34
32
  }
35
33
  }
36
34
  } catch (e) {
@@ -38,27 +36,13 @@ function messageHandler(event) {
38
36
  }
39
37
  }
40
38
 
41
- /**
42
- * Properly sets the trustpid acronym depending on the domain value.
43
- * @param domain
44
- */
45
- function getDomainAcronym(domain) {
46
- const prefix = '-';
47
- const acronym = window.FC_CONF?.TELCO_ACRONYM?.[domain];
48
- if (!acronym) {
49
- logInfo(`${LOG_PREFIX}: No acronym found for domain: ${domain}`);
50
- return;
51
- }
52
- mnoAcronym = prefix + acronym;
53
- }
54
-
55
39
  // Set a listener to handle the iframe response message.
56
40
  window.addEventListener('message', messageHandler, false);
57
41
 
58
42
  /**
59
- * Get the "umid" from html5 local storage to make it available to the UserId module.
43
+ * Get the "atid" from html5 local storage to make it available to the UserId module.
60
44
  * @param config
61
- * @returns {{trustpid: (*|string), acr: (string)}}
45
+ * @returns {{trustpid: (*|string)}}
62
46
  */
63
47
  function getTrustpidFromStorage() {
64
48
  // Get the domain either from localStorage or global
@@ -69,25 +53,6 @@ function getTrustpidFromStorage() {
69
53
  logInfo(`${LOG_PREFIX}: Local storage domain not found, returning null`);
70
54
  return {
71
55
  trustpid: null,
72
- acr: null,
73
- };
74
- }
75
-
76
- // Get the acronym from global
77
- let acronym = mnoAcronym;
78
- // if acronym is empty, but "domain" is available, get the acronym from domain
79
- if (!acronym) {
80
- getDomainAcronym(domain);
81
- acronym = mnoAcronym;
82
- }
83
-
84
- logInfo(`${LOG_PREFIX}: Domain acronym found: ${acronym}`);
85
-
86
- // Domain is correct in both local storage and idGraph, but no acronym is existing for the domain
87
- if (!acronym) {
88
- return {
89
- trustpid: null,
90
- acr: null
91
56
  };
92
57
  }
93
58
 
@@ -106,10 +71,9 @@ function getTrustpidFromStorage() {
106
71
  logInfo(`${LOG_PREFIX}: Local storage fcIdConnectObject for domain: ${JSON.stringify(fcIdConnectObject)}`);
107
72
 
108
73
  return {
109
- trustpid: (fcIdConnectObject && fcIdConnectObject.umid)
110
- ? fcIdConnectObject.umid
74
+ trustpid: (fcIdConnectObject && fcIdConnectObject.atid)
75
+ ? fcIdConnectObject.atid
111
76
  : null,
112
- acr: acronym,
113
77
  };
114
78
  }
115
79
 
@@ -138,7 +102,7 @@ export const trustpidSubmodule = {
138
102
  const data = getTrustpidFromStorage();
139
103
  if (data.trustpid) {
140
104
  logInfo(`${LOG_PREFIX}: Local storage ID value ${JSON.stringify(data)}`);
141
- return {id: {trustpid: data.trustpid + data.acr}};
105
+ return {id: {trustpid: data.trustpid}};
142
106
  } else {
143
107
  if (!config) {
144
108
  config = {};
@@ -165,7 +129,7 @@ export const trustpidSubmodule = {
165
129
  }, delayStep);
166
130
  }
167
131
  } else {
168
- const dataToReturn = { trustpid: data.trustpid + data.acr };
132
+ const dataToReturn = { trustpid: data.trustpid };
169
133
  logInfo(`${LOG_PREFIX}: Returning ID value data of ${JSON.stringify(dataToReturn)}`);
170
134
  callback(dataToReturn);
171
135
  }
@@ -10,13 +10,13 @@ gulp build --modules=userId,adfBidAdapter,ixBidAdapter,prebidServerBidAdapter,tr
10
10
 
11
11
  ## Parameter Descriptions
12
12
 
13
- | Params under userSync.userIds[] | Type | Description | Example |
14
- | --- | --- | --- | --- |
15
- | name | String | The name of the module | `"trustpid"` |
16
- | params | Object | Object with configuration parameters for trustpid User Id submodule | - |
17
- | params.maxDelayTime | Integer | Max amount of time (in seconds) before looking into storage for data | 2500 |
18
- | bidders | Array of Strings | An array of bidder codes to which this user ID may be sent. Currently required and supporting AdformOpenRTB | [`"adf"`, `"adformPBS"`, `"ix"`] |
19
- | storage | Object | Local storage configuration object | - |
20
- | storage.type | String | Type of the storage that would be used to store user ID. Must be `"html5"` to utilise HTML5 local storage. | `"html5"` |
21
- | storage.name | String | The name of the key in local storage where the user ID will be stored. | `"trustpid"` |
22
- | storage.expires | Integer | How long (in days) the user ID information will be stored. For safety reasons, this information is required.| `1` |
13
+ | Params under userSync.userIds[] | Type | Description | Example |
14
+ | ------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------- |
15
+ | name | String | The name of the module | `"trustpid"` |
16
+ | params | Object | Object with configuration parameters for trustpid User Id submodule | - |
17
+ | params.maxDelayTime | Integer | Max amount of time (in seconds) before looking into storage for data | 2500 |
18
+ | bidders | Array of Strings | An array of bidder codes to which this user ID may be sent. Currently required and supporting AdformOpenRTB | [`"adf"`, `"adformPBS"`, `"ix"`] |
19
+ | storage | Object | Local storage configuration object | - |
20
+ | storage.type | String | Type of the storage that would be used to store user ID. Must be `"html5"` to utilise HTML5 local storage. | `"html5"` |
21
+ | storage.name | String | The name of the key in local storage where the user ID will be stored. | `"trustpid"` |
22
+ | storage.expires | Integer | How long (in days) the user ID information will be stored. For safety reasons, this information is required. | `1` |
@@ -330,6 +330,32 @@ export const USER_IDS_CONFIG = {
330
330
  'cpexId': {
331
331
  source: 'czechadid.cz',
332
332
  atype: 1
333
+ },
334
+
335
+ // OneKey Data
336
+ 'oneKeyData': {
337
+ getValue: function(data) {
338
+ if (data && Array.isArray(data.identifiers) && data.identifiers[0]) {
339
+ return data.identifiers[0].value;
340
+ }
341
+ },
342
+ source: 'paf',
343
+ atype: 1,
344
+ getEidExt: function(data) {
345
+ if (data && data.preferences) {
346
+ return {preferences: data.preferences};
347
+ }
348
+ },
349
+ getUidExt: function(data) {
350
+ if (data && Array.isArray(data.identifiers) && data.identifiers[0]) {
351
+ const id = data.identifiers[0];
352
+ return {
353
+ version: id.version,
354
+ type: id.type,
355
+ source: id.source
356
+ };
357
+ }
358
+ }
333
359
  }
334
360
  };
335
361
 
@@ -151,7 +151,7 @@ pbjs.setConfig({
151
151
  },
152
152
  {
153
153
  name: "dacId"
154
- },
154
+ },
155
155
  {
156
156
  name: "gravitompId"
157
157
  }
@@ -372,4 +372,4 @@ pbjs.setConfig({
372
372
  syncDelay: 5000
373
373
  }
374
374
  });
375
- ```
375
+ ```
@@ -13,7 +13,7 @@ export function init() {
13
13
  listenMessagesFromCreative();
14
14
  }
15
15
 
16
- const observers = {};
16
+ const observers = new Map();
17
17
 
18
18
  function isValid(vid, element, tracker, criteria) {
19
19
  if (!element) {
@@ -36,7 +36,7 @@ function isValid(vid, element, tracker, criteria) {
36
36
  return false;
37
37
  }
38
38
 
39
- if (!vid || observers[vid]) {
39
+ if (!vid || observers.has(vid)) {
40
40
  logWarn(`${MODULE_NAME}: must provide an unregistered vid`, vid);
41
41
  return false;
42
42
  }
@@ -46,7 +46,7 @@ function isValid(vid, element, tracker, criteria) {
46
46
 
47
47
  function stopObserving(observer, vid, element) {
48
48
  observer.unobserve(element);
49
- observers[vid].done = true;
49
+ observers.get(vid).done = true;
50
50
  }
51
51
 
52
52
  function fireViewabilityTracker(element, tracker) {
@@ -96,21 +96,21 @@ export function startMeasurement(vid, element, tracker, criteria) {
96
96
  viewable = entries[0].isIntersecting;
97
97
 
98
98
  if (viewable) {
99
- observers[vid].timeoutId = window.setTimeout(() => {
99
+ observers.get(vid).timeoutId = window.setTimeout(() => {
100
100
  viewabilityCriteriaMet(observer, vid, element, tracker);
101
101
  }, criteria.timeInView);
102
- } else if (observers[vid].timeoutId) {
103
- window.clearTimeout(observers[vid].timeoutId);
102
+ } else if (observers.get(vid).timeoutId) {
103
+ window.clearTimeout(observers.get(vid).timeoutId);
104
104
  }
105
105
  };
106
106
 
107
107
  observer = new IntersectionObserver(stateChange, options);
108
- observers[vid] = {
108
+ observers.set(vid, {
109
109
  observer: observer,
110
110
  element: element,
111
111
  timeoutId: null,
112
112
  done: false,
113
- };
113
+ });
114
114
 
115
115
  observer.observe(element);
116
116
 
@@ -122,19 +122,19 @@ export function startMeasurement(vid, element, tracker, criteria) {
122
122
  * @param {string} vid unique viewability identifier
123
123
  */
124
124
  export function stopMeasurement(vid) {
125
- if (!vid || !observers[vid]) {
125
+ if (!vid || !observers.has(vid)) {
126
126
  logWarn(`${MODULE_NAME}: must provide a registered vid`, vid);
127
127
  return;
128
128
  }
129
129
 
130
- observers[vid].observer.unobserve(observers[vid].element);
131
- if (observers[vid].timeoutId) {
132
- window.clearTimeout(observers[vid].timeoutId);
130
+ observers.get(vid).observer.unobserve(observers.get(vid).element);
131
+ if (observers.get(vid).timeoutId) {
132
+ window.clearTimeout(observers.get(vid).timeoutId);
133
133
  }
134
134
 
135
135
  // allow the observer under this vid to be created again
136
- if (!observers[vid].done) {
137
- delete observers[vid];
136
+ if (!observers.get(vid).done) {
137
+ observers.delete(vid);
138
138
  }
139
139
  }
140
140
 
@@ -488,7 +488,7 @@ function generateServerRequest({payload, requestOptions, bidderRequest}) {
488
488
 
489
489
  function createRenderer(bidderRequest, bidResponse) {
490
490
  const renderer = Renderer.install({
491
- url: 'https://cdn.vidible.tv/prod/hb-outstream-renderer/renderer.js',
491
+ url: 'https://s.yimg.com/kp/prebid-outstream-renderer/renderer.js',
492
492
  loaded: false,
493
493
  adUnitCode: bidderRequest.adUnitCode
494
494
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prebid.js",
3
- "version": "7.12.0",
3
+ "version": "7.13.0",
4
4
  "description": "Header Bidding Management Library",
5
5
  "main": "src/prebid.js",
6
6
  "scripts": {
package/src/auction.js CHANGED
@@ -498,8 +498,9 @@ function tryAddVideoBid(auctionInstance, bidResponse, afterBidAdded, {index = au
498
498
  transactionId: bidResponse.transactionId
499
499
  }), 'video');
500
500
  const context = videoMediaType && deepAccess(videoMediaType, 'context');
501
+ const useCacheKey = videoMediaType && deepAccess(videoMediaType, 'useCacheKey');
501
502
 
502
- if (config.getConfig('cache.url') && context !== OUTSTREAM) {
503
+ if (config.getConfig('cache.url') && (useCacheKey || context !== OUTSTREAM)) {
503
504
  if (!bidResponse.videoCacheKey || config.getConfig('cache.ignoreBidderCacheKey')) {
504
505
  addBid = false;
505
506
  callPrebidCache(auctionInstance, bidResponse, afterBidAdded, videoMediaType);
package/src/native.js CHANGED
@@ -272,7 +272,7 @@ export function fireNativeTrackers(message, bidResponse) {
272
272
  const nativeResponse = bidResponse.native.ortb || legacyPropertiesToOrtbNative(bidResponse.native);
273
273
 
274
274
  if (message.action === 'click') {
275
- fireClickTrackers(nativeResponse);
275
+ fireClickTrackers(nativeResponse, message?.assetId);
276
276
  } else {
277
277
  fireImpressionTrackers(nativeResponse);
278
278
  }
@@ -305,8 +305,27 @@ export function fireImpressionTrackers(nativeResponse, {runMarkup = (mkup) => in
305
305
  }
306
306
  }
307
307
 
308
- export function fireClickTrackers(nativeResponse, {fetchURL = triggerPixel} = {}) {
309
- (nativeResponse.link?.clicktrackers || []).forEach(url => fetchURL(url));
308
+ export function fireClickTrackers(nativeResponse, assetId = null, {fetchURL = triggerPixel} = {}) {
309
+ // legacy click tracker
310
+ if (!assetId) {
311
+ (nativeResponse.link?.clicktrackers || []).forEach(url => fetchURL(url));
312
+ } else {
313
+ // ortb click tracker. This will try to call the clicktracker associated with the asset;
314
+ // will fallback to the link if none is found.
315
+ const assetIdLinkMap = (nativeResponse.assets || [])
316
+ .filter(a => a.link)
317
+ .reduce((map, asset) => {
318
+ map[asset.id] = asset.link;
319
+ return map
320
+ }, {});
321
+ const masterClickTrackers = nativeResponse.link?.clicktrackers || [];
322
+ let assetLink = assetIdLinkMap[assetId];
323
+ let clickTrackers = masterClickTrackers;
324
+ if (assetLink) {
325
+ clickTrackers = assetLink.clicktrackers || [];
326
+ }
327
+ clickTrackers.forEach(url => fetchURL(url));
328
+ }
310
329
  }
311
330
 
312
331
  /**
@@ -1,6 +1,7 @@
1
1
  import { config } from './config.js';
2
2
  import {logWarn, logInfo, isPlainObject, deepAccess, deepClone, getWindowTop} from './utils.js';
3
3
  import {includes} from './polyfill.js';
4
+ import {BANNER} from './mediaTypes.js';
4
5
 
5
6
  let sizeConfig = [];
6
7
 
@@ -75,22 +76,19 @@ export function resolveStatus({labels = [], labelAll = false, activeLabels = []}
75
76
  } else {
76
77
  mediaTypes = {};
77
78
  }
78
- } else {
79
- mediaTypes = deepClone(mediaTypes);
80
79
  }
81
80
 
82
81
  let oldSizes = deepAccess(mediaTypes, 'banner.sizes');
83
82
  if (maps.shouldFilter && oldSizes) {
83
+ mediaTypes = deepClone(mediaTypes);
84
84
  mediaTypes.banner.sizes = oldSizes.filter(size => maps.sizesSupported[size]);
85
85
  }
86
86
 
87
- let allMediaTypes = Object.keys(mediaTypes);
88
-
89
87
  let results = {
90
88
  active: (
91
- allMediaTypes.every(type => type !== 'banner')
89
+ !mediaTypes.hasOwnProperty(BANNER)
92
90
  ) || (
93
- allMediaTypes.some(type => type === 'banner') && deepAccess(mediaTypes, 'banner.sizes.length') > 0 && (
91
+ deepAccess(mediaTypes, 'banner.sizes.length') > 0 && (
94
92
  labels.length === 0 || (
95
93
  (!labelAll && (
96
94
  labels.some(label => maps.labels[label]) ||
@@ -1,10 +1,12 @@
1
+ import {getGlobal} from '../prebidGlobal.js';
2
+
1
3
  const SUCCESS = 0;
2
4
  const FAIL = 1;
3
5
 
4
6
  /**
5
7
  * A version of Promise that runs callbacks synchronously when it can (i.e. after it's been fulfilled or rejected).
6
8
  */
7
- export class GreedyPromise extends Promise {
9
+ export class GreedyPromise extends (getGlobal().Promise || Promise) {
8
10
  #result;
9
11
  #callbacks;
10
12
  #parent = null;