prebid.js 7.35.0 → 7.37.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 (229) hide show
  1. package/.devcontainer/Dockerfile +2 -0
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/admaruBidAdapter.js +1 -1
  8. package/dist/adrelevantisBidAdapter.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/aidemBidAdapter.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/bidglassBidAdapter.js +1 -1
  23. package/dist/big-richmediaBidAdapter.js +1 -1
  24. package/dist/bluebillywigBidAdapter.js +1 -1
  25. package/dist/bridgewellBidAdapter.js +1 -1
  26. package/dist/brightMountainMediaBidAdapter.js +1 -1
  27. package/dist/brightcomBidAdapter.js +1 -1
  28. package/dist/brightcomSSPBidAdapter.js +1 -0
  29. package/dist/carodaBidAdapter.js +1 -1
  30. package/dist/chtnwBidAdapter.js +1 -1
  31. package/dist/concertBidAdapter.js +1 -1
  32. package/dist/connectadBidAdapter.js +1 -1
  33. package/dist/consumableBidAdapter.js +1 -1
  34. package/dist/conversantBidAdapter.js +1 -1
  35. package/dist/craftBidAdapter.js +1 -1
  36. package/dist/criteoBidAdapter.js +1 -1
  37. package/dist/cwireBidAdapter.js +1 -1
  38. package/dist/dependencies.json +3 -0
  39. package/dist/discoveryBidAdapter.js +1 -1
  40. package/dist/dspxBidAdapter.js +1 -1
  41. package/dist/eplanningBidAdapter.js +1 -1
  42. package/dist/feedadBidAdapter.js +1 -1
  43. package/dist/finativeBidAdapter.js +1 -1
  44. package/dist/freewheel-sspBidAdapter.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/impactifyBidAdapter.js +1 -1
  54. package/dist/improvedigitalBidAdapter.js +1 -1
  55. package/dist/incrxBidAdapter.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/kueezRtbBidAdapter.js +1 -1
  64. package/dist/lassoBidAdapter.js +1 -1
  65. package/dist/lifestreetBidAdapter.js +1 -1
  66. package/dist/limelightDigitalBidAdapter.js +1 -1
  67. package/dist/liveIntentIdSystem.js +1 -1
  68. package/dist/livewrappedBidAdapter.js +1 -1
  69. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  70. package/dist/logicadBidAdapter.js +1 -1
  71. package/dist/loglyliftBidAdapter.js +1 -1
  72. package/dist/magniteAnalyticsAdapter.js +1 -1
  73. package/dist/malltvAnalyticsAdapter.js +1 -1
  74. package/dist/marsmediaBidAdapter.js +1 -1
  75. package/dist/mediafuseBidAdapter.js +1 -1
  76. package/dist/mediagoBidAdapter.js +1 -1
  77. package/dist/mediakeysBidAdapter.js +1 -1
  78. package/dist/mediasquareBidAdapter.js +1 -1
  79. package/dist/mgidBidAdapter.js +1 -1
  80. package/dist/minutemediaBidAdapter.js +1 -1
  81. package/dist/minutemediaplusBidAdapter.js +1 -0
  82. package/dist/neuwoRtdProvider.js +1 -0
  83. package/dist/nextMillenniumBidAdapter.js +1 -1
  84. package/dist/nexx360BidAdapter.js +1 -1
  85. package/dist/not-for-prod/prebid.js +141 -137
  86. package/dist/oguryBidAdapter.js +1 -1
  87. package/dist/onetagBidAdapter.js +1 -1
  88. package/dist/ooloAnalyticsAdapter.js +1 -1
  89. package/dist/outbrainBidAdapter.js +1 -1
  90. package/dist/parrableIdSystem.js +1 -1
  91. package/dist/pixfutureBidAdapter.js +1 -1
  92. package/dist/prebid-core.js +1 -1
  93. package/dist/prebidServerBidAdapter.js +1 -1
  94. package/dist/proxistoreBidAdapter.js +1 -1
  95. package/dist/publinkIdSystem.js +1 -1
  96. package/dist/pubmaticBidAdapter.js +1 -1
  97. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  98. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  99. package/dist/pxyzBidAdapter.js +1 -1
  100. package/dist/quantcastBidAdapter.js +1 -1
  101. package/dist/readpeakBidAdapter.js +1 -1
  102. package/dist/relaidoBidAdapter.js +1 -1
  103. package/dist/rhythmoneBidAdapter.js +1 -1
  104. package/dist/riseBidAdapter.js +1 -1
  105. package/dist/rubiconAnalyticsAdapter.js +1 -1
  106. package/dist/rubiconBidAdapter.js +1 -1
  107. package/dist/scatteredBidAdapter.js +1 -0
  108. package/dist/seedingAllianceBidAdapter.js +1 -1
  109. package/dist/seedtagBidAdapter.js +1 -1
  110. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  111. package/dist/sharethroughBidAdapter.js +1 -1
  112. package/dist/shinezBidAdapter.js +1 -1
  113. package/dist/sirdataRtdProvider.js +1 -1
  114. package/dist/smaatoBidAdapter.js +1 -1
  115. package/dist/smartadserverBidAdapter.js +1 -1
  116. package/dist/smartxBidAdapter.js +1 -1
  117. package/dist/smilewantedBidAdapter.js +1 -1
  118. package/dist/sonobiBidAdapter.js +1 -1
  119. package/dist/sovrnAnalyticsAdapter.js +1 -1
  120. package/dist/sovrnBidAdapter.js +1 -1
  121. package/dist/sspBCBidAdapter.js +1 -1
  122. package/dist/sublimeBidAdapter.js +1 -1
  123. package/dist/synacormediaBidAdapter.js +1 -1
  124. package/dist/targetVideoBidAdapter.js +1 -1
  125. package/dist/teadsBidAdapter.js +1 -1
  126. package/dist/trionBidAdapter.js +1 -1
  127. package/dist/tripleliftBidAdapter.js +1 -1
  128. package/dist/ttdBidAdapter.js +1 -1
  129. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  130. package/dist/uid2IdSystem.js +1 -1
  131. package/dist/underdogmediaBidAdapter.js +1 -1
  132. package/dist/undertoneBidAdapter.js +1 -1
  133. package/dist/userId.js +1 -1
  134. package/dist/vidazooBidAdapter.js +1 -1
  135. package/dist/videobyteBidAdapter.js +1 -1
  136. package/dist/visxBidAdapter.js +1 -1
  137. package/dist/vuukleBidAdapter.js +1 -1
  138. package/dist/widespaceBidAdapter.js +1 -1
  139. package/dist/winrBidAdapter.js +1 -1
  140. package/dist/yahoosspBidAdapter.js +1 -1
  141. package/dist/yieldmoBidAdapter.js +1 -1
  142. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  143. package/integrationExamples/gpt/neuwoRtdProvider_example.html +190 -0
  144. package/modules/33acrossBidAdapter.js +13 -4
  145. package/modules/adagioBidAdapter.js +14 -14
  146. package/modules/adagioBidAdapter.md +3 -1
  147. package/modules/admaruBidAdapter.js +19 -1
  148. package/modules/aidemBidAdapter.js +90 -65
  149. package/modules/aidemBidAdapter.md +10 -7
  150. package/modules/ajaBidAdapter.js +6 -1
  151. package/modules/amxIdSystem.md +2 -10
  152. package/modules/aolBidAdapter.js +1 -1
  153. package/modules/appnexusBidAdapter.js +45 -48
  154. package/modules/brightcomBidAdapter.js +1 -0
  155. package/modules/brightcomSSPBidAdapter.js +323 -0
  156. package/modules/brightcomSSPBidAdapter.md +46 -0
  157. package/modules/criteoBidAdapter.js +4 -5
  158. package/modules/cwireBidAdapter.md +9 -3
  159. package/modules/discoveryBidAdapter.js +22 -12
  160. package/modules/feedadBidAdapter.js +35 -15
  161. package/modules/fpdModule/index.md +5 -2
  162. package/modules/freewheel-sspBidAdapter.js +5 -1
  163. package/modules/gridBidAdapter.js +3 -1
  164. package/modules/incrxBidAdapter.js +2 -0
  165. package/modules/ixBidAdapter.js +318 -175
  166. package/modules/kueezRtbBidAdapter.js +54 -20
  167. package/modules/limelightDigitalBidAdapter.js +6 -1
  168. package/modules/limelightDigitalBidAdapter.md +12 -2
  169. package/modules/liveIntentIdSystem.js +1 -1
  170. package/modules/livewrappedBidAdapter.js +28 -16
  171. package/modules/mediagoBidAdapter.js +22 -17
  172. package/modules/minutemediaplusBidAdapter.js +291 -0
  173. package/modules/minutemediaplusBidAdapter.md +35 -0
  174. package/modules/neuwoRtdProvider.js +171 -0
  175. package/modules/neuwoRtdProvider.md +40 -0
  176. package/modules/nextMillenniumBidAdapter.js +9 -1
  177. package/modules/nexx360BidAdapter.js +1 -1
  178. package/modules/prebidServerBidAdapter/ortbConverter.js +6 -0
  179. package/modules/proxistoreBidAdapter.js +2 -2
  180. package/modules/pubmaticBidAdapter.js +4 -0
  181. package/modules/pubxaiAnalyticsAdapter.js +2 -2
  182. package/modules/scatteredBidAdapter.js +72 -0
  183. package/modules/scatteredBidAdapter.md +36 -0
  184. package/modules/sirdataRtdProvider.js +262 -284
  185. package/modules/smartxBidAdapter.js +2 -0
  186. package/modules/smilewantedBidAdapter.js +5 -0
  187. package/modules/sonobiBidAdapter.js +1 -10
  188. package/modules/topicsFpdModule.md +62 -0
  189. package/modules/tripleliftBidAdapter.js +4 -0
  190. package/modules/userId/eids.js +1 -1
  191. package/modules/vidazooBidAdapter.js +3 -1
  192. package/modules/yahoosspBidAdapter.js +1 -1
  193. package/modules/yieldmoBidAdapter.js +1 -0
  194. package/package.json +2 -2
  195. package/src/adapterManager.js +30 -14
  196. package/src/utils.js +1 -1
  197. package/test/spec/modules/33acrossBidAdapter_spec.js +51 -18
  198. package/test/spec/modules/adagioBidAdapter_spec.js +2 -2
  199. package/test/spec/modules/admaruBidAdapter_spec.js +48 -0
  200. package/test/spec/modules/aidemBidAdapter_spec.js +77 -10
  201. package/test/spec/modules/ajaBidAdapter_spec.js +21 -1
  202. package/test/spec/modules/aolBidAdapter_spec.js +2 -2
  203. package/test/spec/modules/appnexusBidAdapter_spec.js +123 -16
  204. package/test/spec/modules/brightcomSSPBidAdapter_spec.js +411 -0
  205. package/test/spec/modules/criteoBidAdapter_spec.js +24 -1
  206. package/test/spec/modules/eids_spec.js +1 -1
  207. package/test/spec/modules/feedadBidAdapter_spec.js +47 -77
  208. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +1 -1
  209. package/test/spec/modules/incrxBidAdapter_spec.js +4 -0
  210. package/test/spec/modules/ixBidAdapter_spec.js +24 -54
  211. package/test/spec/modules/kueezRtbBidAdapter_spec.js +63 -22
  212. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +35 -5
  213. package/test/spec/modules/livewrappedBidAdapter_spec.js +267 -2
  214. package/test/spec/modules/minutemediaplusBidAdapter_spec.js +519 -0
  215. package/test/spec/modules/neuwoRtdProvider_spec.js +123 -0
  216. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +11 -0
  217. package/test/spec/modules/prebidServerBidAdapter_spec.js +56 -0
  218. package/test/spec/modules/proxistoreBidAdapter_spec.js +2 -2
  219. package/test/spec/modules/pubmaticBidAdapter_spec.js +15 -0
  220. package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +3 -1
  221. package/test/spec/modules/scatteredBidAdapter_spec.js +210 -0
  222. package/test/spec/modules/sirdataRtdProvider_spec.js +116 -22
  223. package/test/spec/modules/smilewantedBidAdapter_spec.js +54 -3
  224. package/test/spec/modules/sonobiBidAdapter_spec.js +3 -25
  225. package/test/spec/modules/tripleliftBidAdapter_spec.js +9 -2
  226. package/test/spec/modules/userId_spec.js +1 -1
  227. package/test/spec/modules/vidazooBidAdapter_spec.js +4 -1
  228. package/test/spec/modules/yahoosspBidAdapter_spec.js +1 -1
  229. package/test/spec/unit/core/adapterManager_spec.js +147 -0
@@ -63,6 +63,11 @@ export const spec = {
63
63
  payload.gdpr_consent = bidderRequest.gdprConsent.consentString;
64
64
  payload.gdpr = bidderRequest.gdprConsent.gdprApplies; // we're handling the undefined case server side
65
65
  }
66
+
67
+ if (bid && bid.userIdAsEids) {
68
+ payload.eids = bid.userIdAsEids;
69
+ }
70
+
66
71
  var payloadString = JSON.stringify(payload);
67
72
  return {
68
73
  method: 'POST',
@@ -1,5 +1,5 @@
1
1
  import { registerBidder } from '../src/adapters/bidderFactory.js';
2
- import { parseSizesInput, logError, generateUUID, isEmpty, deepAccess, logWarn, logMessage, deepClone, getGptSlotInfoForAdUnitCode, isFn, isPlainObject } from '../src/utils.js';
2
+ import { parseSizesInput, logError, generateUUID, isEmpty, deepAccess, logWarn, logMessage, getGptSlotInfoForAdUnitCode, isFn, isPlainObject } from '../src/utils.js';
3
3
  import { BANNER, VIDEO } from '../src/mediaTypes.js';
4
4
  import { config } from '../src/config.js';
5
5
  import { Renderer } from '../src/Renderer.js';
@@ -132,15 +132,6 @@ export const spec = {
132
132
  if (validBidRequests[0].schain) {
133
133
  payload.schain = JSON.stringify(validBidRequests[0].schain);
134
134
  }
135
- if (deepAccess(validBidRequests[0], 'userId') && Object.keys(validBidRequests[0].userId).length > 0) {
136
- const userIds = deepClone(validBidRequests[0].userId);
137
-
138
- if (userIds.id5id) {
139
- userIds.id5id = deepAccess(userIds, 'id5id.uid');
140
- }
141
-
142
- payload.userid = JSON.stringify(userIds);
143
- }
144
135
 
145
136
  const eids = deepAccess(validBidRequests[0], 'userIdAsEids');
146
137
  if (Array.isArray(eids) && eids.length > 0) {
@@ -0,0 +1,62 @@
1
+ # Overview
2
+
3
+ Module Name: topicsFpdModule
4
+
5
+ # Description
6
+ Purpose of this module is to call the Topics API (document.browsingTopics()) which will fetch the first party domain as well third party domain(Iframe) topics data which will be sent onto user.data in bid stream.
7
+
8
+ The intent of the Topics API is to provide callers (including third-party ad-tech or advertising providers on the page that run script) with coarse-grained advertising topics that the page visitor might currently be interested in.
9
+
10
+ Topics Module(topicsFpdModule) should be included in prebid final package to call topics API.
11
+ Module topicsFpdModule helps to call the Topics API which will send topics data in bid stream (onto user.data)
12
+
13
+ ```
14
+ try {
15
+ if ('browsingTopics' in document && document.featurePolicy.allowsFeature('browsing-topics')) {
16
+ topics = document.browsingTopics();
17
+ }
18
+ } catch (e) {
19
+ console.error('Could not call topics API', e);
20
+ }
21
+ ```
22
+
23
+ # Topics Iframe Configuration
24
+
25
+ Topics iframe implementation is the enhancements of existing module under topicsFpdModule.js where different bidders will call the topic API under their domain to fetch the topics for respective domain and the segment data will be part of ORTB request under user.data object. Default config is maintained in the module itself.
26
+
27
+ Below are the configuration which can be used to configure and override the default config maintained in the module.
28
+
29
+ ```
30
+ pbjs.setConfig({
31
+ userSync: {
32
+ ...,
33
+ topics: {
34
+ maxTopicCaller: 3, // SSP rotation
35
+ bidders: [{
36
+ bidder: 'pubmatic',
37
+ iframeURL: 'https://ads.pubmatic.com/AdServer/js/topics/topics_frame.html',
38
+ expiry: 7 // Configurable expiry days
39
+ },{
40
+ bidder: 'rubicon',
41
+ iframeURL: 'https://rubicon.com:8080/topics/fpd/topic.html', // dummy URL
42
+ expiry: 7 // Configurable expiry days
43
+ },{
44
+ bidder: 'appnexus',
45
+ iframeURL: 'https://appnexus.com:8080/topics/fpd/topic.html', // dummy URL
46
+ expiry: 7 // Configurable expiry days
47
+ }]
48
+ }
49
+ ....
50
+ }
51
+ })
52
+ ```
53
+
54
+ ## Topics Config Descriptions
55
+
56
+ | Field | Required? | Type | Description |
57
+ |---|---|---|---|
58
+ | topics.maxTopicCaller | no | integer | Defines the maximum numbers of Bidders Iframe which needs to be loaded on the publisher page. Default is 1 which is hardcoded in Module. Eg: topics.maxTopicCaller is set to 3. If there are 10 bidders configured along with their iframe URLS, random 3 bidders iframe URL is loaded which will call TOPICS API. If topics.maxTopicCaller is set to 0, it will load random 1(default) bidder iframe atleast. |
59
+ | topics.bidders | no | Array of objects | Array of topics callers with the iframe locations and other necessary informations like bidder(Bidder code) and expiry. Default Array of topics in the module itself.|
60
+ | topics.bidders[].bidder | yes | string | Bidder Code of the bidder(SSP). |
61
+ | topics.bidders[].iframeURL | yes | string | URL which is hosted on bidder/SSP/third-party domains which will call Topics API. |
62
+ | topics.bidders[].expiry | no | integer | Max number of days where Topics data will be persist. If Data is stored for more than mentioned expiry day, it will be deleted from storage. Default is 21 days which is hardcoded in Module. |
@@ -436,6 +436,10 @@ function _buildResponseObject(bidderRequest, bid) {
436
436
  if (bid.tl_source && bid.tl_source == 'tlx') {
437
437
  bidResponse.meta.mediaType = 'native';
438
438
  }
439
+
440
+ if (creativeId) {
441
+ bidResponse.meta.networkId = creativeId.slice(0, creativeId.indexOf('_'));
442
+ }
439
443
  };
440
444
  return bidResponse;
441
445
  }
@@ -282,7 +282,7 @@ export const USER_IDS_CONFIG = {
282
282
  },
283
283
 
284
284
  amxId: {
285
- source: 'amxrtb.com',
285
+ source: 'amxdt.net',
286
286
  atype: 1,
287
287
  },
288
288
 
@@ -27,6 +27,7 @@ export const SUPPORTED_ID_SYSTEMS = {
27
27
  'tdid': 1,
28
28
  'pubProvidedId': 1
29
29
  };
30
+ export const webSessionId = 'wsid_' + parseInt(Date.now() * Math.random());
30
31
  const storage = getStorageManager({gvlid: GVLID, bidderCode: BIDDER_CODE});
31
32
 
32
33
  function getTopWindowQueryParams() {
@@ -131,7 +132,8 @@ function buildRequest(bid, topWindowUrl, sizes, bidderRequest, bidderTimeout) {
131
132
  bidRequestsCount: bidRequestsCount,
132
133
  bidderRequestsCount: bidderRequestsCount,
133
134
  bidderWinsCount: bidderWinsCount,
134
- bidderTimeout: bidderTimeout
135
+ bidderTimeout: bidderTimeout,
136
+ webSessionId: webSessionId
135
137
  };
136
138
 
137
139
  appendUserIdsToRequestPayload(data, userId);
@@ -24,7 +24,7 @@ const SUPPORTED_USER_ID_SOURCES = [
24
24
  'adserver.org',
25
25
  'adtelligent.com',
26
26
  'akamai.com',
27
- 'amxrtb.com',
27
+ 'amxdt.net',
28
28
  'audigent.com',
29
29
  'britepool.com',
30
30
  'criteo.com',
@@ -382,6 +382,7 @@ function openRtbRequest(bidRequests, bidderRequest) {
382
382
  const schain = bidRequests[0].schain;
383
383
  let openRtbRequest = {
384
384
  id: bidRequests[0].bidderRequestId,
385
+ tmax: bidderRequest.timeout || 400,
385
386
  at: 1,
386
387
  imp: bidRequests.map(bidRequest => openRtbImpression(bidRequest)),
387
388
  site: openRtbSite(bidRequests[0], bidderRequest),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prebid.js",
3
- "version": "7.35.0",
3
+ "version": "7.37.0",
4
4
  "description": "Header Bidding Management Library",
5
5
  "main": "src/prebid.js",
6
6
  "scripts": {
@@ -130,7 +130,7 @@
130
130
  "express": "^4.15.4",
131
131
  "fun-hooks": "^0.9.9",
132
132
  "just-clone": "^1.0.2",
133
- "live-connect-js": "3.0.5"
133
+ "live-connect-js": "^4.0.0"
134
134
  },
135
135
  "optionalDependencies": {
136
136
  "fsevents": "^2.3.2"
@@ -65,15 +65,21 @@ var _analyticsRegistry = {};
65
65
 
66
66
  function getBids({bidderCode, auctionId, bidderRequestId, adUnits, src, metrics}) {
67
67
  return adUnits.reduce((result, adUnit) => {
68
- result.push(adUnit.bids.filter(bid => bid.bidder === bidderCode)
69
- .reduce((bids, bid) => {
70
- bid = Object.assign({}, bid, getDefinedParams(adUnit, [
71
- 'nativeParams',
72
- 'nativeOrtbRequest',
73
- 'ortb2Imp',
74
- 'mediaType',
75
- 'renderer'
76
- ]));
68
+ const bids = adUnit.bids.filter(bid => bid.bidder === bidderCode);
69
+ if (bidderCode == null && bids.length === 0 && adUnit.s2sBid != null) {
70
+ bids.push({bidder: null});
71
+ }
72
+ result.push(
73
+ bids.reduce((bids, bid) => {
74
+ bid = Object.assign({}, bid,
75
+ {ortb2Imp: mergeDeep({}, adUnit.ortb2Imp, bid.ortb2Imp)},
76
+ getDefinedParams(adUnit, [
77
+ 'nativeParams',
78
+ 'nativeOrtbRequest',
79
+ 'mediaType',
80
+ 'renderer'
81
+ ])
82
+ );
77
83
 
78
84
  const mediaTypes = bid.mediaTypes == null ? adUnit.mediaTypes : bid.mediaTypes
79
85
 
@@ -128,9 +134,18 @@ export const filterBidsForAdUnit = hook('sync', _filterBidsForAdUnit, 'filterBid
128
134
 
129
135
  function getAdUnitCopyForPrebidServer(adUnits, s2sConfig) {
130
136
  let adUnitsCopy = deepClone(adUnits);
137
+ let hasModuleBids = false;
131
138
 
132
139
  adUnitsCopy.forEach((adUnit) => {
133
140
  // filter out client side bids
141
+ const s2sBids = adUnit.bids.filter((b) => b.module === 'pbsBidAdapter' && b.params?.configName === s2sConfig.configName);
142
+ if (s2sBids.length === 1) {
143
+ adUnit.s2sBid = s2sBids[0];
144
+ hasModuleBids = true;
145
+ adUnit.ortb2Imp = mergeDeep({}, adUnit.s2sBid.ortb2Imp, adUnit.ortb2Imp);
146
+ } else if (s2sBids.length > 1) {
147
+ logWarn('Multiple "module" bids for the same s2s configuration; all will be ignored', s2sBids);
148
+ }
134
149
  adUnit.bids = filterBidsForAdUnit(adUnit.bids, s2sConfig)
135
150
  .map((bid) => {
136
151
  bid.bid_id = getUniqueIdentifierStr();
@@ -140,9 +155,9 @@ function getAdUnitCopyForPrebidServer(adUnits, s2sConfig) {
140
155
 
141
156
  // don't send empty requests
142
157
  adUnitsCopy = adUnitsCopy.filter(adUnit => {
143
- return adUnit.bids.length !== 0;
158
+ return adUnit.bids.length !== 0 || adUnit.s2sBid != null;
144
159
  });
145
- return adUnitsCopy;
160
+ return {adUnits: adUnitsCopy, hasModuleBids};
146
161
  }
147
162
 
148
163
  function getAdUnitCopyForClientAdapters(adUnits) {
@@ -244,11 +259,12 @@ adapterManager.makeBidRequests = hook('sync', function (adUnits, auctionStart, a
244
259
 
245
260
  _s2sConfigs.forEach(s2sConfig => {
246
261
  if (s2sConfig && s2sConfig.enabled) {
247
- let adUnitsS2SCopy = getAdUnitCopyForPrebidServer(adUnits, s2sConfig);
262
+ let {adUnits: adUnitsS2SCopy, hasModuleBids} = getAdUnitCopyForPrebidServer(adUnits, s2sConfig);
248
263
 
249
264
  // uniquePbsTid is so we know which server to send which bids to during the callBids function
250
265
  let uniquePbsTid = generateUUID();
251
- serverBidders.forEach(bidderCode => {
266
+
267
+ (serverBidders.length === 0 && hasModuleBids ? [null] : serverBidders).forEach(bidderCode => {
252
268
  const bidderRequestId = getUniqueIdentifierStr();
253
269
  const metrics = auctionMetrics.fork();
254
270
  const bidderRequest = addOrtb2({
@@ -279,7 +295,7 @@ adapterManager.makeBidRequests = hook('sync', function (adUnits, auctionStart, a
279
295
 
280
296
  bidRequests.forEach(request => {
281
297
  if (request.adUnitsS2SCopy === undefined) {
282
- request.adUnitsS2SCopy = adUnitsS2SCopy.filter(adUnitCopy => adUnitCopy.bids.length > 0);
298
+ request.adUnitsS2SCopy = adUnitsS2SCopy.filter(au => au.bids.length > 0 || au.s2sBid != null);
283
299
  }
284
300
  });
285
301
  }
package/src/utils.js CHANGED
@@ -710,7 +710,7 @@ export function getKeyByValue(obj, value) {
710
710
  export function getBidderCodes(adUnits = $$PREBID_GLOBAL$$.adUnits) {
711
711
  // this could memoize adUnits
712
712
  return adUnits.map(unit => unit.bids.map(bid => bid.bidder)
713
- .reduce(flatten, [])).reduce(flatten, []).filter(uniques);
713
+ .reduce(flatten, [])).reduce(flatten, []).filter((bidder) => typeof bidder !== 'undefined').filter(uniques);
714
714
  }
715
715
 
716
716
  export function isGptPubadsDefined() {
@@ -218,6 +218,14 @@ describe('33acrossBidAdapter:', function () {
218
218
  return this;
219
219
  };
220
220
 
221
+ this.withReferer = referer => {
222
+ Object.assign(ttxRequest.site, {
223
+ ref: referer
224
+ });
225
+
226
+ return this;
227
+ };
228
+
221
229
  this.withSchain = schain => {
222
230
  Object.assign(ttxRequest, {
223
231
  source: {
@@ -1187,26 +1195,51 @@ describe('33acrossBidAdapter:', function () {
1187
1195
  });
1188
1196
  });
1189
1197
 
1190
- context('when referer value is available', function() {
1191
- it('returns corresponding server requests with site.page set', function() {
1192
- const bidderRequest = {
1193
- refererInfo: {
1194
- page: 'http://foo.com/bar'
1195
- }
1196
- };
1198
+ context('when refererInfo values are available', function() {
1199
+ context('when refererInfo.page is defined', function() {
1200
+ it('returns corresponding server requests with site.page set', function() {
1201
+ const bidderRequest = {
1202
+ refererInfo: {
1203
+ page: 'http://foo.com/bar'
1204
+ }
1205
+ };
1197
1206
 
1198
- const ttxRequest = new TtxRequestBuilder()
1199
- .withBanner()
1200
- .withProduct()
1201
- .withPageUrl('http://foo.com/bar')
1202
- .build();
1203
- const serverRequest = new ServerRequestBuilder()
1204
- .withData(ttxRequest)
1205
- .build();
1207
+ const ttxRequest = new TtxRequestBuilder()
1208
+ .withBanner()
1209
+ .withProduct()
1210
+ .withPageUrl('http://foo.com/bar')
1211
+ .build();
1212
+ const serverRequest = new ServerRequestBuilder()
1213
+ .withData(ttxRequest)
1214
+ .build();
1206
1215
 
1207
- const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest);
1216
+ const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest);
1208
1217
 
1209
- validateBuiltServerRequest(builtServerRequest, serverRequest);
1218
+ validateBuiltServerRequest(builtServerRequest, serverRequest);
1219
+ });
1220
+ });
1221
+
1222
+ context('when refererInfo.ref is defined', function() {
1223
+ it('returns corresponding server requests with site.ref set', function() {
1224
+ const bidderRequest = {
1225
+ refererInfo: {
1226
+ ref: 'google.com'
1227
+ }
1228
+ };
1229
+
1230
+ const ttxRequest = new TtxRequestBuilder()
1231
+ .withBanner()
1232
+ .withProduct()
1233
+ .withReferer('google.com')
1234
+ .build();
1235
+ const serverRequest = new ServerRequestBuilder()
1236
+ .withData(ttxRequest)
1237
+ .build();
1238
+
1239
+ const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest);
1240
+
1241
+ validateBuiltServerRequest(builtServerRequest, serverRequest);
1242
+ });
1210
1243
  });
1211
1244
  });
1212
1245
 
@@ -1246,7 +1279,7 @@ describe('33acrossBidAdapter:', function () {
1246
1279
  });
1247
1280
 
1248
1281
  context('when referer value is not available', function() {
1249
- it('returns corresponding server requests without site.page set', function() {
1282
+ it('returns corresponding server requests without site.page and site.ref set', function() {
1250
1283
  const bidderRequest = {
1251
1284
  refererInfo: {}
1252
1285
  };
@@ -381,8 +381,8 @@ describe('Adagio bid adapter', () => {
381
381
  context: 'outstream',
382
382
  playerSize: [[300, 250]],
383
383
  mimes: ['video/mp4'],
384
- api: 5, // will be removed because invalid
385
- playbackmethod: [7], // will be removed because invalid
384
+ api: 'val', // will be removed because invalid
385
+ playbackmethod: ['val'], // will be removed because invalid
386
386
  }
387
387
  },
388
388
  }).withParams({
@@ -121,4 +121,52 @@ describe('Admaru Adapter', function () {
121
121
  expect(result.length).to.equal(0);
122
122
  });
123
123
  });
124
+
125
+ describe('getUserSyncs()', () => {
126
+ it('should return iframe user sync if iframe sync is enabled', () => {
127
+ const syncs = spec.getUserSyncs(
128
+ {
129
+ pixelEnabled: true,
130
+ iframeEnabled: true,
131
+ },
132
+ null
133
+ );
134
+
135
+ expect(syncs).to.deep.equal([
136
+ {
137
+ type: 'iframe',
138
+ url: 'https://p2.admaru.net/UserSync/sync',
139
+ },
140
+ ]);
141
+ });
142
+
143
+ it('should return image syncs if they are enabled and iframe is disabled', () => {
144
+ const syncs = spec.getUserSyncs(
145
+ {
146
+ pixelEnabled: true,
147
+ iframeEnabled: false,
148
+ },
149
+ null
150
+ );
151
+
152
+ expect(syncs).to.deep.equal([
153
+ {
154
+ type: 'image',
155
+ url: 'https://p2.admaru.net/UserSync/sync',
156
+ },
157
+ ]);
158
+ });
159
+
160
+ it('should not return user syncs if syncs are disabled', () => {
161
+ const syncs = spec.getUserSyncs(
162
+ {
163
+ pixelEnabled: false,
164
+ iframeEnabled: false,
165
+ },
166
+ null
167
+ );
168
+
169
+ expect(syncs).to.deep.equal([]);
170
+ });
171
+ });
124
172
  });
@@ -13,7 +13,7 @@ const VALID_BIDS = [
13
13
  params: {
14
14
  siteId: '301491',
15
15
  publisherId: '3021491',
16
- placementId: 13144370,
16
+ placementId: '13144370',
17
17
  },
18
18
  mediaTypes: {
19
19
  banner: {
@@ -26,7 +26,7 @@ const VALID_BIDS = [
26
26
  params: {
27
27
  siteId: '301491',
28
28
  publisherId: '3021491',
29
- placementId: 13144370,
29
+ placementId: '13144370',
30
30
  },
31
31
  mediaTypes: {
32
32
  video: {
@@ -110,7 +110,7 @@ const INVALID_BIDS = [
110
110
  },
111
111
  params: {
112
112
  siteId: '301491',
113
- placementId: 13144370,
113
+ placementId: '13144370',
114
114
  },
115
115
  },
116
116
  {
@@ -126,7 +126,7 @@ const INVALID_BIDS = [
126
126
  },
127
127
  params: {
128
128
  siteId: '301491',
129
- placementId: 13144370,
129
+ placementId: '13144370',
130
130
  },
131
131
  },
132
132
  {
@@ -143,7 +143,7 @@ const INVALID_BIDS = [
143
143
  },
144
144
  params: {
145
145
  siteId: '301491',
146
- placementId: 13144370,
146
+ placementId: '13144370',
147
147
  video: {
148
148
  size: [480, 40]
149
149
  }
@@ -167,8 +167,8 @@ const DEFAULT_VALID_BANNER_REQUESTS = [
167
167
  }
168
168
  },
169
169
  params: {
170
- siteId: 1,
171
- placementId: 13144370
170
+ siteId: '1',
171
+ placementId: '13144370'
172
172
  },
173
173
  src: 'client',
174
174
  transactionId: '54a58774-7a41-494e-9aaf-fa7b79164f0c'
@@ -192,8 +192,8 @@ const DEFAULT_VALID_VIDEO_REQUESTS = [
192
192
  }
193
193
  },
194
194
  params: {
195
- siteId: 1,
196
- placementId: 13144370
195
+ siteId: '1',
196
+ placementId: '13144370'
197
197
  },
198
198
  src: 'client',
199
199
  transactionId: '54a58774-7a41-494e-9aaf-fa7b79164f0c'
@@ -289,14 +289,25 @@ const WIN_NOTICE = {
289
289
  'hb_size': '300x250',
290
290
  'hb_source': 'client',
291
291
  'hb_format': 'banner',
292
- 'hb_adomain': 'tenutabene.it'
292
+ 'hb_adomain': 'example.com'
293
293
  },
294
+
294
295
  'auctionId': '85864730-6cbc-4e56-bc3c-a4a6596dca5b',
295
296
  'currency': [
296
297
  'USD'
297
298
  ],
298
299
  'mediaType': 'banner',
300
+ 'advertiserDomains': [
301
+ 'abc.com'
302
+ ],
299
303
  'size': '300x250',
304
+ 'params': [
305
+ {
306
+ 'placementId': '13144370',
307
+ 'siteId': '23434',
308
+ 'publisherId': '7689670753'
309
+ }
310
+ ],
300
311
  'width': 300,
301
312
  'height': 250,
302
313
  'status': 'rendered',
@@ -365,6 +376,62 @@ describe('Aidem adapter', () => {
365
376
  deepSetValue(validVideoRequest.params, 'video.size', [640, 480])
366
377
  expect(spec.isBidRequestValid(validVideoRequest)).to.be.true
367
378
  });
379
+
380
+ it('BANNER: should return true if rateLimit is 1', function () {
381
+ // spec.isBidRequestValid()
382
+ const validBannerRequest = utils.deepClone(VALID_BIDS[0])
383
+ deepSetValue(validBannerRequest.params, 'rateLimit', 1)
384
+ expect(spec.isBidRequestValid(validBannerRequest)).to.be.true
385
+ });
386
+
387
+ it('BANNER: should return false if rateLimit is 0', function () {
388
+ // spec.isBidRequestValid()
389
+ const validBannerRequest = utils.deepClone(VALID_BIDS[0])
390
+ deepSetValue(validBannerRequest.params, 'rateLimit', 0)
391
+ expect(spec.isBidRequestValid(validBannerRequest)).to.be.false
392
+ });
393
+
394
+ it('BANNER: should return false if rateLimit is not between 0 and 1', function () {
395
+ // spec.isBidRequestValid()
396
+ const validBannerRequest = utils.deepClone(VALID_BIDS[0])
397
+ deepSetValue(validBannerRequest.params, 'rateLimit', 1.2)
398
+ expect(spec.isBidRequestValid(validBannerRequest)).to.be.false
399
+ });
400
+
401
+ it('BANNER: should return false if rateLimit is not a number', function () {
402
+ // spec.isBidRequestValid()
403
+ const validBannerRequest = utils.deepClone(VALID_BIDS[0])
404
+ deepSetValue(validBannerRequest.params, 'rateLimit', '0.5')
405
+ expect(spec.isBidRequestValid(validBannerRequest)).to.be.false
406
+ });
407
+
408
+ it('VIDEO: should return true if rateLimit is 1', function () {
409
+ // spec.isBidRequestValid()
410
+ const validVideoRequest = utils.deepClone(VALID_BIDS[1])
411
+ deepSetValue(validVideoRequest.params, 'rateLimit', 1)
412
+ expect(spec.isBidRequestValid(validVideoRequest)).to.be.true
413
+ });
414
+
415
+ it('VIDEO: should return false if rateLimit is 0', function () {
416
+ // spec.isBidRequestValid()
417
+ const validVideoRequest = utils.deepClone(VALID_BIDS[1])
418
+ deepSetValue(validVideoRequest.params, 'rateLimit', 0)
419
+ expect(spec.isBidRequestValid(validVideoRequest)).to.be.false
420
+ });
421
+
422
+ it('VIDEO: should return false if rateLimit is not between 0 and 1', function () {
423
+ // spec.isBidRequestValid()
424
+ const validBannerRequest = utils.deepClone(VALID_BIDS[1])
425
+ deepSetValue(validBannerRequest.params, 'rateLimit', 1.2)
426
+ expect(spec.isBidRequestValid(validBannerRequest)).to.be.false
427
+ });
428
+
429
+ it('VIDEO: should return false if rateLimit is not a number', function () {
430
+ // spec.isBidRequestValid()
431
+ const validBannerRequest = utils.deepClone(VALID_BIDS[1])
432
+ deepSetValue(validBannerRequest.params, 'rateLimit', '0.5')
433
+ expect(spec.isBidRequestValid(validBannerRequest)).to.be.false
434
+ });
368
435
  });
369
436
 
370
437
  describe('buildRequests', () => {
@@ -45,6 +45,26 @@ describe('AjaAdapter', function () {
45
45
  bidId: '30b31c1838de1e',
46
46
  bidderRequestId: '22edbae2733bf6',
47
47
  auctionId: '1d1a030790a475',
48
+ ortb2: {
49
+ device: {
50
+ sua: {
51
+ source: 2,
52
+ platform: {
53
+ brand: 'Android',
54
+ version: ['8', '0', '0']
55
+ },
56
+ browsers: [
57
+ {brand: 'Not_A Brand', version: ['99', '0', '0', '0']},
58
+ {brand: 'Google Chrome', version: ['109', '0', '5414', '119']},
59
+ {brand: 'Chromium', version: ['109', '0', '5414', '119']}
60
+ ],
61
+ mobile: 1,
62
+ model: 'SM-G955U',
63
+ bitness: '64',
64
+ architecture: ''
65
+ }
66
+ }
67
+ }
48
68
  }
49
69
  ];
50
70
 
@@ -58,7 +78,7 @@ describe('AjaAdapter', function () {
58
78
  const requests = spec.buildRequests(bidRequests, bidderRequest);
59
79
  expect(requests[0].url).to.equal(ENDPOINT);
60
80
  expect(requests[0].method).to.equal('GET');
61
- expect(requests[0].data).to.equal('asi=123456&skt=5&prebid_id=30b31c1838de1e&prebid_ver=$prebid.version$&page_url=https%3A%2F%2Fhoge.com&');
81
+ expect(requests[0].data).to.equal('asi=123456&skt=5&prebid_id=30b31c1838de1e&prebid_ver=$prebid.version$&page_url=https%3A%2F%2Fhoge.com&sua=%7B%22source%22%3A2%2C%22platform%22%3A%7B%22brand%22%3A%22Android%22%2C%22version%22%3A%5B%228%22%2C%220%22%2C%220%22%5D%7D%2C%22browsers%22%3A%5B%7B%22brand%22%3A%22Not_A%20Brand%22%2C%22version%22%3A%5B%2299%22%2C%220%22%2C%220%22%2C%220%22%5D%7D%2C%7B%22brand%22%3A%22Google%20Chrome%22%2C%22version%22%3A%5B%22109%22%2C%220%22%2C%225414%22%2C%22119%22%5D%7D%2C%7B%22brand%22%3A%22Chromium%22%2C%22version%22%3A%5B%22109%22%2C%220%22%2C%225414%22%2C%22119%22%5D%7D%5D%2C%22mobile%22%3A1%2C%22model%22%3A%22SM-G955U%22%2C%22bitness%22%3A%2264%22%2C%22architecture%22%3A%22%22%7D&');
62
82
  });
63
83
  });
64
84
 
@@ -84,7 +84,7 @@ describe('AolAdapter', function () {
84
84
  'admixer.net': '100',
85
85
  'adserver.org': '200',
86
86
  'adtelligent.com': '300',
87
- 'amxrtb.com': '500',
87
+ 'amxdt.net': '500',
88
88
  'audigent.com': '600',
89
89
  'britepool.com': '700',
90
90
  'criteo.com': '800',
@@ -110,7 +110,7 @@ describe('AolAdapter', function () {
110
110
  const USER_ID_DATA = {
111
111
  admixerId: SUPPORTED_USER_ID_SOURCES['admixer.net'],
112
112
  adtelligentId: SUPPORTED_USER_ID_SOURCES['adtelligent.com'],
113
- amxId: SUPPORTED_USER_ID_SOURCES['amxrtb.com'],
113
+ amxId: SUPPORTED_USER_ID_SOURCES['amxdt.net'],
114
114
  britepoolid: SUPPORTED_USER_ID_SOURCES['britepool.com'],
115
115
  criteoId: SUPPORTED_USER_ID_SOURCES['criteo.com'],
116
116
  connectid: SUPPORTED_USER_ID_SOURCES['verizonmedia.com'],