prebid.js 6.24.0 → 6.26.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 (178) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/adagioBidAdapter.js +1 -1
  3. package/dist/adbookpspBidAdapter.js +1 -1
  4. package/dist/adgenerationBidAdapter.js +1 -1
  5. package/dist/adrelevantisBidAdapter.js +1 -1
  6. package/dist/adtelligentBidAdapter.js +1 -1
  7. package/dist/adxcgBidAdapter.js +1 -1
  8. package/dist/adyoulikeBidAdapter.js +1 -1
  9. package/dist/ajaBidAdapter.js +1 -1
  10. package/dist/amxBidAdapter.js +1 -1
  11. package/dist/amxIdSystem.js +1 -1
  12. package/dist/appierAnalyticsAdapter.js +1 -1
  13. package/dist/appnexusBidAdapter.js +1 -1
  14. package/dist/asoBidAdapter.js +1 -1
  15. package/dist/audiencerunBidAdapter.js +1 -1
  16. package/dist/axonixBidAdapter.js +1 -1
  17. package/dist/beopBidAdapter.js +1 -1
  18. package/dist/bidglassBidAdapter.js +1 -1
  19. package/dist/big-richmediaBidAdapter.js +1 -1
  20. package/dist/bluebillywigBidAdapter.js +1 -1
  21. package/dist/bridgewellBidAdapter.js +1 -1
  22. package/dist/brightMountainMediaBidAdapter.js +1 -1
  23. package/dist/concertBidAdapter.js +1 -1
  24. package/dist/connectadBidAdapter.js +1 -1
  25. package/dist/consumableBidAdapter.js +1 -1
  26. package/dist/conversantBidAdapter.js +1 -1
  27. package/dist/cpexIdSystem.js +1 -1
  28. package/dist/craftBidAdapter.js +1 -1
  29. package/dist/criteoBidAdapter.js +1 -1
  30. package/dist/currency.js +1 -1
  31. package/dist/dfpAdServerVideo.js +1 -1
  32. package/dist/dspxBidAdapter.js +1 -1
  33. package/dist/eplanningBidAdapter.js +1 -1
  34. package/dist/glimpseBidAdapter.js +1 -1
  35. package/dist/gmosspBidAdapter.js +1 -1
  36. package/dist/goldbachBidAdapter.js +1 -1
  37. package/dist/gravitoIdSystem.js +1 -0
  38. package/dist/gridBidAdapter.js +1 -1
  39. package/dist/gridNMBidAdapter.js +1 -1
  40. package/dist/gumgumBidAdapter.js +1 -1
  41. package/dist/h12mediaBidAdapter.js +1 -1
  42. package/dist/id5IdSystem.js +1 -1
  43. package/dist/impactifyBidAdapter.js +1 -1
  44. package/dist/improvedigitalBidAdapter.js +1 -1
  45. package/dist/inmarBidAdapter.js +1 -1
  46. package/dist/insticatorBidAdapter.js +1 -1
  47. package/dist/invibesBidAdapter.js +1 -1
  48. package/dist/ixBidAdapter.js +1 -1
  49. package/dist/jixieBidAdapter.js +1 -1
  50. package/dist/justpremiumBidAdapter.js +1 -1
  51. package/dist/kargoBidAdapter.js +1 -1
  52. package/dist/konduitAnalyticsAdapter.js +1 -1
  53. package/dist/liveIntentIdSystem.js +1 -1
  54. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  55. package/dist/logicadBidAdapter.js +1 -1
  56. package/dist/loglyliftBidAdapter.js +1 -1
  57. package/dist/malltvAnalyticsAdapter.js +1 -1
  58. package/dist/marsmediaBidAdapter.js +1 -1
  59. package/dist/mediafuseBidAdapter.js +1 -1
  60. package/dist/mediakeysBidAdapter.js +1 -1
  61. package/dist/mediasquareBidAdapter.js +1 -1
  62. package/dist/mgidBidAdapter.js +1 -1
  63. package/dist/minutemediaBidAdapter.js +1 -1
  64. package/dist/not-for-prod/prebid.js +123 -121
  65. package/dist/oguryBidAdapter.js +1 -1
  66. package/dist/oneVideoBidAdapter.js +1 -1
  67. package/dist/onetagBidAdapter.js +1 -1
  68. package/dist/ooloAnalyticsAdapter.js +1 -1
  69. package/dist/outbrainBidAdapter.js +1 -1
  70. package/dist/parrableIdSystem.js +1 -1
  71. package/dist/pixfutureBidAdapter.js +1 -1
  72. package/dist/prebid-core.js +3 -3
  73. package/dist/publinkIdSystem.js +1 -1
  74. package/dist/pubmaticBidAdapter.js +1 -1
  75. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  76. package/dist/pxyzBidAdapter.js +1 -1
  77. package/dist/quantcastBidAdapter.js +1 -1
  78. package/dist/readpeakBidAdapter.js +1 -1
  79. package/dist/relaidoBidAdapter.js +1 -1
  80. package/dist/rhythmoneBidAdapter.js +1 -1
  81. package/dist/riseBidAdapter.js +1 -1
  82. package/dist/rubiconAnalyticsAdapter.js +1 -1
  83. package/dist/rubiconBidAdapter.js +1 -1
  84. package/dist/seedingAllianceBidAdapter.js +1 -1
  85. package/dist/seedtagBidAdapter.js +1 -1
  86. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  87. package/dist/sharethroughBidAdapter.js +1 -1
  88. package/dist/smaatoBidAdapter.js +1 -1
  89. package/dist/smartadserverBidAdapter.js +1 -1
  90. package/dist/smartxBidAdapter.js +1 -1
  91. package/dist/smilewantedBidAdapter.js +1 -1
  92. package/dist/sonobiBidAdapter.js +1 -1
  93. package/dist/sortableBidAdapter.js +1 -1
  94. package/dist/sovrnAnalyticsAdapter.js +1 -1
  95. package/dist/sovrnBidAdapter.js +1 -1
  96. package/dist/sspBCBidAdapter.js +1 -1
  97. package/dist/sublimeBidAdapter.js +1 -1
  98. package/dist/synacormediaBidAdapter.js +1 -1
  99. package/dist/targetVideoBidAdapter.js +1 -1
  100. package/dist/teadsBidAdapter.js +1 -1
  101. package/dist/trionBidAdapter.js +1 -1
  102. package/dist/tripleliftBidAdapter.js +1 -1
  103. package/dist/trustpidSystem.js +1 -1
  104. package/dist/trustxBidAdapter.js +1 -1
  105. package/dist/ttdBidAdapter.js +1 -1
  106. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  107. package/dist/underdogmediaBidAdapter.js +1 -1
  108. package/dist/undertoneBidAdapter.js +1 -1
  109. package/dist/userId.js +1 -1
  110. package/dist/vidazooBidAdapter.js +1 -1
  111. package/dist/videobyteBidAdapter.js +1 -1
  112. package/dist/videoheroesBidAdapter.js +1 -0
  113. package/dist/vidoomyBidAdapter.js +1 -1
  114. package/dist/visxBidAdapter.js +1 -1
  115. package/dist/vuukleBidAdapter.js +1 -1
  116. package/dist/weboramaRtdProvider.js +1 -1
  117. package/dist/widespaceBidAdapter.js +1 -1
  118. package/dist/winrBidAdapter.js +1 -1
  119. package/dist/yahoosspBidAdapter.js +1 -1
  120. package/dist/yieldmoBidAdapter.js +1 -1
  121. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  122. package/dist/zeta_global_sspBidAdapter.js +1 -1
  123. package/integrationExamples/gpt/userId_example.html +3 -0
  124. package/integrationExamples/gpt/weboramaRtdProvider_example.html +65 -11
  125. package/modules/.submodules.json +2 -1
  126. package/modules/adagioBidAdapter.js +2 -0
  127. package/modules/adtelligentBidAdapter.js +3 -1
  128. package/modules/alkimiBidAdapter.md +10 -4
  129. package/modules/appnexusBidAdapter.js +13 -2
  130. package/modules/beopBidAdapter.js +51 -6
  131. package/modules/cpexIdSystem.js +1 -2
  132. package/modules/currency.js +4 -13
  133. package/modules/dacIdSystem.md +4 -4
  134. package/modules/dfpAdServerVideo.js +8 -0
  135. package/modules/gravitoIdSystem.js +57 -0
  136. package/modules/gravitoIdSystem.md +28 -0
  137. package/modules/improvedigitalBidAdapter.js +100 -43
  138. package/modules/invibesBidAdapter.js +55 -34
  139. package/modules/ixBidAdapter.js +62 -26
  140. package/modules/ixBidAdapter.md +42 -42
  141. package/modules/jixieBidAdapter.js +2 -0
  142. package/modules/kargoBidAdapter.js +23 -8
  143. package/modules/oguryBidAdapter.js +27 -1
  144. package/modules/trustpidSystem.js +9 -28
  145. package/modules/trustpidSystem.md +11 -34
  146. package/modules/userId/eids.js +6 -0
  147. package/modules/userId/index.js +30 -55
  148. package/modules/userId/userId.md +3 -11
  149. package/modules/videoheroesBidAdapter.js +267 -0
  150. package/modules/videoheroesBidAdapter.md +134 -0
  151. package/modules/vidoomyBidAdapter.js +2 -6
  152. package/modules/weboramaRtdProvider.js +515 -241
  153. package/modules/weboramaRtdProvider.md +488 -51
  154. package/modules/zeta_global_sspBidAdapter.js +1 -1
  155. package/package.json +4 -4
  156. package/src/adserver.js +7 -0
  157. package/src/hook.js +19 -1
  158. package/src/utils/promise.js +36 -0
  159. package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
  160. package/test/spec/modules/appnexusBidAdapter_spec.js +37 -10
  161. package/test/spec/modules/beopBidAdapter_spec.js +15 -2
  162. package/test/spec/modules/dfpAdServerVideo_spec.js +45 -0
  163. package/test/spec/modules/gravitoIdSystem_spec.js +51 -0
  164. package/test/spec/modules/improvedigitalBidAdapter_spec.js +289 -72
  165. package/test/spec/modules/invibesBidAdapter_spec.js +98 -7
  166. package/test/spec/modules/ixBidAdapter_spec.js +132 -26
  167. package/test/spec/modules/jixieBidAdapter_spec.js +17 -0
  168. package/test/spec/modules/kargoBidAdapter_spec.js +45 -3
  169. package/test/spec/modules/liveIntentIdSystem_spec.js +2 -2
  170. package/test/spec/modules/loglyliftBidAdapter_spec.js +8 -0
  171. package/test/spec/modules/oguryBidAdapter_spec.js +181 -3
  172. package/test/spec/modules/trustpidSystem_spec.js +42 -19
  173. package/test/spec/modules/userId_spec.js +18 -0
  174. package/test/spec/modules/videoheroesBidAdapter_spec.js +363 -0
  175. package/test/spec/modules/weboramaRtdProvider_spec.js +2333 -266
  176. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +37 -24
  177. package/test/spec/unit/utils/promise_spec.js +49 -0
  178. package/test/spec/modules/medianetRtdProvider_spec.js +0 -146
@@ -70,10 +70,10 @@ object are detailed here.
70
70
  | siteId | Required | String | An IX-specific identifier that is associated with this ad unit. It will be associated to the single size, if the size is provided. This is similar to a placement ID or an ad unit ID that some other modules have. Examples: `'3723'`, `'6482'`, `'3639'`
71
71
  | size | Optional (Deprecated)| Number[] | The single size associated with the site ID. It should be one of the sizes listed in the ad unit under `adUnits[].sizes` or `adUnits[].mediaTypes.video.playerSize`. Examples: `[300, 250]`, `[300, 600]`
72
72
  | video | Optional | Hash | The video object will serve as the properties of the video ad. You can create any field under the video object that is mentioned in the `OpenRTB Spec v2.5`. Some fields like `mimes, protocols, minduration, maxduration` are required. Properties not defined at this level, will be pulled from the Adunit level.
73
- |video.w| Required | Integer | The video player size width in pixels that will be passed to demand partners.
74
- |video.h| Required | Integer | The video player size height in pixels that will be passed to demand partners.
75
- |video.playerSize| Optional* | Integer | The video player size that will be passed to demand partners. * In the absence of `video.w` and `video.h`, this field is required.
76
- | video.mimes | Required | String[] | Array list of content MIME types supported. Popular MIME types include, but are not limited to, `"video/x-ms- wmv"` for Windows Media and `"video/x-flv"` for Flash Video.
73
+ |video.w| Required | Integer | The width of the video player in pixels that will be passed to demand partners.<br /> *If you are using Index’s outstream player and have placed the `video` object at the `bidder` level, this is a required field. You must define the size of the video player using the `video.w` and `video.h` parameters, with a minimum video player size of 300 x 250.
74
+ |video.h| Required | Integer | The height of the video player in pixels that will be passed to demand partners. <br />*If you are using Index’s outstream player and have placed the `video` object at the `bidder` level, this is a required field. You must define the size of the video player using the `video.w` and `video.h` parameters, with a minimum video player size of 300 x 250.
75
+ |video.playerSize| Optional* | Array[Integer,Integer] | The video player size that will be passed to demand partners.</br /> *If you are using Index’s outstream player and have placed the `video` object at the `adUnit` level, this is a required field. You must define the size of the video player using this parameter, with a minimum video player size of 300 x 250.
76
+ | video.mimes | Required | String[] | If you are using Index’s outstream video player and want to learn more about what is supported, see [List of supported OpenRTB bid request fields for Sellers](https://kb.indexexchange.com/publishers/openrtb_integration/list_of_supported_openrtb_bid_request_fields_for_sellers.htm#Video).
77
77
  |video.minduration| Required | Integer | Minimum video ad duration in seconds.
78
78
  |video.maxduration| Required | Integer | Maximum video ad duration in seconds.
79
79
  |video.protocol / video.protocols| Required | Integer / Integer[] | Either a single protocol provided as an integer, or protocols provided as a list of integers. `2` - VAST 2.0, `3` - VAST 3.0, `5` - VAST 2.0 Wrapper, `6` - VAST 3.0 Wrapper
@@ -111,9 +111,7 @@ Both video and banner params will be read from the `adUnits[].mediaTypes.video`
111
111
  The examples in this guide assume the following starting configuration (you may remove banner or video, if either does not apply).
112
112
 
113
113
 
114
- In regards to video, `context` can either be `'instream'` or `'outstream'`. Note that `outstream` requires additional configuration on the adUnit.
115
-
116
-
114
+ In regards to video, `context` can either be `'instream'` or `'outstream'`.
117
115
 
118
116
  ```javascript
119
117
  var adUnits = [{
@@ -195,9 +193,9 @@ var adUnits = [{
195
193
  context: 'instream',
196
194
  playerSize: [300, 250],
197
195
  mimes: [
198
- 'video/mp4',
199
- 'video/webm'
200
- ],
196
+ 'video/mp4',
197
+ 'video/webm'
198
+ ],
201
199
  minduration: 0,
202
200
  maxduration: 60,
203
201
  protocols: [6]
@@ -224,45 +222,47 @@ Please note that you can re-use the existing `siteId` within the same flex
224
222
  position.
225
223
 
226
224
  **Video (Outstream):**
227
- Note that currently, outstream video rendering must be configured by the publisher. In the adUnit, a `renderer` object must be defined, which includes a `url` pointing to the video rendering script, and a `render` function for creating the video player. See http://prebid.org/dev-docs/show-outstream-video-ads.html for more information.
225
+
226
+ Publishers have two options to receive outstream video demand from Index:
227
+ * Using Index’s outstream video player
228
+ * In an outstream video configuration set up by the publisher. For more information, see [Prebid’s documentation on how to show video ads.](https://docs.prebid.org/dev-docs/show-outstream-video-ads.html)
229
+
230
+ **Index’s outstream video player**
231
+ Publishers who are using Index as a bidding adapter in Prebid.js can show outstream video ads on their site from us by using Index’s outstream video player. This allows a video ad to display inside of a video player and can be placed anywhere on a publisher’s site, such as in-article, in-feed, and more.
232
+
233
+ Define a new `video` object for our outstream video player at either the adUnit level or the `bidder` level. If you are setting it at the bidder level, define the size of the video player using the parameters `video.h` and `video.w`. If you are setting it at the `adUnit` level, define the size using video.playerSize.
234
+
235
+ For more information on how to structure the `video` object, refer to the following code example:
236
+
228
237
 
229
238
  ```javascript
230
239
  var adUnits = [{
231
- code: 'video-div-a',
240
+ code: 'div-gpt-ad-1571167646410-1',
232
241
  mediaTypes: {
233
242
  video: {
243
+ playerSize: [640, 360],
234
244
  context: 'outstream',
235
- playerSize: [300, 250],
236
- mimes: [
237
- 'video/mp4',
238
- 'video/webm'
239
- ],
240
- minduration: 0,
241
- maxduration: 60,
242
- protocols: [6]
243
- }
244
- },
245
- renderer: {
246
- url: 'https://test.com/my-video-player.js',
247
- render: function (bid) {
248
- ...
245
+ api: [2],
246
+ protocols: [2, 3, 5, 6],
247
+ minduration: 5,
248
+ maxduration: 30,
249
+ mimes: ['video/mp4', 'application/javascript'],
250
+ placement: 3
249
251
  }
250
252
  },
251
253
  bids: [{
252
254
  bidder: 'ix',
253
255
  params: {
254
- siteId: '12345',
255
- video: {
256
- // If required, use this to override mediaTypes.video.XX properties
257
- }
256
+ siteId: '715964'
258
257
  }
259
258
  }]
260
259
  }];
261
260
  ```
261
+ <em>Please note that your use of the outstream video player will be governed by and subject to the terms and conditions of i) any master services or license agreement entered into by you and Index Exchange; ii) the information provided on our knowledge base linked [here](https://kb.indexexchange.com/publishers/prebid_integration/outstream_video_prebidjs.htm) and [here](https://kb.indexexchange.com/publishers/guidelines/standard_contractual_clauses.htm), and iii) our [Privacy Policy](https://www.indexexchange.com/privacy/). Your use of Index’s outstream video player constitutes your acknowledgement and acceptance of the foregoing. </em>
262
262
 
263
263
  #### Video Caching
264
264
 
265
- Note that the IX adapter expects a client-side Prebid Cache to be enabled for video bidding.
265
+ Note that the IX adapter expects a client-side Prebid Cache to be enabled for instream video bidding.
266
266
 
267
267
  ```
268
268
  pbjs.setConfig({
@@ -293,21 +293,21 @@ pbjs.setConfig({
293
293
  By default, the IX bidding adapter bids on all banner sizes available in the ad unit when configured to at least one banner size. If you want the IX bidding adapter to only bid on the banner size it’s configured to, switch off this feature using `detectMissingSizes`.
294
294
  ```
295
295
  pbjs.setConfig({
296
- ix: {
297
- detectMissingSizes: false
298
- }
299
- });
296
+ ix: {
297
+ detectMissingSizes: false
298
+ }
299
+ });
300
300
  ```
301
301
  OR
302
302
  ```
303
303
  pbjs.setBidderConfig({
304
- bidders: ["ix"],
305
- config: {
306
- ix: {
307
- detectMissingSizes: false
308
- }
309
- }
310
- });
304
+ bidders: ["ix"],
305
+ config: {
306
+ ix: {
307
+ detectMissingSizes: false
308
+ }
309
+ }
310
+ });
311
311
  ```
312
312
 
313
313
  ### 2. Include `ixBidAdapter` in your build process
@@ -184,6 +184,7 @@ export const spec = {
184
184
  let ids = fetchIds_();
185
185
  let eids = [];
186
186
  let miscDims = internal.getMiscDims();
187
+ let schain = deepAccess(validBidRequests[0], 'schain');
187
188
 
188
189
  // all available user ids are sent to our backend in the standard array layout:
189
190
  if (validBidRequests[0].userId) {
@@ -209,6 +210,7 @@ export const spec = {
209
210
  mkeywords: miscDims.mkeywords,
210
211
  bids: bids,
211
212
  eids: eids,
213
+ schain: schain,
212
214
  pricegranularity: pg,
213
215
  cfg: jixieCfgBlob
214
216
  }, ids);
@@ -70,27 +70,42 @@ export const spec = {
70
70
  const bidResponses = [];
71
71
  for (let bidId in bids) {
72
72
  let adUnit = bids[bidId];
73
- let meta;
73
+ let meta = {
74
+ mediaType: BANNER
75
+ };
76
+
74
77
  if (adUnit.metadata && adUnit.metadata.landingPageDomain) {
75
- meta = {
76
- clickUrl: adUnit.metadata.landingPageDomain[0],
77
- advertiserDomains: adUnit.metadata.landingPageDomain
78
- };
78
+ meta.clickUrl = adUnit.metadata.landingPageDomain[0];
79
+ meta.advertiserDomains = adUnit.metadata.landingPageDomain;
80
+ }
81
+
82
+ if (adUnit.mediaType && SUPPORTED_MEDIA_TYPES.includes(adUnit.mediaType)) {
83
+ meta.mediaType = adUnit.mediaType;
79
84
  }
80
- bidResponses.push({
85
+
86
+ const bidResponse = {
81
87
  requestId: bidId,
82
88
  cpm: Number(adUnit.cpm),
83
89
  width: adUnit.width,
84
90
  height: adUnit.height,
85
- ad: adUnit.adm,
86
91
  ttl: 300,
87
92
  creativeId: adUnit.id,
88
93
  dealId: adUnit.targetingCustom,
89
94
  netRevenue: true,
90
95
  currency: adUnit.currency || bidRequest.currency,
96
+ mediaType: meta.mediaType,
91
97
  meta: meta
92
- });
98
+ };
99
+
100
+ if (meta.mediaType == VIDEO) {
101
+ bidResponse.vastXml = adUnit.adm;
102
+ } else {
103
+ bidResponse.ad = adUnit.adm;
104
+ }
105
+
106
+ bidResponses.push(bidResponse);
93
107
  }
108
+
94
109
  return bidResponses;
95
110
  },
96
111
  getUserSyncs: function(syncOptions, responses, gdprConsent, usPrivacy) {
@@ -10,7 +10,29 @@ const DEFAULT_TIMEOUT = 1000;
10
10
  const BID_HOST = 'https://mweb-hb.presage.io/api/header-bidding-request';
11
11
  const TIMEOUT_MONITORING_HOST = 'https://ms-ads-monitoring-events.presage.io';
12
12
  const MS_COOKIE_SYNC_DOMAIN = 'https://ms-cookie-sync.presage.io';
13
- const ADAPTER_VERSION = '1.2.11';
13
+ const ADAPTER_VERSION = '1.2.12';
14
+
15
+ function getClientWidth() {
16
+ const documentElementClientWidth = window.top.document.documentElement.clientWidth
17
+ ? window.top.document.documentElement.clientWidth
18
+ : 0
19
+ const innerWidth = window.top.innerWidth ? window.top.innerWidth : 0
20
+ const outerWidth = window.top.outerWidth ? window.top.outerWidth : 0
21
+ const screenWidth = window.top.screen.width ? window.top.screen.width : 0
22
+
23
+ return documentElementClientWidth || innerWidth || outerWidth || screenWidth
24
+ }
25
+
26
+ function getClientHeight() {
27
+ const documentElementClientHeight = window.top.document.documentElement.clientHeight
28
+ ? window.top.document.documentElement.clientHeight
29
+ : 0
30
+ const innerHeight = window.top.innerHeight ? window.top.innerHeight : 0
31
+ const outerHeight = window.top.outerHeight ? window.top.outerHeight : 0
32
+ const screenHeight = window.top.screen.height ? window.top.screen.height : 0
33
+
34
+ return documentElementClientHeight || innerHeight || outerHeight || screenHeight
35
+ }
14
36
 
15
37
  function isBidRequestValid(bid) {
16
38
  const adUnitSizes = getAdUnitSizes(bid);
@@ -60,6 +82,10 @@ function buildRequests(validBidRequests, bidderRequest) {
60
82
  ext: {
61
83
  adapterversion: ADAPTER_VERSION,
62
84
  prebidversion: '$prebid.version$'
85
+ },
86
+ device: {
87
+ w: getClientWidth(),
88
+ h: getClientHeight()
63
89
  }
64
90
  };
65
91
 
@@ -4,7 +4,7 @@
4
4
  * @module modules/trustpidSystem
5
5
  * @requires module:modules/userId
6
6
  */
7
- import { logInfo, logError } from '../src/utils.js';
7
+ import { logInfo } from '../src/utils.js';
8
8
  import { submodule } from '../src/hook.js';
9
9
  import { getStorageManager } from '../src/storageManager.js';
10
10
 
@@ -22,10 +22,9 @@ export const storage = getStorageManager({gvlid: null, moduleName: MODULE_NAME})
22
22
  * @param event
23
23
  */
24
24
  function messageHandler(event) {
25
- let msg;
26
25
  try {
27
- if (event && event.data && typeof event.data === 'string' && event.data) {
28
- msg = JSON.parse(event.data);
26
+ if (event && event.data && typeof event.data === 'string') {
27
+ const msg = JSON.parse(event.data);
29
28
  if (msg.msgType === 'MNOSELECTOR' && msg.body && msg.body.url) {
30
29
  let URL = msg.body.url.split('//');
31
30
  let domainURL = URL[1].split('/');
@@ -35,7 +34,7 @@ function messageHandler(event) {
35
34
  }
36
35
  }
37
36
  } catch (e) {
38
- logError(e);
37
+ logInfo(`${LOG_PREFIX}: Unsupported message caught. Origin: ${event.origin}, data: ${event.data}.`);
39
38
  }
40
39
  }
41
40
 
@@ -44,31 +43,13 @@ function messageHandler(event) {
44
43
  * @param domain
45
44
  */
46
45
  function getDomainAcronym(domain) {
47
- let acronym = '';
48
46
  const prefix = '-';
49
- switch (domain) {
50
- case 'tmi.mno.link':
51
- acronym = 'ndye';
52
- break;
53
- case 'tmi.vodafone.de':
54
- acronym = 'pqnx';
55
- break;
56
- case 'tmi.telekom.de':
57
- acronym = 'avgw';
58
- break;
59
- case 'tmi.tmid.es':
60
- acronym = 'kjws';
61
- break;
62
- case 'uat.mno.link':
63
- acronym = 'xxxx';
64
- break;
65
- case 'es.tmiservice.orange.com':
66
- acronym = 'aplw';
67
- break;
68
- default:
69
- return 'none';
47
+ const acronym = window.FC_CONF?.TELCO_ACRONYM?.[domain];
48
+ if (!acronym) {
49
+ logInfo(`${LOG_PREFIX}: No acronym found for domain: ${domain}`);
50
+ return;
70
51
  }
71
- return mnoAcronym = prefix + acronym;
52
+ mnoAcronym = prefix + acronym;
72
53
  }
73
54
 
74
55
  // Set a listener to handle the iframe response message.
@@ -5,41 +5,18 @@ trustpid User Id Module.
5
5
  First, make sure to add the trustpid submodule to your Prebid.js package with:
6
6
 
7
7
  ```
8
- gulp build --modules=userId,adfBidAdapter,trustpidSystem
9
- ```
10
-
11
- The following configuration parameters are available:
12
-
13
- ```
14
- pbjs.setConfig({
15
- userSync: {
16
- userIds: [
17
- {
18
- name: 'trustpid',
19
- params: {
20
- maxDelayTime: 1000,
21
- },
22
- bidders: ["adf"],
23
- storage: {
24
- type: "html5",
25
- name: "trustpid",
26
- expires: 1, //days
27
- },
28
- }
29
- ],
30
- }
31
- });
8
+ gulp build --modules=userId,adfBidAdapter,ixBidAdapter,prebidServerBidAdapter,trustpidSystem
32
9
  ```
33
10
 
34
11
  ## Parameter Descriptions
35
12
 
36
- | Param under userSync.userIds[] | Scope | Type | Description | Example |
37
- | --- | --- | --- | --- | --- |
38
- | name | Required | String | The name of the module | `"trustpid"`
39
- | params | Required | Object | Object with configuration parameters for trustpid User Id submodule | - |
40
- | params.maxDelayTime | Required | Integer | Max amount of time (in seconds) before looking into storage for data | 2500 |
41
- | bidders | Required | Array of Strings | An array of bidder codes to which this user ID may be sent. Currently required and supporting AdformOpenRTB | `["adf"]` |
42
- | storage | Required | Object | Local storage configuration object | - |
43
- | storage.type | Required | String | Type of the storage that would be used to store user ID. Must be `"html5"` to utilise HTML5 local storage. | `"html5"` |
44
- | storage.name | Required | String | The name of the key in local storage where the user ID will be stored. | `"trustpid"` |
45
- | storage.expires | Required | 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` |
@@ -314,6 +314,12 @@ export const USER_IDS_CONFIG = {
314
314
  return data.envelope;
315
315
  }
316
316
  },
317
+
318
+ // Gravito MP ID
319
+ 'gravitompId': {
320
+ source: 'gravito.net',
321
+ atype: 1
322
+ },
317
323
  };
318
324
 
319
325
  // this function will create an eid object for the given UserId sub-module
@@ -131,7 +131,7 @@ import * as events from '../../src/events.js';
131
131
  import {getGlobal} from '../../src/prebidGlobal.js';
132
132
  import {gdprDataHandler} from '../../src/adapterManager.js';
133
133
  import CONSTANTS from '../../src/constants.json';
134
- import {hook, module} from '../../src/hook.js';
134
+ import {hook, module, ready as hooksReady} from '../../src/hook.js';
135
135
  import {buildEidPermissions, createEidsArray, USER_IDS_CONFIG} from './eids.js';
136
136
  import {getCoreStorageManager} from '../../src/storageManager.js';
137
137
  import {
@@ -151,6 +151,8 @@ import {
151
151
  timestamp,
152
152
  isEmpty
153
153
  } from '../../src/utils.js';
154
+ import {getPPID as coreGetPPID} from '../../src/adserver.js';
155
+ import {promiseControls} from '../../src/utils/promise.js';
154
156
 
155
157
  const MODULE_NAME = 'User ID';
156
158
  const COOKIE = 'cookie';
@@ -528,42 +530,8 @@ function delayFor(ms) {
528
530
  const INIT_CANCELED = {};
529
531
 
530
532
  function idSystemInitializer({delay = delayFor} = {}) {
531
- /**
532
- * @returns a {promise, resolve, reject} trio where `promise` is resolved by calling `resolve` or `reject`.
533
- */
534
- function breakpoint() {
535
- const [SUCCESS, FAIL, RESULT] = [0, 1, 2];
536
- const status = {};
537
-
538
- function finisher(slot) {
539
- return function (val) {
540
- if (status[slot] != null) {
541
- status[slot](val);
542
- } else {
543
- status[slot] = true;
544
- status[RESULT] = val;
545
- }
546
- }
547
- }
548
-
549
- return {
550
- promise: new Promise((resolve, reject) => {
551
- if (status[SUCCESS] != null) {
552
- resolve(status[RESULT]);
553
- } else if (status[FAIL] != null) {
554
- reject(status[RESULT]);
555
- } else {
556
- status[SUCCESS] = resolve;
557
- status[FAIL] = reject;
558
- }
559
- }),
560
- resolve: finisher(SUCCESS),
561
- reject: finisher(FAIL)
562
- }
563
- }
564
-
565
- const startInit = breakpoint();
566
- const startCallbacks = breakpoint();
533
+ const startInit = promiseControls();
534
+ const startCallbacks = promiseControls();
567
535
  let cancel;
568
536
  let initialized = false;
569
537
 
@@ -571,7 +539,7 @@ function idSystemInitializer({delay = delayFor} = {}) {
571
539
  if (cancel != null) {
572
540
  cancel.reject(INIT_CANCELED);
573
541
  }
574
- cancel = breakpoint();
542
+ cancel = promiseControls();
575
543
  return Promise.race([promise, cancel.promise]);
576
544
  }
577
545
 
@@ -591,7 +559,7 @@ function idSystemInitializer({delay = delayFor} = {}) {
591
559
  }
592
560
 
593
561
  let done = cancelAndTry(
594
- startInit.promise
562
+ Promise.all([hooksReady, startInit.promise])
595
563
  .then(() => gdprDataHandler.promise)
596
564
  .then(checkRefs((consentData) => {
597
565
  initSubmodules(initModules, allModules, consentData);
@@ -650,6 +618,19 @@ function idSystemInitializer({delay = delayFor} = {}) {
650
618
 
651
619
  let initIdSystem;
652
620
 
621
+ function getPPID() {
622
+ // userSync.ppid should be one of the 'source' values in getUserIdsAsEids() eg pubcid.org or id5-sync.com
623
+ const matchingUserId = ppidSource && (getUserIdsAsEids() || []).find(userID => userID.source === ppidSource);
624
+ if (matchingUserId && typeof deepAccess(matchingUserId, 'uids.0.id') === 'string') {
625
+ const ppidValue = matchingUserId.uids[0].id.replace(/[\W_]/g, '');
626
+ if (ppidValue.length >= 32 && ppidValue.length <= 150) {
627
+ return ppidValue;
628
+ } else {
629
+ logWarn(`User ID - Googletag Publisher Provided ID for ${ppidSource} is not between 32 and 150 characters - ${ppidValue}`);
630
+ }
631
+ }
632
+ }
633
+
653
634
  /**
654
635
  * Hook is executed before adapters, but after consentManagement. Consent data is requied because
655
636
  * this module requires GDPR consent with Purpose #1 to save data locally.
@@ -666,23 +647,16 @@ export function requestBidsHook(fn, reqBidsConfigObj, {delay = delayFor} = {}) {
666
647
  ]).then(() => {
667
648
  // pass available user id data to bid adapters
668
649
  addIdDataToAdUnitBids(reqBidsConfigObj.adUnits || getGlobal().adUnits, initializedSubmodules);
669
-
670
- // userSync.ppid should be one of the 'source' values in getUserIdsAsEids() eg pubcid.org or id5-sync.com
671
- const matchingUserId = ppidSource && (getUserIdsAsEids() || []).find(userID => userID.source === ppidSource);
672
- if (matchingUserId && typeof deepAccess(matchingUserId, 'uids.0.id') === 'string') {
673
- const ppidValue = matchingUserId.uids[0].id.replace(/[\W_]/g, '');
674
- if (ppidValue.length >= 32 && ppidValue.length <= 150) {
675
- if (isGptPubadsDefined()) {
676
- window.googletag.pubads().setPublisherProvidedId(ppidValue);
677
- } else {
678
- window.googletag = window.googletag || {};
679
- window.googletag.cmd = window.googletag.cmd || [];
680
- window.googletag.cmd.push(function() {
681
- window.googletag.pubads().setPublisherProvidedId(ppidValue);
682
- });
683
- }
650
+ const ppid = getPPID();
651
+ if (ppid) {
652
+ if (isGptPubadsDefined()) {
653
+ window.googletag.pubads().setPublisherProvidedId(ppid);
684
654
  } else {
685
- logWarn(`User ID - Googletag Publisher Provided ID for ${ppidSource} is not between 32 and 150 characters - ${ppidValue}`);
655
+ window.googletag = window.googletag || {};
656
+ window.googletag.cmd = window.googletag.cmd || [];
657
+ window.googletag.cmd.push(function() {
658
+ window.googletag.pubads().setPublisherProvidedId(ppid);
659
+ });
686
660
  }
687
661
  }
688
662
 
@@ -980,6 +954,7 @@ function updateSubmodules() {
980
954
  if (!addedUserIdHook && submodules.length) {
981
955
  // priority value 40 will load after consentManagement with a priority of 50
982
956
  getGlobal().requestBids.before(requestBidsHook, 40);
957
+ coreGetPPID.after((next) => next(getPPID()));
983
958
  logInfo(`${MODULE_NAME} - usersync config updated for ${submodules.length} submodules: `, submodules.map(a => a.submodule.name));
984
959
  addedUserIdHook = true;
985
960
  }
@@ -166,6 +166,9 @@ pbjs.setConfig({
166
166
  },
167
167
  {
168
168
  name: "dacId"
169
+ },
170
+ {
171
+ name: "gravitompId"
169
172
  }
170
173
  ],
171
174
  syncDelay: 5000,
@@ -190,17 +193,6 @@ pbjs.setConfig({
190
193
  params: {
191
194
  pid: "0010b00002GYU4eBAH" // Example ID
192
195
  }
193
- }, {
194
- name: 'trustpid',
195
- params: {
196
- maxDelayTime: 2500
197
- },
198
- bidders: ['adform'],
199
- storage: {
200
- type: 'html5',
201
- name: 'trustpid',
202
- expires: 60
203
- }
204
196
  }, {
205
197
  name: "unifiedId",
206
198
  params: {