prebid.js 9.5.0 → 9.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 (253) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE.md +1 -1
  2. package/.github/release-drafter.yml +4 -0
  3. package/README.md +4 -4
  4. package/dist/33acrossAnalyticsAdapter.js +1 -1
  5. package/dist/33acrossBidAdapter.js +1 -1
  6. package/dist/33acrossIdSystem.js +1 -1
  7. package/dist/BTBidAdapter.js +1 -1
  8. package/dist/adagioAnalyticsAdapter.js +1 -1
  9. package/dist/adagioBidAdapter.js +1 -1
  10. package/dist/adagioUtils.js +1 -1
  11. package/dist/addefendBidAdapter.js +1 -1
  12. package/dist/adgenerationBidAdapter.js +1 -1
  13. package/dist/adkernelBidAdapter.js +1 -1
  14. package/dist/adlooxRtdProvider.js +1 -1
  15. package/dist/adqueryBidAdapter.js +1 -1
  16. package/dist/adrelevantisBidAdapter.js +1 -1
  17. package/dist/adstirBidAdapter.js +1 -1
  18. package/dist/adtrgtmeBidAdapter.js +1 -1
  19. package/dist/adxcgAnalyticsAdapter.js +1 -1
  20. package/dist/adxcgBidAdapter.js +1 -1
  21. package/dist/adyoulikeBidAdapter.js +1 -1
  22. package/dist/agmaAnalyticsAdapter.js +1 -1
  23. package/dist/aidemBidAdapter.js +1 -1
  24. package/dist/ajaBidAdapter.js +1 -1
  25. package/dist/amxBidAdapter.js +1 -1
  26. package/dist/amxIdSystem.js +1 -1
  27. package/dist/appierAnalyticsAdapter.js +1 -1
  28. package/dist/appnexusBidAdapter.js +1 -1
  29. package/dist/asoBidAdapter.js +1 -1
  30. package/dist/axonixBidAdapter.js +1 -1
  31. package/dist/bidglassBidAdapter.js +1 -1
  32. package/dist/big-richmediaBidAdapter.js +1 -1
  33. package/dist/bridBidAdapter.js +1 -1
  34. package/dist/bridgewellBidAdapter.js +1 -1
  35. package/dist/brightMountainMediaBidAdapter.js +1 -1
  36. package/dist/carodaBidAdapter.js +1 -1
  37. package/dist/chtnwBidAdapter.js +1 -1
  38. package/dist/chunk-core.js +1 -1
  39. package/dist/cleanmedianetBidAdapter.js +1 -1
  40. package/dist/concertBidAdapter.js +1 -1
  41. package/dist/connectIdSystem.js +1 -1
  42. package/dist/connectadBidAdapter.js +1 -1
  43. package/dist/connectionInfo.js +1 -0
  44. package/dist/consumableBidAdapter.js +1 -1
  45. package/dist/conversantAnalyticsAdapter.js +1 -1
  46. package/dist/conversantBidAdapter.js +1 -1
  47. package/dist/craftBidAdapter.js +1 -1
  48. package/dist/criteoBidAdapter.js +1 -1
  49. package/dist/cwireBidAdapter.js +1 -1
  50. package/dist/dailymotionBidAdapter.js +1 -1
  51. package/dist/dependencies.json +31 -2
  52. package/dist/docereeAdManagerBidAdapter.js +1 -1
  53. package/dist/dspxBidAdapter.js +1 -1
  54. package/dist/dxkultureBidAdapter.js +1 -1
  55. package/dist/eplanningBidAdapter.js +1 -1
  56. package/dist/euidIdSystem.js +1 -1
  57. package/dist/exadsBidAdapter.js +1 -1
  58. package/dist/feedadBidAdapter.js +1 -1
  59. package/dist/finativeBidAdapter.js +1 -1
  60. package/dist/freewheel-sspBidAdapter.js +1 -1
  61. package/dist/gamoshiBidAdapter.js +1 -1
  62. package/dist/gmosspBidAdapter.js +1 -1
  63. package/dist/goldbachBidAdapter.js +1 -1
  64. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  65. package/dist/greenbidsRtdProvider.js +1 -1
  66. package/dist/gridBidAdapter.js +1 -1
  67. package/dist/gumgumBidAdapter.js +1 -1
  68. package/dist/h12mediaBidAdapter.js +1 -1
  69. package/dist/hypelabBidAdapter.js +1 -1
  70. package/dist/id5AnalyticsAdapter.js +1 -1
  71. package/dist/id5IdSystem.js +1 -1
  72. package/dist/idImportLibrary.js +1 -1
  73. package/dist/imdsBidAdapter.js +1 -1
  74. package/dist/improvedigitalBidAdapter.js +1 -1
  75. package/dist/insticatorBidAdapter.js +1 -1
  76. package/dist/intentIqAnalyticsAdapter.js +1 -1
  77. package/dist/ixBidAdapter.js +1 -1
  78. package/dist/jixieBidAdapter.js +1 -1
  79. package/dist/justpremiumBidAdapter.js +1 -1
  80. package/dist/kargoBidAdapter.js +1 -1
  81. package/dist/kimberliteBidAdapter.js +1 -1
  82. package/dist/konduitAnalyticsAdapter.js +1 -1
  83. package/dist/kueezBidAdapter.js +1 -1
  84. package/dist/lassoBidAdapter.js +1 -1
  85. package/dist/lifestreetBidAdapter.js +1 -1
  86. package/dist/liveIntentIdSystem.js +1 -1
  87. package/dist/logicadBidAdapter.js +1 -1
  88. package/dist/loglyliftBidAdapter.js +1 -1
  89. package/dist/luceadBidAdapter.js +1 -1
  90. package/dist/mabidderBidAdapter.js +1 -1
  91. package/dist/magniteAnalyticsAdapter.js +1 -1
  92. package/dist/malltvAnalyticsAdapter.js +1 -1
  93. package/dist/marsmediaBidAdapter.js +1 -1
  94. package/dist/mediafuseBidAdapter.js +1 -1
  95. package/dist/medianetAnalyticsAdapter.js +1 -1
  96. package/dist/medianetBidAdapter.js +1 -1
  97. package/dist/mediasquareBidAdapter.js +1 -1
  98. package/dist/mgidBidAdapter.js +1 -1
  99. package/dist/minutemediaBidAdapter.js +1 -1
  100. package/dist/missenaBidAdapter.js +1 -1
  101. package/dist/mobianRtdProvider.js +1 -1
  102. package/dist/nexx360BidAdapter.js +1 -1
  103. package/dist/nobidAnalyticsAdapter.js +1 -1
  104. package/dist/nobidBidAdapter.js +1 -1
  105. package/dist/not-for-prod/prebid.js +174 -170
  106. package/dist/oguryBidAdapter.js +1 -1
  107. package/dist/onetagBidAdapter.js +1 -1
  108. package/dist/ooloAnalyticsAdapter.js +1 -1
  109. package/dist/openwebBidAdapter.js +1 -1
  110. package/dist/openxBidAdapter.js +1 -1
  111. package/dist/optidigitalBidAdapter.js +1 -1
  112. package/dist/orbidderBidAdapter.js +1 -1
  113. package/dist/ortbConverter.js +1 -1
  114. package/dist/outbrainBidAdapter.js +1 -1
  115. package/dist/ownadxBidAdapter.js +1 -0
  116. package/dist/pixfutureBidAdapter.js +1 -1
  117. package/dist/prismaBidAdapter.js +1 -1
  118. package/dist/publinkIdSystem.js +1 -1
  119. package/dist/publirBidAdapter.js +1 -1
  120. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  121. package/dist/pubmaticBidAdapter.js +1 -1
  122. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  123. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  124. package/dist/pxyzBidAdapter.js +1 -1
  125. package/dist/quantcastBidAdapter.js +1 -1
  126. package/dist/readpeakBidAdapter.js +1 -1
  127. package/dist/relaidoBidAdapter.js +1 -1
  128. package/dist/retailspotBidAdapter.js +1 -1
  129. package/dist/rhythmoneBidAdapter.js +1 -1
  130. package/dist/riseBidAdapter.js +1 -1
  131. package/dist/riseUtils.js +1 -0
  132. package/dist/rubiconBidAdapter.js +1 -1
  133. package/dist/seedingAllianceBidAdapter.js +1 -1
  134. package/dist/seedtagBidAdapter.js +1 -1
  135. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  136. package/dist/sharethroughBidAdapter.js +1 -1
  137. package/dist/shinezBidAdapter.js +1 -1
  138. package/dist/smaatoBidAdapter.js +1 -1
  139. package/dist/smartadserverBidAdapter.js +1 -1
  140. package/dist/smarthubBidAdapter.js +1 -1
  141. package/dist/smartxBidAdapter.js +1 -1
  142. package/dist/smilewantedBidAdapter.js +1 -1
  143. package/dist/snigelBidAdapter.js +1 -1
  144. package/dist/sonobiBidAdapter.js +1 -1
  145. package/dist/sovrnBidAdapter.js +1 -1
  146. package/dist/sspBCBidAdapter.js +1 -1
  147. package/dist/stnBidAdapter.js +1 -1
  148. package/dist/stvBidAdapter.js +1 -1
  149. package/dist/sublimeBidAdapter.js +1 -1
  150. package/dist/taboolaBidAdapter.js +1 -1
  151. package/dist/tappxBidAdapter.js +1 -1
  152. package/dist/targetVideoBidAdapter.js +1 -1
  153. package/dist/teadsBidAdapter.js +1 -1
  154. package/dist/telariaBidAdapter.js +1 -1
  155. package/dist/teqblazeUtils.js +1 -1
  156. package/dist/terceptAnalyticsAdapter.js +1 -1
  157. package/dist/themoneytizerBidAdapter.js +1 -1
  158. package/dist/trionBidAdapter.js +1 -1
  159. package/dist/tripleliftBidAdapter.js +1 -1
  160. package/dist/ttdBidAdapter.js +1 -1
  161. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  162. package/dist/uid2IdSystem.js +1 -1
  163. package/dist/uid2IdSystem_shared.js +1 -1
  164. package/dist/underdogmediaBidAdapter.js +1 -1
  165. package/dist/undertoneBidAdapter.js +1 -1
  166. package/dist/unrulyBidAdapter.js +1 -1
  167. package/dist/viantOrtbBidAdapter.js +1 -1
  168. package/dist/vidazooUtils.js +1 -1
  169. package/dist/videobyteBidAdapter.js +1 -1
  170. package/dist/visxBidAdapter.js +1 -1
  171. package/dist/vuukleBidAdapter.js +1 -1
  172. package/dist/widespaceBidAdapter.js +1 -1
  173. package/dist/winrBidAdapter.js +1 -1
  174. package/dist/wurflRtdProvider.js +1 -0
  175. package/dist/yahooAdsBidAdapter.js +1 -1
  176. package/dist/yieldmoBidAdapter.js +1 -1
  177. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  178. package/integrationExamples/gpt/wurflRtdProvider_example.html +106 -0
  179. package/libraries/connectionInfo/connectionUtils.js +33 -0
  180. package/libraries/ortbConverter/processors/video.js +2 -24
  181. package/libraries/riseUtils/index.js +331 -0
  182. package/libraries/teqblazeUtils/bidderUtils.js +15 -11
  183. package/libraries/vidazooUtils/bidderUtils.js +16 -0
  184. package/modules/.submodules.json +3 -1
  185. package/modules/51DegreesRtdProvider.md +11 -7
  186. package/modules/adagioAnalyticsAdapter.js +101 -84
  187. package/modules/adagioAnalyticsAdapter.md +4 -0
  188. package/modules/adagioBidAdapter.js +14 -66
  189. package/modules/adkernelBidAdapter.js +2 -2
  190. package/modules/aidemBidAdapter.js +2 -0
  191. package/modules/appnexusBidAdapter.js +1 -1
  192. package/modules/cleanmedianetBidAdapter.js +1 -1
  193. package/modules/connectIdSystem.js +5 -3
  194. package/modules/dailymotionBidAdapter.js +19 -0
  195. package/modules/docereeAdManagerBidAdapter.js +9 -12
  196. package/modules/gamoshiBidAdapter.js +1 -1
  197. package/modules/greenbidsAnalyticsAdapter.js +7 -4
  198. package/modules/greenbidsRtdProvider.js +15 -5
  199. package/modules/id5IdSystem.js +14 -93
  200. package/modules/idImportLibrary.js +14 -6
  201. package/modules/insticatorBidAdapter.js +35 -31
  202. package/modules/kargoBidAdapter.js +11 -14
  203. package/modules/kimberliteBidAdapter.js +24 -7
  204. package/modules/kimberliteBidAdapter.md +30 -1
  205. package/modules/minutemediaBidAdapter.js +21 -398
  206. package/modules/mobianRtdProvider.js +28 -14
  207. package/modules/nexx360BidAdapter.js +3 -2
  208. package/modules/openwebBidAdapter.js +18 -396
  209. package/modules/ownadxBidAdapter.js +99 -0
  210. package/modules/prismaBidAdapter.js +1 -27
  211. package/modules/publirBidAdapter.js +20 -273
  212. package/modules/pubmaticBidAdapter.js +2 -1
  213. package/modules/resetdigitalBidAdapter.md +54 -45
  214. package/modules/riseBidAdapter.js +19 -400
  215. package/modules/sharethroughBidAdapter.js +5 -0
  216. package/modules/shinezBidAdapter.js +17 -361
  217. package/modules/smarthubBidAdapter.js +45 -177
  218. package/modules/stnBidAdapter.js +22 -398
  219. package/modules/telariaBidAdapter.js +2 -32
  220. package/modules/ttdBidAdapter.js +14 -32
  221. package/modules/uid2IdSystem_shared.js +51 -39
  222. package/modules/viantOrtbBidAdapter.js +1 -1
  223. package/modules/wurflRtdProvider.js +213 -0
  224. package/modules/wurflRtdProvider.md +67 -0
  225. package/package.json +1 -1
  226. package/src/adloader.js +1 -0
  227. package/src/prebid.js +6 -1
  228. package/src/video.js +78 -1
  229. package/test/spec/modules/adagioAnalyticsAdapter_spec.js +231 -141
  230. package/test/spec/modules/adagioBidAdapter_spec.js +32 -67
  231. package/test/spec/modules/appnexusBidAdapter_spec.js +0 -33
  232. package/test/spec/modules/cleanmedianetBidAdapter_spec.js +1 -1
  233. package/test/spec/modules/connectIdSystem_spec.js +27 -28
  234. package/test/spec/modules/dailymotionBidAdapter_spec.js +50 -0
  235. package/test/spec/modules/docereeAdManagerBidAdapter_spec.js +1 -0
  236. package/test/spec/modules/gamoshiBidAdapter_spec.js +1 -1
  237. package/test/spec/modules/id5IdSystem_spec.js +25 -98
  238. package/test/spec/modules/idImportLibrary_spec.js +14 -0
  239. package/test/spec/modules/insticatorBidAdapter_spec.js +8 -1
  240. package/test/spec/modules/kargoBidAdapter_spec.js +7 -8
  241. package/test/spec/modules/kimberliteBidAdapter_spec.js +137 -65
  242. package/test/spec/modules/mobianRtdProvider_spec.js +46 -43
  243. package/test/spec/modules/nexx360BidAdapter_spec.js +1 -1
  244. package/test/spec/modules/ownadxBidAdapter_spec.js +103 -0
  245. package/test/spec/modules/pubmaticBidAdapter_spec.js +18 -0
  246. package/test/spec/modules/sharethroughBidAdapter_spec.js +35 -0
  247. package/test/spec/modules/smarthubBidAdapter_spec.js +6 -4
  248. package/test/spec/modules/ttdBidAdapter_spec.js +10 -1
  249. package/test/spec/modules/viantOrtbBidAdapter_spec.js +1 -1
  250. package/test/spec/modules/vidazooBidAdapter_spec.js +12 -4
  251. package/test/spec/modules/wurflRtdProvider_spec.js +324 -0
  252. package/test/spec/unit/pbjs_api_spec.js +11 -0
  253. package/test/spec/video_spec.js +103 -1
@@ -2,32 +2,26 @@ import {
2
2
  logWarn,
3
3
  logInfo,
4
4
  isArray,
5
- isFn,
6
5
  deepAccess,
7
- isEmpty,
8
- contains,
9
6
  timestamp,
10
7
  triggerPixel,
11
- getDNT,
12
- getBidIdParameter
13
8
  } from '../src/utils.js';
14
9
  import { registerBidder } from '../src/adapters/bidderFactory.js';
15
10
  import { BANNER, VIDEO } from '../src/mediaTypes.js';
16
- import { config } from '../src/config.js';
17
11
  import { getStorageManager } from '../src/storageManager.js';
18
12
  import { ajax } from '../src/ajax.js';
13
+ import {
14
+ generateBidsParams,
15
+ generateGeneralParams,
16
+ } from '../libraries/riseUtils/index.js';
19
17
 
20
18
  const SUPPORTED_AD_TYPES = [BANNER, VIDEO];
21
19
  const BIDDER_CODE = 'publir';
22
20
  const ADAPTER_VERSION = '1.0.0';
23
21
  const TTL = 360;
24
22
  const CURRENCY = 'USD';
25
- const DEFAULT_SELLER_ENDPOINT = 'https://prebid.publir.com/publirPrebidEndPoint';
23
+ const BASE_URL = 'https://prebid.publir.com/publirPrebidEndPoint';
26
24
  const DEFAULT_IMPS_ENDPOINT = 'https://prebidimpst.publir.com/publirPrebidImpressionTracker';
27
- const SUPPORTED_SYNC_METHODS = {
28
- IFRAME: 'iframe',
29
- PIXEL: 'pixel'
30
- }
31
25
 
32
26
  export const storage = getStorageManager({ bidderCode: BIDDER_CODE });
33
27
  export const spec = {
@@ -40,25 +34,26 @@ export const spec = {
40
34
  logWarn('pubId is a mandatory param for Publir adapter');
41
35
  return false;
42
36
  }
43
-
44
37
  return true;
45
38
  },
46
39
  buildRequests: function (validBidRequests, bidderRequest) {
47
- const reqObj = {};
40
+ const combinedRequestsObject = {};
41
+
48
42
  const generalObject = validBidRequests[0];
49
- reqObj.params = generatePubGeneralsParams(generalObject, bidderRequest);
50
- reqObj.bids = generatePubBidParams(validBidRequests, bidderRequest);
51
- reqObj.bids.timestamp = timestamp();
43
+ combinedRequestsObject.params = generateGeneralParams(generalObject, bidderRequest, ADAPTER_VERSION);
44
+ combinedRequestsObject.bids = generateBidsParams(validBidRequests, bidderRequest);
45
+ combinedRequestsObject.bids.timestamp = timestamp();
46
+
52
47
  let options = {
53
48
  withCredentials: false
54
49
  };
55
50
 
56
51
  return {
57
52
  method: 'POST',
58
- url: DEFAULT_SELLER_ENDPOINT,
59
- data: reqObj,
53
+ url: BASE_URL,
54
+ data: combinedRequestsObject,
60
55
  options
61
- }
56
+ };
62
57
  },
63
58
  interpretResponse: function ({ body }) {
64
59
  const bidResponses = [];
@@ -109,20 +104,20 @@ export const spec = {
109
104
  const syncs = [];
110
105
  for (const response of serverResponses) {
111
106
  if (response.body && response.body.params) {
112
- if (syncOptions.iframeEnabled && response.body.params.userSyncURL) {
107
+ if (syncOptions.iframeEnabled && deepAccess(response, 'body.params.userSyncURL')) {
113
108
  syncs.push({
114
109
  type: 'iframe',
115
- url: response.body.params.userSyncURL
110
+ url: deepAccess(response, 'body.params.userSyncURL')
116
111
  });
117
112
  }
118
- if (syncOptions.pixelEnabled && isArray(response.body.params.userSyncPixels)) {
113
+ if (syncOptions.pixelEnabled && isArray(deepAccess(response, 'body.params.userSyncPixels'))) {
119
114
  const pixels = response.body.params.userSyncPixels.map(pixel => {
120
115
  return {
121
116
  type: 'image',
122
117
  url: pixel
123
- }
124
- })
125
- syncs.push(...pixels)
118
+ };
119
+ });
120
+ syncs.push(...pixels);
126
121
  }
127
122
  }
128
123
  }
@@ -141,251 +136,3 @@ export const spec = {
141
136
  };
142
137
 
143
138
  registerBidder(spec);
144
-
145
- /**
146
- * Get floor price
147
- * @param bid {bid}
148
- * @returns {Number}
149
- */
150
- function getFloor(bid, mediaType) {
151
- if (!isFn(bid.getFloor)) {
152
- return 0;
153
- }
154
- let floorResult = bid.getFloor({
155
- currency: CURRENCY,
156
- mediaType: mediaType,
157
- size: '*'
158
- });
159
- return floorResult.currency === CURRENCY && floorResult.floor ? floorResult.floor : 0;
160
- }
161
-
162
- /**
163
- * Get the the ad sizes array from the bid
164
- * @param bid {bid}
165
- * @returns {Array}
166
- */
167
- function getSizesArray(bid, mediaType) {
168
- let sizesArray = []
169
-
170
- if (deepAccess(bid, `mediaTypes.${mediaType}.sizes`)) {
171
- sizesArray = bid.mediaTypes[mediaType].sizes;
172
- } else if (Array.isArray(bid.sizes) && bid.sizes.length > 0) {
173
- sizesArray = bid.sizes;
174
- }
175
-
176
- return sizesArray;
177
- }
178
-
179
- /**
180
- * Get schain string value
181
- * @param schainObject {Object}
182
- * @returns {string}
183
- */
184
- function getSupplyChain(schainObject) {
185
- if (isEmpty(schainObject)) {
186
- return '';
187
- }
188
- let scStr = `${schainObject.ver},${schainObject.complete}`;
189
- schainObject.nodes.forEach((node) => {
190
- scStr += '!';
191
- scStr += `${getEncodedValIfNotEmpty(node.asi)},`;
192
- scStr += `${getEncodedValIfNotEmpty(node.sid)},`;
193
- scStr += `${node.hp ? encodeURIComponent(node.hp) : ''},`;
194
- scStr += `${getEncodedValIfNotEmpty(node.rid)},`;
195
- scStr += `${getEncodedValIfNotEmpty(node.name)},`;
196
- scStr += `${getEncodedValIfNotEmpty(node.domain)}`;
197
- });
198
- return scStr;
199
- }
200
-
201
- /**
202
- * Get encoded node value
203
- * @param val {string}
204
- * @returns {string}
205
- */
206
- function getEncodedValIfNotEmpty(val) {
207
- return !isEmpty(val) ? encodeURIComponent(val) : '';
208
- }
209
-
210
- function getAllowedSyncMethod(filterSettings, bidderCode) {
211
- const iframeConfigsToCheck = ['all', 'iframe'];
212
- const pixelConfigToCheck = 'image';
213
- if (filterSettings && iframeConfigsToCheck.some(config => isSyncMethodAllowed(filterSettings[config], bidderCode))) {
214
- return SUPPORTED_SYNC_METHODS.IFRAME;
215
- }
216
- if (!filterSettings || !filterSettings[pixelConfigToCheck] || isSyncMethodAllowed(filterSettings[pixelConfigToCheck], bidderCode)) {
217
- return SUPPORTED_SYNC_METHODS.PIXEL;
218
- }
219
- }
220
-
221
- /**
222
- * Check if sync rule is supported
223
- * @param syncRule {Object}
224
- * @param bidderCode {string}
225
- * @returns {boolean}
226
- */
227
- function isSyncMethodAllowed(syncRule, bidderCode) {
228
- if (!syncRule) {
229
- return false;
230
- }
231
- const isInclude = syncRule.filter === 'include';
232
- const bidders = isArray(syncRule.bidders) ? syncRule.bidders : [bidderCode];
233
- return isInclude && contains(bidders, bidderCode);
234
- }
235
-
236
- /**
237
- * get device type
238
- * @param ua {ua}
239
- * @returns {string}
240
- */
241
- function getDeviceType(ua) {
242
- if (/ipad|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(ua.toLowerCase())) {
243
- return '5';
244
- }
245
- if (/iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile/i.test(ua.toLowerCase())) {
246
- return '4';
247
- }
248
- if (/smart[-_\s]?tv|hbbtv|appletv|googletv|hdmi|netcast|viera|nettv|roku|\bdtv\b|sonydtv|inettvbrowser|\btv\b/i.test(ua.toLowerCase())) {
249
- return '3';
250
- }
251
- return '1';
252
- }
253
-
254
- function generatePubBidParams(validBidRequests, bidderRequest) {
255
- const bidsArray = [];
256
-
257
- if (validBidRequests.length) {
258
- validBidRequests.forEach(bid => {
259
- bidsArray.push(generateBidParameters(bid, bidderRequest));
260
- });
261
- }
262
- return bidsArray;
263
- }
264
-
265
- /**
266
- * Generate bid specific parameters
267
- * @param {bid} bid
268
- * @param {bidderRequest} bidderRequest
269
- * @returns {Object} bid specific params object
270
- */
271
- function generateBidParameters(bid, bidderRequest) {
272
- const { params } = bid;
273
- const mediaType = isBanner(bid) ? BANNER : VIDEO;
274
- const sizesArray = getSizesArray(bid, mediaType);
275
-
276
- // fix floor price in case of NAN
277
- if (isNaN(params.floorPrice)) {
278
- params.floorPrice = 0;
279
- }
280
-
281
- const bidObject = {
282
- mediaType,
283
- adUnitCode: getBidIdParameter('adUnitCode', bid),
284
- sizes: sizesArray,
285
- floorPrice: Math.max(getFloor(bid, mediaType), params.floorPrice),
286
- bidId: getBidIdParameter('bidId', bid),
287
- bidderRequestId: getBidIdParameter('bidderRequestId', bid),
288
- loop: getBidIdParameter('bidderRequestsCount', bid),
289
- transactionId: bid.ortb2Imp?.ext?.tid,
290
- coppa: 0
291
- };
292
-
293
- const pubId = params.pubId;
294
- if (pubId) {
295
- bidObject.pubId = pubId;
296
- }
297
-
298
- const sua = deepAccess(bid, `ortb2.device.sua`);
299
- if (sua) {
300
- bidObject.sua = sua;
301
- }
302
-
303
- const coppa = deepAccess(bid, `ortb2.regs.coppa`)
304
- if (coppa) {
305
- bidObject.coppa = 1;
306
- }
307
-
308
- return bidObject;
309
- }
310
-
311
- function isBanner(bid) {
312
- return bid.mediaTypes && bid.mediaTypes.banner;
313
- }
314
-
315
- function getLocalStorage(cookieObjName) {
316
- if (storage.localStorageIsEnabled()) {
317
- const lstData = storage.getDataFromLocalStorage(cookieObjName);
318
- return lstData;
319
- }
320
- return '';
321
- }
322
-
323
- /**
324
- * Generate params that are common between all bids
325
- * @param generalObject
326
- * @param {bidderRequest} bidderRequest
327
- * @returns {object} the common params object
328
- */
329
- function generatePubGeneralsParams(generalObject, bidderRequest) {
330
- const domain = bidderRequest.refererInfo;
331
- const { syncEnabled, filterSettings } = config.getConfig('userSync') || {};
332
- const { bidderCode } = bidderRequest;
333
- const generalBidParams = generalObject.params;
334
- const timeout = bidderRequest.timeout;
335
- const generalParams = {
336
- wrapper_type: 'prebidjs',
337
- wrapper_vendor: '$$PREBID_GLOBAL$$',
338
- wrapper_version: '$prebid.version$',
339
- adapter_version: ADAPTER_VERSION,
340
- auction_start: bidderRequest.auctionStart,
341
- publisher_id: generalBidParams.pubId,
342
- publisher_name: domain,
343
- site_domain: domain,
344
- dnt: getDNT() ? 1 : 0,
345
- device_type: getDeviceType(navigator.userAgent),
346
- ua: navigator.userAgent,
347
- is_wrapper: !!generalBidParams.isWrapper,
348
- session_id: generalBidParams.sessionId || getBidIdParameter('bidderRequestId', generalObject),
349
- tmax: timeout,
350
- user_cookie: getLocalStorage('_publir_prebid_creative')
351
- };
352
-
353
- const userIdsParam = getBidIdParameter('userId', generalObject);
354
- if (userIdsParam) {
355
- generalParams.userIds = JSON.stringify(userIdsParam);
356
- }
357
-
358
- const ortb2Metadata = bidderRequest.ortb2 || {};
359
- if (ortb2Metadata.site) {
360
- generalParams.site_metadata = JSON.stringify(ortb2Metadata.site);
361
- }
362
- if (ortb2Metadata.user) {
363
- generalParams.user_metadata = JSON.stringify(ortb2Metadata.user);
364
- }
365
-
366
- if (syncEnabled) {
367
- const allowedSyncMethod = getAllowedSyncMethod(filterSettings, bidderCode);
368
- if (allowedSyncMethod) {
369
- generalParams.cs_method = allowedSyncMethod;
370
- }
371
- }
372
-
373
- if (bidderRequest.uspConsent) {
374
- generalParams.us_privacy = bidderRequest.uspConsent;
375
- }
376
-
377
- if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies) {
378
- generalParams.gdpr = bidderRequest.gdprConsent.gdprApplies;
379
- generalParams.gdpr_consent = bidderRequest.gdprConsent.consentString;
380
- }
381
-
382
- if (generalObject.schain) {
383
- generalParams.schain = getSupplyChain(generalObject.schain);
384
- }
385
-
386
- if (bidderRequest && bidderRequest.refererInfo) {
387
- generalParams.page_url = deepAccess(bidderRequest, 'refererInfo.page') || deepAccess(window, 'location.href');
388
- }
389
-
390
- return generalParams;
391
- }
@@ -687,7 +687,8 @@ function _createImpressionObject(bid, bidderRequest) {
687
687
  },
688
688
  bidfloorcur: bid.params.currency ? _parseSlotParam('currency', bid.params.currency) : DEFAULT_CURRENCY,
689
689
  displaymanager: 'Prebid.js',
690
- displaymanagerver: '$prebid.version$' // prebid version
690
+ displaymanagerver: '$prebid.version$', // prebid version
691
+ pmp: bid.ortb2Imp?.pmp || undefined
691
692
  };
692
693
 
693
694
  _addPMPDealsInImpression(impObj, bid);
@@ -3,7 +3,7 @@
3
3
  ```
4
4
  Module Name: ResetDigital Bidder Adapter
5
5
  Module Type: Bidder Adapter
6
- Maintainer: bruce@resetdigital.co
6
+ Maintainer: BidderSupport@resetdigital.co
7
7
  ```
8
8
 
9
9
  # Description
@@ -15,49 +15,58 @@ Video is supported but requires a publisher supplied renderer at this time.
15
15
 
16
16
  ## Web
17
17
  ```
18
- var adUnits = [
19
- {
20
- code: 'your-div',
21
- mediaTypes: {
22
- banner: {
23
- sizes: [[300,250]]
24
- },
25
-
26
- },
27
- bids: [
28
- {
29
- bidder: "resetdigital",
30
- params: {
31
- pubId: "your-pub-id",
32
- site_id: "your-site-id",
33
- forceBid: true,
34
- }
35
- }
36
- ]
37
- }
38
- ];
39
-
40
-
41
- var videoAdUnits = [
42
- {
43
- code: 'your-div',
44
- mediaTypes: {
45
- video: {
46
- playerSize: [640, 480]
47
- },
48
-
49
- },
50
- bids: [
51
- {
52
- bidder: "resetdigital",
53
- params: {
54
- pubId: "your-pub-id",
55
- site_id: "your-site-id",
56
- forceBid: true,
57
- }
58
- }
59
- ]
60
- }
61
- ];
18
+ // Define the ad units for banner ads
19
+ var adUnits = [
20
+ {
21
+ code: 'your-div', // Replace with the actual ad unit code
22
+ mediaTypes: {
23
+ banner: {
24
+ sizes: [[300, 250]] // Define the sizes for banner ads
25
+ }
26
+ },
27
+ bids: [
28
+ {
29
+ bidder: "resetdigital",
30
+ params: {
31
+ pubId: "your-pub-id", // (required) Replace with your publisher ID
32
+ site_id: "your-site-id", // Replace with your site ID
33
+ endpoint: 'https://ads.resetsrv.com', // (optional) Endpoint URL for the ad server
34
+ forceBid: true, // Optional parameter to force the bid
35
+ zoneId: { // (optional) Zone ID parameters
36
+ placementId: "<id>", // Optional ID used for reports
37
+ deals: "<deal ids>", // Optional string of deal IDs, comma-separated
38
+ test: 1 // Set to 1 to force the bidder to respond with a creative
39
+ }
40
+ }
41
+ }
42
+ ]
43
+ }
44
+ ];
62
45
 
46
+ // Define the ad units for video ads
47
+ var videoAdUnits = [
48
+ {
49
+ code: 'your-div', // Replace with the actual video ad unit code
50
+ mediaTypes: {
51
+ video: {
52
+ playerSize: [640, 480] // Define the player size for video ads
53
+ }
54
+ },
55
+ bids: [
56
+ {
57
+ bidder: "resetdigital",
58
+ params: {
59
+ pubId: "your-pub-id", // (required) Replace with your publisher ID
60
+ site_id: "your-site-id", // Replace with your site ID
61
+ forceBid: true, // Optional parameter to force the bid
62
+ zoneId: { // (optional) Zone ID parameters
63
+ placementId: "<id>", // Optional ID used for reports
64
+ deals: "<deal ids>", // Optional string of deal IDs, comma-separated
65
+ test: 1 // Set to 1 to force the bidder to respond with a creative
66
+ }
67
+ }
68
+ }
69
+ ]
70
+ }
71
+ ];
63
72
  ```