prebid.js 8.5.0 → 8.7.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 (203) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/adqueryBidAdapter.js +1 -1
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adsinteractiveBidAdapter.js +1 -1
  9. package/dist/adtrgtmeBidAdapter.js +1 -1
  10. package/dist/adxcgBidAdapter.js +1 -1
  11. package/dist/adyoulikeBidAdapter.js +1 -1
  12. package/dist/ajaBidAdapter.js +1 -1
  13. package/dist/alkimiBidAdapter.js +1 -1
  14. package/dist/amxBidAdapter.js +1 -1
  15. package/dist/amxIdSystem.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/asoBidAdapter.js +1 -1
  19. package/dist/automatadAnalyticsAdapter.js +1 -0
  20. package/dist/axonixBidAdapter.js +1 -1
  21. package/dist/bidglassBidAdapter.js +1 -1
  22. package/dist/big-richmediaBidAdapter.js +1 -1
  23. package/dist/bridBidAdapter.js +1 -1
  24. package/dist/bridgewellBidAdapter.js +1 -1
  25. package/dist/brightMountainMediaBidAdapter.js +1 -1
  26. package/dist/carodaBidAdapter.js +1 -1
  27. package/dist/chtnwBidAdapter.js +1 -1
  28. package/dist/concertBidAdapter.js +1 -1
  29. package/dist/connatixBidAdapter.js +1 -0
  30. package/dist/connectadBidAdapter.js +1 -1
  31. package/dist/consumableBidAdapter.js +1 -1
  32. package/dist/conversantAnalyticsAdapter.js +1 -1
  33. package/dist/conversantBidAdapter.js +1 -1
  34. package/dist/craftBidAdapter.js +1 -1
  35. package/dist/criteoBidAdapter.js +1 -1
  36. package/dist/cwireBidAdapter.js +1 -1
  37. package/dist/dependencies.json +6 -0
  38. package/dist/dspxBidAdapter.js +1 -1
  39. package/dist/eplanningBidAdapter.js +1 -1
  40. package/dist/euidIdSystem.js +1 -1
  41. package/dist/feedadBidAdapter.js +1 -1
  42. package/dist/finativeBidAdapter.js +1 -1
  43. package/dist/freepassBidAdapter.js +1 -1
  44. package/dist/freewheel-sspBidAdapter.js +1 -1
  45. package/dist/gmosspBidAdapter.js +1 -1
  46. package/dist/goldbachBidAdapter.js +1 -1
  47. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  48. package/dist/greenbidsRtdProvider.js +1 -1
  49. package/dist/gridBidAdapter.js +1 -1
  50. package/dist/growthCodeAnalyticsAdapter.js +1 -1
  51. package/dist/gumgumBidAdapter.js +1 -1
  52. package/dist/h12mediaBidAdapter.js +1 -1
  53. package/dist/hypelabBidAdapter.js +1 -1
  54. package/dist/id5IdSystem.js +1 -1
  55. package/dist/imdsBidAdapter.js +1 -1
  56. package/dist/improvedigitalBidAdapter.js +1 -1
  57. package/dist/insticatorBidAdapter.js +1 -1
  58. package/dist/ixBidAdapter.js +1 -1
  59. package/dist/justpremiumBidAdapter.js +1 -1
  60. package/dist/kargoBidAdapter.js +1 -1
  61. package/dist/konduitAnalyticsAdapter.js +1 -1
  62. package/dist/kueezBidAdapter.js +1 -1
  63. package/dist/kueezRtbBidAdapter.js +1 -1
  64. package/dist/kulturemediaBidAdapter.js +1 -1
  65. package/dist/lassoBidAdapter.js +1 -1
  66. package/dist/lifestreetBidAdapter.js +1 -1
  67. package/dist/logicadBidAdapter.js +1 -1
  68. package/dist/loglyliftBidAdapter.js +1 -1
  69. package/dist/magniteAnalyticsAdapter.js +1 -1
  70. package/dist/malltvAnalyticsAdapter.js +1 -1
  71. package/dist/marsmediaBidAdapter.js +1 -1
  72. package/dist/mediafuseBidAdapter.js +1 -1
  73. package/dist/medianetBidAdapter.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/minutemediaplusBidAdapter.js +1 -1
  78. package/dist/mspa.js +1 -1
  79. package/dist/newspassidBidAdapter.js +1 -1
  80. package/dist/nexx360BidAdapter.js +1 -1
  81. package/dist/not-for-prod/prebid.js +140 -136
  82. package/dist/oguryBidAdapter.js +1 -1
  83. package/dist/onetagBidAdapter.js +1 -1
  84. package/dist/ooloAnalyticsAdapter.js +1 -1
  85. package/dist/optidigitalBidAdapter.js +1 -1
  86. package/dist/outbrainBidAdapter.js +1 -1
  87. package/dist/parrableIdSystem.js +1 -1
  88. package/dist/pixfutureBidAdapter.js +1 -1
  89. package/dist/prebid-core.js +1 -1
  90. package/dist/pubCircleBidAdapter.js +1 -0
  91. package/dist/publinkIdSystem.js +1 -1
  92. package/dist/pubmaticBidAdapter.js +1 -1
  93. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  94. package/dist/pxyzBidAdapter.js +1 -1
  95. package/dist/quantcastBidAdapter.js +1 -1
  96. package/dist/readpeakBidAdapter.js +1 -1
  97. package/dist/relaidoBidAdapter.js +1 -1
  98. package/dist/relevadRtdProvider.js +1 -1
  99. package/dist/retailspotBidAdapter.js +1 -1
  100. package/dist/rhythmoneBidAdapter.js +1 -1
  101. package/dist/riseBidAdapter.js +1 -1
  102. package/dist/rubiconBidAdapter.js +1 -1
  103. package/dist/seedingAllianceBidAdapter.js +1 -1
  104. package/dist/seedtagBidAdapter.js +1 -1
  105. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  106. package/dist/sharethroughBidAdapter.js +1 -1
  107. package/dist/shinezBidAdapter.js +1 -1
  108. package/dist/smaatoBidAdapter.js +1 -1
  109. package/dist/smartadserverBidAdapter.js +1 -1
  110. package/dist/smartxBidAdapter.js +1 -1
  111. package/dist/smilewantedBidAdapter.js +1 -1
  112. package/dist/sonobiBidAdapter.js +1 -1
  113. package/dist/sovrnAnalyticsAdapter.js +1 -1
  114. package/dist/sovrnBidAdapter.js +1 -1
  115. package/dist/ssmasBidAdapter.js +1 -1
  116. package/dist/sspBCBidAdapter.js +1 -1
  117. package/dist/stvBidAdapter.js +1 -1
  118. package/dist/sublimeBidAdapter.js +1 -1
  119. package/dist/tappxBidAdapter.js +1 -1
  120. package/dist/targetVideoBidAdapter.js +1 -1
  121. package/dist/teadsBidAdapter.js +1 -1
  122. package/dist/topicsFpdModule.js +1 -1
  123. package/dist/trionBidAdapter.js +1 -1
  124. package/dist/tripleliftBidAdapter.js +1 -1
  125. package/dist/ttdBidAdapter.js +1 -1
  126. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  127. package/dist/uid2IdSystem.js +1 -1
  128. package/dist/underdogmediaBidAdapter.js +1 -1
  129. package/dist/undertoneBidAdapter.js +1 -1
  130. package/dist/viantOrtbBidAdapter.js +1 -0
  131. package/dist/vidazooBidAdapter.js +1 -1
  132. package/dist/videobyteBidAdapter.js +1 -1
  133. package/dist/videojsVideoProvider.js +1 -1
  134. package/dist/visxBidAdapter.js +1 -1
  135. package/dist/vuukleBidAdapter.js +1 -1
  136. package/dist/widespaceBidAdapter.js +1 -1
  137. package/dist/winrBidAdapter.js +1 -1
  138. package/dist/yahoosspBidAdapter.js +1 -1
  139. package/dist/yieldmoBidAdapter.js +1 -1
  140. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  141. package/integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html +1 -1
  142. package/integrationExamples/videoModule/jwplayer/bidRequestScheduling.html +1 -1
  143. package/integrationExamples/videoModule/jwplayer/bidsBackHandlerOverride.html +137 -0
  144. package/integrationExamples/videoModule/jwplayer/eventListeners.html +1 -1
  145. package/integrationExamples/videoModule/jwplayer/eventsUI.html +1 -1
  146. package/integrationExamples/videoModule/jwplayer/gamAdServerMediation.html +1 -1
  147. package/integrationExamples/videoModule/jwplayer/mediaMetadata.html +1 -1
  148. package/integrationExamples/videoModule/jwplayer/playlist.html +1 -1
  149. package/integrationExamples/videoModule/videojs/bidsBackHandlerOverride.html +164 -0
  150. package/libraries/mspa/activityControls.js +51 -32
  151. package/modules/adagioBidAdapter.js +15 -1
  152. package/modules/adgenerationBidAdapter.js +5 -4
  153. package/modules/adsinteractiveBidAdapter.js +4 -2
  154. package/modules/alkimiBidAdapter.js +19 -7
  155. package/modules/appnexusBidAdapter.js +1 -1
  156. package/modules/automatadAnalyticsAdapter.js +325 -0
  157. package/modules/automatadAnalyticsAdapter.md +23 -0
  158. package/modules/connatixBidAdapter.js +185 -0
  159. package/modules/connatixBidAdapter.md +37 -0
  160. package/modules/criteoBidAdapter.js +18 -0
  161. package/modules/cwireBidAdapter.js +19 -0
  162. package/modules/freepassBidAdapter.js +20 -1
  163. package/modules/freepassBidAdapter.md +4 -1
  164. package/modules/gridBidAdapter.js +1 -8
  165. package/modules/growthCodeAnalyticsAdapter.js +7 -2
  166. package/modules/medianetBidAdapter.js +7 -4
  167. package/modules/mediasquareBidAdapter.js +3 -0
  168. package/modules/newspassid.md +76 -0
  169. package/modules/newspassidBidAdapter.js +44 -18
  170. package/modules/optidigitalBidAdapter.js +25 -16
  171. package/modules/pubCircleBidAdapter.js +231 -0
  172. package/modules/pubCircleBidAdapter.md +79 -0
  173. package/modules/relevadRtdProvider.js +6 -7
  174. package/modules/ssmasBidAdapter.js +2 -2
  175. package/modules/tappxBidAdapter.js +27 -15
  176. package/modules/tappxBidAdapter.md +17 -0
  177. package/modules/topicsFpdModule.js +21 -48
  178. package/modules/undertoneBidAdapter.md +1 -1
  179. package/modules/userId/eids.md +7 -0
  180. package/modules/viantOrtbBidAdapter.js +113 -0
  181. package/modules/viantOrtbBidAdapter.md +54 -0
  182. package/modules/vidazooBidAdapter.js +9 -2
  183. package/modules/videojsVideoProvider.js +9 -2
  184. package/package.json +1 -1
  185. package/test/spec/libraries/mspa/activityControls_spec.js +145 -212
  186. package/test/spec/modules/adagioBidAdapter_spec.js +89 -0
  187. package/test/spec/modules/adgenerationBidAdapter_spec.js +6 -6
  188. package/test/spec/modules/alkimiBidAdapter_spec.js +3 -9
  189. package/test/spec/modules/appnexusBidAdapter_spec.js +12 -1
  190. package/test/spec/modules/automatadAnalyticsAdapter_spec.js +533 -0
  191. package/test/spec/modules/connatixBidAdapter_spec.js +366 -0
  192. package/test/spec/modules/criteoBidAdapter_spec.js +52 -3
  193. package/test/spec/modules/cwireBidAdapter_spec.js +47 -0
  194. package/test/spec/modules/freepassBidAdapter_spec.js +44 -0
  195. package/test/spec/modules/gridBidAdapter_spec.js +68 -0
  196. package/test/spec/modules/medianetBidAdapter_spec.js +18 -18
  197. package/test/spec/modules/mediasquareBidAdapter_spec.js +5 -0
  198. package/test/spec/modules/newspassidBidAdapter_spec.js +6 -0
  199. package/test/spec/modules/optidigitalBidAdapter_spec.js +9 -2
  200. package/test/spec/modules/pubCircleBidAdapter_spec.js +399 -0
  201. package/test/spec/modules/tappxBidAdapter_spec.js +19 -0
  202. package/test/spec/modules/topicsFpdModule_spec.js +343 -365
  203. package/test/spec/modules/viantOrtbBidAdapter_spec.js +432 -0
@@ -1,18 +1,22 @@
1
- import {logError, logWarn, mergeDeep, isEmpty, safeJSONParse, logInfo, hasDeviceAccess} from '../src/utils.js';
1
+ import {isEmpty, logError, logWarn, mergeDeep, safeJSONParse} from '../src/utils.js';
2
2
  import {getRefererInfo} from '../src/refererDetection.js';
3
3
  import {submodule} from '../src/hook.js';
4
4
  import {GreedyPromise} from '../src/utils/promise.js';
5
5
  import {config} from '../src/config.js';
6
6
  import {getCoreStorageManager} from '../src/storageManager.js';
7
7
  import {includes} from '../src/polyfill.js';
8
- import {gdprDataHandler} from '../src/adapterManager.js';
8
+ import {isActivityAllowed} from '../src/activities/rules.js';
9
+ import {ACTIVITY_ENRICH_UFPD} from '../src/activities/activities.js';
10
+ import {activityParams} from '../src/activities/activityParams.js';
11
+ import {MODULE_TYPE_BIDDER} from '../src/activities/modules.js';
9
12
 
10
13
  const MODULE_NAME = 'topicsFpd';
11
14
  const DEFAULT_EXPIRATION_DAYS = 21;
12
- const TCF_REQUIRED_PURPOSES = ['1', '2', '3', '4'];
13
- let HAS_GDPR_CONSENT = true;
14
15
  let LOAD_TOPICS_INITIALISE = false;
15
- const HAS_DEVICE_ACCESS = hasDeviceAccess();
16
+
17
+ export function reset() {
18
+ LOAD_TOPICS_INITIALISE = false;
19
+ }
16
20
 
17
21
  const bidderIframeList = {
18
22
  maxTopicCaller: 2,
@@ -86,10 +90,14 @@ export function getTopicsData(name, topics, taxonomies = TAXONOMIES) {
86
90
  );
87
91
  }
88
92
 
93
+ function isTopicsSupported(doc = document) {
94
+ return 'browsingTopics' in doc && doc.featurePolicy.allowsFeature('browsing-topics')
95
+ }
96
+
89
97
  export function getTopics(doc = document) {
90
98
  let topics = null;
91
99
  try {
92
- if ('browsingTopics' in doc && doc.featurePolicy.allowsFeature('browsing-topics')) {
100
+ if (isTopicsSupported(doc)) {
93
101
  topics = GreedyPromise.resolve(doc.browsingTopics());
94
102
  }
95
103
  } catch (e) {
@@ -126,19 +134,16 @@ export function processFpd(config, {global}, {data = topicsData} = {}) {
126
134
  */
127
135
  export function getCachedTopics() {
128
136
  let cachedTopicData = [];
129
- if (!HAS_GDPR_CONSENT || !HAS_DEVICE_ACCESS) {
130
- return cachedTopicData;
131
- }
132
137
  const topics = config.getConfig('userSync.topics') || bidderIframeList;
133
138
  const bidderList = topics.bidders || [];
134
139
  let storedSegments = new Map(safeJSONParse(coreStorage.getDataFromLocalStorage(topicStorageName)));
135
140
  storedSegments && storedSegments.forEach((value, cachedBidder) => {
136
141
  // Check bidder exist in config for cached bidder data and then only retrieve the cached data
137
- let bidderConfigObj = bidderList.find(({bidder}) => cachedBidder == bidder)
138
- if (bidderConfigObj) {
142
+ let bidderConfigObj = bidderList.find(({bidder}) => cachedBidder === bidder)
143
+ if (bidderConfigObj && isActivityAllowed(ACTIVITY_ENRICH_UFPD, activityParams(MODULE_TYPE_BIDDER, cachedBidder))) {
139
144
  if (!isCachedDataExpired(value[lastUpdated], bidderConfigObj?.expiry || DEFAULT_EXPIRATION_DAYS)) {
140
145
  Object.keys(value).forEach((segData) => {
141
- segData != lastUpdated && cachedTopicData.push(value[segData]);
146
+ segData !== lastUpdated && cachedTopicData.push(value[segData]);
142
147
  })
143
148
  } else {
144
149
  // delete the specific bidder map from the store and store the updated maps
@@ -204,55 +209,23 @@ function listenMessagesFromTopicIframe() {
204
209
  window.addEventListener('message', receiveMessage, false);
205
210
  }
206
211
 
207
- function checkTCFv2(vendorData, requiredPurposes = TCF_REQUIRED_PURPOSES) {
208
- const {gdprApplies, purpose} = vendorData;
209
- if (!gdprApplies || !purpose) {
210
- return true;
211
- }
212
- return requiredPurposes.map((purposeNo) => {
213
- const purposeConsent = purpose.consents ? purpose.consents[purposeNo] : false;
214
- if (purposeConsent) {
215
- return true;
216
- }
217
- return false;
218
- }).reduce((a, b) => a && b, true);
219
- }
220
-
221
- export function hasGDPRConsent() {
222
- // Check for GDPR consent for purpose 1,2,3,4 and return false if consent has not been given
223
- const gdprConsent = gdprDataHandler.getConsentData();
224
- const hasGdpr = (gdprConsent && typeof gdprConsent.gdprApplies === 'boolean' && gdprConsent.gdprApplies) ? 1 : 0;
225
- const gdprConsentString = hasGdpr ? gdprConsent.consentString : '';
226
- if (hasGdpr) {
227
- if ((!gdprConsentString || gdprConsentString === '') || !gdprConsent.vendorData) {
228
- return false;
229
- }
230
- return checkTCFv2(gdprConsent.vendorData);
231
- }
232
- return true;
233
- }
234
-
235
212
  /**
236
213
  * function to load the iframes of the bidder to load the topics data
237
214
  */
238
- function loadTopicsForBidders() {
239
- HAS_GDPR_CONSENT = hasGDPRConsent();
240
- if (!HAS_GDPR_CONSENT || !HAS_DEVICE_ACCESS) {
241
- logInfo('Topics Module : Consent string is required to fetch the topics from third party domains.');
242
- return;
243
- }
215
+ export function loadTopicsForBidders(doc = document) {
216
+ if (!isTopicsSupported(doc)) return;
244
217
  const topics = config.getConfig('userSync.topics') || bidderIframeList;
245
218
  if (topics) {
246
219
  listenMessagesFromTopicIframe();
247
220
  const randomBidders = getRandomBidders(topics.bidders || [], topics.maxTopicCaller || 1)
248
221
  randomBidders && randomBidders.forEach(({ bidder, iframeURL }) => {
249
222
  if (bidder && iframeURL) {
250
- let ifrm = document.createElement('iframe');
223
+ let ifrm = doc.createElement('iframe');
251
224
  ifrm.name = 'ifrm_'.concat(bidder);
252
225
  ifrm.src = ''.concat(iframeURL, '?bidder=').concat(bidder);
253
226
  ifrm.style.display = 'none';
254
227
  setLoadedIframeURL(new URL(iframeURL).origin);
255
- iframeURL && window.document.documentElement.appendChild(ifrm);
228
+ iframeURL && doc.documentElement.appendChild(ifrm);
256
229
  }
257
230
  })
258
231
  } else {
@@ -23,7 +23,7 @@ Module that connects to Undertone's demand sources
23
23
  {
24
24
  bidder: "undertone",
25
25
  params: {
26
- placementId: '10433394',
26
+ placementId: 1234,
27
27
  publisherId: 12345
28
28
  }
29
29
  }
@@ -272,6 +272,13 @@ userIdAsEids = [
272
272
  id: 'some-random-id-value',
273
273
  atype: 3
274
274
  }]
275
+ },
276
+ {
277
+ source: 'euid.eu',
278
+ uids: [{
279
+ id: 'some-random-id-value',
280
+ atype: 3
281
+ }]
275
282
  }
276
283
  ]
277
284
  ```
@@ -0,0 +1,113 @@
1
+ import {registerBidder} from '../src/adapters/bidderFactory.js';
2
+ import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
3
+ import * as utils from '../src/utils.js';
4
+ import {ortbConverter} from '../libraries/ortbConverter/converter.js'
5
+ import {deepAccess, getBidIdParameter, logError} from '../src/utils.js';
6
+
7
+ const BIDDER_CODE = 'viant';
8
+ const ENDPOINT = 'https://bidders-us-east-1.adelphic.net/d/rtb/v25/prebid/bidder_test'
9
+
10
+ const DEFAULT_BID_TTL = 300;
11
+ const DEFAULT_CURRENCY = 'USD';
12
+ const DEFAULT_NET_REVENUE = true;
13
+
14
+ export const spec = {
15
+ code: BIDDER_CODE,
16
+ supportedMediaTypes: [BANNER, VIDEO, NATIVE],
17
+
18
+ isBidRequestValid: function (bid) {
19
+ if (bid && typeof bid.params !== 'object') {
20
+ logError(BIDDER_CODE + ': params is not defined or is incorrect in the bidder settings.');
21
+ return false;
22
+ }
23
+ if (!getBidIdParameter('publisherId', bid.params)) {
24
+ logError(BIDDER_CODE + ': publisherId is not present in bidder params.');
25
+ return false;
26
+ }
27
+ const mediaTypesBanner = deepAccess(bid, 'mediaTypes.banner');
28
+ const mediaTypesVideo = deepAccess(bid, 'mediaTypes.video');
29
+ const mediaTypesNative = deepAccess(bid, 'mediaTypes.native');
30
+ if (!mediaTypesBanner && !mediaTypesVideo && !mediaTypesNative) {
31
+ utils.logWarn(BIDDER_CODE + ': one of mediaTypes.banner or mediaTypes.video or mediaTypes.native must be passed');
32
+ return false;
33
+ }
34
+ return true;
35
+ },
36
+
37
+ buildRequests,
38
+
39
+ interpretResponse(response, request) {
40
+ if (!response.body) {
41
+ response.body = {nbr: 0};
42
+ }
43
+ const bids = converter.fromORTB({request: request.data, response: response.body}).bids;
44
+ return bids;
45
+ },
46
+
47
+ /**
48
+ * Register bidder specific code, which will execute if a bid from this bidder won the auction
49
+ * @param {Bid} bid The bid that won the auction
50
+ */
51
+ onBidWon: function (bid) {
52
+ if (bid.burl) {
53
+ utils.triggerPixel(bid.burl);
54
+ } else if (bid.nurl) {
55
+ utils.triggerPixel(bid.nurl);
56
+ }
57
+ }
58
+ }
59
+
60
+ function buildRequests(bids, bidderRequest) {
61
+ let videoBids = bids.filter(bid => isVideoBid(bid));
62
+ let bannerBids = bids.filter(bid => isBannerBid(bid));
63
+ let nativeBids = bids.filter(bid => isNativeBid(bid));
64
+ let requests = bannerBids.length ? [createRequest(bannerBids, bidderRequest, BANNER)] : [];
65
+ videoBids.forEach(bid => {
66
+ requests.push(createRequest([bid], bidderRequest, VIDEO));
67
+ });
68
+ nativeBids.forEach(bid => {
69
+ requests.push(createRequest([bid], bidderRequest, NATIVE));
70
+ });
71
+ return requests;
72
+ }
73
+
74
+ function createRequest(bidRequests, bidderRequest, mediaType) {
75
+ const data = converter.toORTB({bidRequests, bidderRequest, context: {mediaType}});
76
+ if (bidderRequest.gdprConsent && typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') {
77
+ if (!data.regs) data.regs = {};
78
+ if (!data.regs.ext) data.regs.ext = {};
79
+ data.regs.ext.gdpr = bidderRequest.gdprConsent.gdprApplies ? 1 : 0;
80
+ }
81
+ if (bidderRequest.uspConsent) {
82
+ if (!data.regs) data.regs = {};
83
+ if (!data.regs.ext) data.regs.ext = {};
84
+ data.regs.ext.us_privacy = bidderRequest.uspConsent;
85
+ }
86
+ return {
87
+ method: 'POST',
88
+ url: ENDPOINT,
89
+ data: data
90
+ }
91
+ }
92
+
93
+ function isVideoBid(bid) {
94
+ return deepAccess(bid, 'mediaTypes.video');
95
+ }
96
+
97
+ function isBannerBid(bid) {
98
+ return deepAccess(bid, 'mediaTypes.banner');
99
+ }
100
+
101
+ function isNativeBid(bid) {
102
+ return deepAccess(bid, 'mediaTypes.native');
103
+ }
104
+
105
+ const converter = ortbConverter({
106
+ context: {
107
+ netRevenue: DEFAULT_NET_REVENUE,
108
+ ttl: DEFAULT_BID_TTL,
109
+ currency: DEFAULT_CURRENCY
110
+ }
111
+ });
112
+
113
+ registerBidder(spec);
@@ -0,0 +1,54 @@
1
+ # Overview
2
+
3
+ Module Name: VIANT Bidder Adapter
4
+ Module Type: Bidder Adapter
5
+ Maintainer: dist-runtime@viantinc.com
6
+
7
+ # Description
8
+
9
+ An adapter to get a bid from VIANT DSP.
10
+
11
+ # Test Parameters
12
+ ```javascript
13
+ var adUnits = [ // Banner adUnit with only required parameters
14
+ {
15
+ code: 'test-div-minimal',
16
+ mediaTypes: {
17
+ banner: {
18
+ sizes: [[728, 90]]
19
+ }
20
+ },
21
+ bids: [
22
+ {
23
+ bidder: 'viant',
24
+ params: {
25
+ supplySourceId: 'supplier',
26
+ publisherId: '464'
27
+ }
28
+ }
29
+ ]
30
+ },
31
+ {
32
+ code: 'test-div-minimal-video',
33
+ mediaTypes: {
34
+ video: {
35
+ playerSize: [640, 480],
36
+ context: 'outstream'
37
+ }
38
+ },
39
+ bids: [
40
+ {
41
+ bidder: 'viant',
42
+ params: {
43
+ supplySourceId: 'supplier',
44
+ publisherId: '464' // required
45
+ }
46
+ }
47
+ ]
48
+ }
49
+ ];
50
+ ```
51
+
52
+ Where:
53
+
54
+ * placementId - Placement ID of the ad unit (required)
@@ -320,13 +320,20 @@ function interpretResponse(serverResponse, request) {
320
320
  }
321
321
  }
322
322
 
323
- function getUserSyncs(syncOptions, responses, gdprConsent = {}, uspConsent = '') {
323
+ function getUserSyncs(syncOptions, responses, gdprConsent = {}, uspConsent = '', gppConsent = {}) {
324
324
  let syncs = [];
325
325
  const {iframeEnabled, pixelEnabled} = syncOptions;
326
326
  const {gdprApplies, consentString = ''} = gdprConsent;
327
+ const {gppString, applicableSections} = gppConsent;
327
328
 
328
329
  const cidArr = responses.filter(resp => deepAccess(resp, 'body.cid')).map(resp => resp.body.cid).filter(uniques);
329
- const params = `?cid=${encodeURIComponent(cidArr.join(','))}&gdpr=${gdprApplies ? 1 : 0}&gdpr_consent=${encodeURIComponent(consentString || '')}&us_privacy=${encodeURIComponent(uspConsent || '')}`
330
+ let params = `?cid=${encodeURIComponent(cidArr.join(','))}&gdpr=${gdprApplies ? 1 : 0}&gdpr_consent=${encodeURIComponent(consentString || '')}&us_privacy=${encodeURIComponent(uspConsent || '')}`;
331
+
332
+ if (gppString && applicableSections?.length) {
333
+ params += '&gpp=' + encodeURIComponent(gppString);
334
+ params += '&gpp_sid=' + encodeURIComponent(applicableSections.join(','));
335
+ }
336
+
330
337
  if (iframeEnabled) {
331
338
  syncs.push({
332
339
  type: 'iframe',
@@ -201,8 +201,15 @@ export function VideojsProvider(providerConfig, vjs_, adState_, timeState_, call
201
201
  return;
202
202
  }
203
203
 
204
- player.ima.changeAdTag(adTagUrl);
205
- player.ima.requestAds();
204
+ // The VideoJS IMA plugin version 1.11.0 will throw when the ad is empty.
205
+ try {
206
+ player.ima.changeAdTag(adTagUrl);
207
+ player.ima.requestAds();
208
+ } catch (e) {
209
+ /*
210
+ Handling is not required; ad errors are emitted automatically by video.js
211
+ */
212
+ }
206
213
  }
207
214
 
208
215
  function onEvent(type, callback, payload) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prebid.js",
3
- "version": "8.5.0",
3
+ "version": "8.7.0",
4
4
  "description": "Header Bidding Management Library",
5
5
  "main": "src/prebid.js",
6
6
  "scripts": {