prebid.js 6.20.0 → 6.22.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 (159) hide show
  1. package/.circleci/config.yml +0 -1
  2. package/dist/33acrossBidAdapter.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/adomikAnalyticsAdapter.js +1 -1
  7. package/dist/adotBidAdapter.js +1 -1
  8. package/dist/adrelevantisBidAdapter.js +1 -1
  9. package/dist/adxcgBidAdapter.js +1 -1
  10. package/dist/ajaBidAdapter.js +1 -1
  11. package/dist/amxBidAdapter.js +1 -1
  12. package/dist/amxIdSystem.js +1 -1
  13. package/dist/apacdexBidAdapter.js +1 -1
  14. package/dist/appierAnalyticsAdapter.js +1 -1
  15. package/dist/appnexusBidAdapter.js +1 -1
  16. package/dist/asoBidAdapter.js +1 -1
  17. package/dist/audiencerunBidAdapter.js +1 -1
  18. package/dist/axonixBidAdapter.js +1 -1
  19. package/dist/betweenBidAdapter.js +1 -1
  20. package/dist/bidglassBidAdapter.js +1 -1
  21. package/dist/big-richmediaBidAdapter.js +1 -1
  22. package/dist/bridgewellBidAdapter.js +1 -1
  23. package/dist/brightMountainMediaBidAdapter.js +1 -1
  24. package/dist/cointrafficBidAdapter.js +1 -1
  25. package/dist/colossussspBidAdapter.js +1 -1
  26. package/dist/concertBidAdapter.js +1 -1
  27. package/dist/connectadBidAdapter.js +1 -1
  28. package/dist/consentManagement.js +1 -1
  29. package/dist/consentManagementUsp.js +1 -1
  30. package/dist/consumableBidAdapter.js +1 -1
  31. package/dist/conversantBidAdapter.js +1 -1
  32. package/dist/craftBidAdapter.js +1 -1
  33. package/dist/criteoBidAdapter.js +1 -1
  34. package/dist/dspxBidAdapter.js +1 -1
  35. package/dist/e_volutionBidAdapter.js +1 -1
  36. package/dist/eplanningBidAdapter.js +1 -1
  37. package/dist/ftrackIdSystem.js +1 -1
  38. package/dist/glimpseBidAdapter.js +1 -1
  39. package/dist/gmosspBidAdapter.js +1 -1
  40. package/dist/goldbachBidAdapter.js +1 -1
  41. package/dist/gridBidAdapter.js +1 -1
  42. package/dist/gridNMBidAdapter.js +1 -1
  43. package/dist/gumgumBidAdapter.js +1 -1
  44. package/dist/h12mediaBidAdapter.js +1 -1
  45. package/dist/id5IdSystem.js +1 -1
  46. package/dist/improvedigitalBidAdapter.js +1 -1
  47. package/dist/inmarBidAdapter.js +1 -1
  48. package/dist/insticatorBidAdapter.js +1 -1
  49. package/dist/ixBidAdapter.js +1 -1
  50. package/dist/justpremiumBidAdapter.js +1 -1
  51. package/dist/konduitAnalyticsAdapter.js +1 -1
  52. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  53. package/dist/logicadBidAdapter.js +1 -1
  54. package/dist/loglyliftBidAdapter.js +1 -1
  55. package/dist/malltvAnalyticsAdapter.js +1 -1
  56. package/dist/marsmediaBidAdapter.js +1 -1
  57. package/dist/mediafuseBidAdapter.js +1 -1
  58. package/dist/mediasquareBidAdapter.js +1 -1
  59. package/dist/mgidBidAdapter.js +1 -1
  60. package/dist/minutemediaBidAdapter.js +1 -1
  61. package/dist/mobfoxpbBidAdapter.js +1 -0
  62. package/dist/nextMillenniumBidAdapter.js +1 -1
  63. package/dist/nexx360BidAdapter.js +1 -1
  64. package/dist/not-for-prod/prebid.js +118 -117
  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/otmBidAdapter.js +1 -1
  70. package/dist/outbrainBidAdapter.js +1 -1
  71. package/dist/parrableIdSystem.js +1 -1
  72. package/dist/pixfutureBidAdapter.js +1 -1
  73. package/dist/prebid-core.js +3 -3
  74. package/dist/prebidServerBidAdapter.js +1 -1
  75. package/dist/publinkIdSystem.js +1 -1
  76. package/dist/pubmaticBidAdapter.js +1 -1
  77. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  78. package/dist/pxyzBidAdapter.js +1 -1
  79. package/dist/quantcastBidAdapter.js +1 -1
  80. package/dist/readpeakBidAdapter.js +1 -1
  81. package/dist/relaidoBidAdapter.js +1 -1
  82. package/dist/rhythmoneBidAdapter.js +1 -1
  83. package/dist/riseBidAdapter.js +1 -1
  84. package/dist/rubiconAnalyticsAdapter.js +1 -1
  85. package/dist/rubiconBidAdapter.js +1 -1
  86. package/dist/seedingAllianceBidAdapter.js +1 -1
  87. package/dist/seedtagBidAdapter.js +1 -1
  88. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  89. package/dist/sharethroughBidAdapter.js +1 -1
  90. package/dist/smaatoBidAdapter.js +1 -1
  91. package/dist/smartadserverBidAdapter.js +1 -1
  92. package/dist/smartxBidAdapter.js +1 -1
  93. package/dist/smilewantedBidAdapter.js +1 -1
  94. package/dist/sonobiBidAdapter.js +1 -1
  95. package/dist/sortableBidAdapter.js +1 -1
  96. package/dist/sovrnAnalyticsAdapter.js +1 -1
  97. package/dist/sovrnBidAdapter.js +1 -1
  98. package/dist/sspBCBidAdapter.js +1 -1
  99. package/dist/sublimeBidAdapter.js +1 -1
  100. package/dist/synacormediaBidAdapter.js +1 -1
  101. package/dist/targetVideoBidAdapter.js +1 -1
  102. package/dist/teadsBidAdapter.js +1 -1
  103. package/dist/trionBidAdapter.js +1 -1
  104. package/dist/tripleliftBidAdapter.js +1 -1
  105. package/dist/trustxBidAdapter.js +1 -1
  106. package/dist/ttdBidAdapter.js +1 -1
  107. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  108. package/dist/underdogmediaBidAdapter.js +1 -1
  109. package/dist/undertoneBidAdapter.js +1 -1
  110. package/dist/vidazooBidAdapter.js +1 -1
  111. package/dist/videobyteBidAdapter.js +1 -1
  112. package/dist/visxBidAdapter.js +1 -1
  113. package/dist/vuukleBidAdapter.js +1 -1
  114. package/dist/widespaceBidAdapter.js +1 -1
  115. package/dist/winrBidAdapter.js +1 -1
  116. package/dist/yahoosspBidAdapter.js +1 -1
  117. package/dist/yieldmoBidAdapter.js +1 -1
  118. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  119. package/modules/adomikAnalyticsAdapter.js +67 -43
  120. package/modules/adotBidAdapter.js +1 -1
  121. package/modules/apacdexBidAdapter.js +52 -41
  122. package/modules/audiencerunBidAdapter.js +75 -22
  123. package/modules/betweenBidAdapter.js +1 -1
  124. package/modules/cointrafficBidAdapter.js +1 -1
  125. package/modules/colossussspBidAdapter.js +5 -1
  126. package/modules/consentManagement.js +4 -4
  127. package/modules/consentManagementUsp.js +2 -2
  128. package/modules/e_volutionBidAdapter.js +19 -1
  129. package/modules/ftrackIdSystem.js +16 -2
  130. package/modules/ftrackIdSystem.md +12 -1
  131. package/modules/malltvAnalyticsAdapter.js +1 -1
  132. package/modules/mobfoxpbBidAdapter.js +135 -0
  133. package/modules/mobfoxpbBidAdapter.md +3 -3
  134. package/modules/nextMillenniumBidAdapter.js +6 -2
  135. package/modules/nexx360BidAdapter.js +14 -4
  136. package/modules/otmBidAdapter.js +43 -35
  137. package/modules/prebidServerBidAdapter/index.js +58 -14
  138. package/modules/pubmaticBidAdapter.js +34 -2
  139. package/modules/seedingAllianceBidAdapter.js +8 -4
  140. package/package.json +1 -1
  141. package/src/adapters/bidderFactory.js +17 -0
  142. package/src/auction.js +1 -7
  143. package/test/spec/auctionmanager_spec.js +2 -0
  144. package/test/spec/modules/adomikAnalyticsAdapter_spec.js +133 -33
  145. package/test/spec/modules/adotBidAdapter_spec.js +1 -1
  146. package/test/spec/modules/apacdexBidAdapter_spec.js +6 -6
  147. package/test/spec/modules/audiencerunBidAdapter_spec.js +185 -97
  148. package/test/spec/modules/cointrafficBidAdapter_spec.js +1 -1
  149. package/test/spec/modules/colossussspBidAdapter_spec.js +97 -3
  150. package/test/spec/modules/consentManagementUsp_spec.js +1 -0
  151. package/test/spec/modules/consentManagement_spec.js +22 -0
  152. package/test/spec/modules/e_volutionBidAdapter_spec.js +67 -10
  153. package/test/spec/modules/ftrackIdSystem_spec.js +75 -1
  154. package/test/spec/modules/mobfoxpbBidAdapter_spec.js +307 -0
  155. package/test/spec/modules/nexx360BidAdapter_spec.js +49 -0
  156. package/test/spec/modules/otmBidAdapter_spec.js +32 -11
  157. package/test/spec/modules/prebidServerBidAdapter_spec.js +200 -0
  158. package/test/spec/modules/pubmaticBidAdapter_spec.js +129 -0
  159. package/test/spec/unit/core/bidderFactory_spec.js +137 -0
@@ -1,32 +1,30 @@
1
- import { deepAccess, isFn, logError, getValue, getBidIdParameter, _each, isArray, triggerPixel } from '../src/utils.js';
1
+ import {
2
+ deepAccess,
3
+ isFn,
4
+ logError,
5
+ getValue,
6
+ getBidIdParameter,
7
+ _each,
8
+ isArray,
9
+ triggerPixel,
10
+ formatQS,
11
+ } from '../src/utils.js';
2
12
  import { config } from '../src/config.js';
3
13
  import { registerBidder } from '../src/adapters/bidderFactory.js';
4
14
  import { BANNER } from '../src/mediaTypes.js';
15
+ import { createEidsArray } from './userId/eids.js';
5
16
 
6
17
  const BIDDER_CODE = 'audiencerun';
7
18
  const BASE_URL = 'https://d.audiencerun.com';
8
19
  const AUCTION_URL = `${BASE_URL}/prebid`;
9
20
  const TIMEOUT_EVENT_URL = `${BASE_URL}/ps/pbtimeout`;
21
+ const ERROR_EVENT_URL = `${BASE_URL}/js_log`;
10
22
  const DEFAULT_CURRENCY = 'USD';
11
23
 
12
24
  let requestedBids = [];
13
25
 
14
26
  /**
15
- * Gets bidder request referer
16
- *
17
- * @param {Object} bidderRequest
18
- * @return {string}
19
- */
20
- function getPageUrl(bidderRequest) {
21
- return (
22
- config.getConfig('pageUrl') ||
23
- deepAccess(bidderRequest, 'refererInfo.referer') ||
24
- null
25
- );
26
- }
27
-
28
- /**
29
- * Returns bidfloor through floors module if available
27
+ * Returns bidfloor through floors module if available.
30
28
  *
31
29
  * @param {Object} bid
32
30
  * @returns {number}
@@ -44,19 +42,53 @@ function getBidFloor(bid) {
44
42
  });
45
43
  return bidFloor.floor;
46
44
  } catch (_) {
47
- return 0
45
+ return 0;
48
46
  }
49
47
  }
50
48
 
49
+ /**
50
+ * Returns the most top page referer.
51
+ *
52
+ * @returns {string}
53
+ */
54
+ function getPageReferer() {
55
+ let t, e;
56
+ do {
57
+ t = t ? t.parent : window;
58
+ try {
59
+ e = t.document.referrer;
60
+ } catch (_) {
61
+ break;
62
+ }
63
+ } while (t !== window.top);
64
+ return e;
65
+ }
66
+
67
+ /**
68
+ * Returns bidder request page url.
69
+ *
70
+ * @param {Object} bidderRequest
71
+ * @return {string}
72
+ */
73
+ function getPageUrl(bidderRequest) {
74
+ return (
75
+ config.getConfig('pageUrl') ||
76
+ deepAccess(bidderRequest, 'refererInfo.referer') ||
77
+ getPageReferer() ||
78
+ null
79
+ );
80
+ }
81
+
51
82
  export const spec = {
52
- version: '1.1.0',
83
+ version: '1.2.0',
53
84
  code: BIDDER_CODE,
85
+ gvlid: 944,
54
86
  supportedMediaTypes: [BANNER],
55
87
 
56
88
  /**
57
89
  * Determines whether or not the given bid request is valid.
58
90
  *
59
- * @param {object} bid The bid to validate.
91
+ * @param {BidRequest} bid The bid params to validate.
60
92
  * @return boolean True if this is a valid bid, and false otherwise.
61
93
  */
62
94
  isBidRequestValid: function (bid) {
@@ -95,12 +127,19 @@ export const spec = {
95
127
 
96
128
  const payload = {
97
129
  libVersion: this.version,
98
- referer: getPageUrl(bidderRequest),
130
+ pageUrl: config.getConfig('pageUrl'),
131
+ pageReferer: getPageReferer(),
132
+ referer: deepAccess(bidderRequest, 'refererInfo.referer'),
133
+ refererInfo: deepAccess(bidderRequest, 'refererInfo'),
99
134
  currencyCode: config.getConfig('currency.adServerCurrency'),
100
135
  timeout: config.getConfig('bidderTimeout'),
101
136
  bids,
102
137
  };
103
138
 
139
+ payload.uspConsent = deepAccess(bidderRequest, 'uspConsent');
140
+ payload.schain = deepAccess(bidRequests, '0.schain');
141
+ payload.userId = deepAccess(bidRequests, '0.userId') ? createEidsArray(bidRequests[0].userId) : [];
142
+
104
143
  if (bidderRequest && bidderRequest.gdprConsent) {
105
144
  payload.gdpr = {
106
145
  consent: bidderRequest.gdprConsent.consentString,
@@ -117,7 +156,7 @@ export const spec = {
117
156
 
118
157
  return {
119
158
  method: 'POST',
120
- url: AUCTION_URL,
159
+ url: deepAccess(bidRequests, '0.params.auctionUrl', AUCTION_URL),
121
160
  data: JSON.stringify(payload),
122
161
  options: {
123
162
  withCredentials: true,
@@ -201,7 +240,9 @@ export const spec = {
201
240
  }
202
241
 
203
242
  timeoutData.forEach((bid) => {
204
- const bidOnTimeout = requestedBids.find((requestedBid) => requestedBid.bidId === bid.bidId);
243
+ const bidOnTimeout = requestedBids.find(
244
+ (requestedBid) => requestedBid.bidId === bid.bidId
245
+ );
205
246
 
206
247
  if (bidOnTimeout) {
207
248
  triggerPixel(
@@ -210,6 +251,18 @@ export const spec = {
210
251
  }
211
252
  });
212
253
  },
254
+
255
+ /**
256
+ * Registers bidder specific code, which will execute if the bidder responded with an error.
257
+ * @param {{bidderRequest: object}} args An object from which we extract bidderRequest object.
258
+ */
259
+ onBidderError: function ({ bidderRequest }) {
260
+ const queryString = formatQS({
261
+ message: `Prebid.js: Server call for ${bidderRequest.bidderCode} failed.`,
262
+ url: encodeURIComponent(getPageUrl(bidderRequest)),
263
+ });
264
+ triggerPixel(`${ERROR_EVENT_URL}/?${queryString}`);
265
+ },
213
266
  };
214
267
 
215
268
  registerBidder(spec);
@@ -53,7 +53,7 @@ export const spec = {
53
53
  params.maxd = video.maxd;
54
54
  params.mind = video.mind;
55
55
  params.pos = 'atf';
56
- ENDPOINT += '&jst=pvc';
56
+ params.jst = 'pvc';
57
57
  params.codeType = includes(CODE_TYPES, video.codeType) ? video.codeType : 'inpage';
58
58
  }
59
59
 
@@ -4,7 +4,7 @@ import { BANNER } from '../src/mediaTypes.js'
4
4
  import { config } from '../src/config.js'
5
5
 
6
6
  const BIDDER_CODE = 'cointraffic';
7
- const ENDPOINT_URL = 'https://appspb.cointraffic.io/pb/tmp';
7
+ const ENDPOINT_URL = 'https://apps-pbd.ctengine.io/pb/tmp';
8
8
  const DEFAULT_CURRENCY = 'EUR';
9
9
  const ALLOWED_CURRENCIES = [
10
10
  'EUR', 'USD', 'JPY', 'BGN', 'CZK', 'DKK', 'GBP', 'HUF', 'PLN', 'RON', 'SEK', 'CHF', 'ISK', 'NOK', 'HRK', 'RUB', 'TRY',
@@ -112,7 +112,6 @@ export const spec = {
112
112
  placementId: bid.params.placement_id,
113
113
  groupId: bid.params.group_id,
114
114
  bidId: bid.bidId,
115
- sizes: bid.mediaTypes[traff].sizes,
116
115
  traffic: traff,
117
116
  eids: [],
118
117
  floor: {}
@@ -146,7 +145,12 @@ export const spec = {
146
145
  rtiPartner: 'TDID'
147
146
  });
148
147
  }
148
+ if (traff === BANNER) {
149
+ placement.sizes = bid.mediaTypes[BANNER].sizes
150
+ }
151
+
149
152
  if (traff === VIDEO) {
153
+ placement.sizes = bid.mediaTypes[VIDEO].playerSize;
150
154
  placement.playerSize = bid.mediaTypes[VIDEO].playerSize;
151
155
  placement.minduration = bid.mediaTypes[VIDEO].minduration;
152
156
  placement.maxduration = bid.mediaTypes[VIDEO].maxduration;
@@ -36,8 +36,8 @@ const cmpCallMap = {
36
36
  * This function reads the consent string from the config to obtain the consent information of the user.
37
37
  * @param {function({})} onSuccess acts as a success callback when the value is read from config; pass along consentObject from CMP
38
38
  */
39
- function lookupStaticConsentData({onSuccess}) {
40
- onSuccess(staticConsentData);
39
+ function lookupStaticConsentData({onSuccess, onError}) {
40
+ processCmpData(staticConsentData, {onSuccess, onError})
41
41
  }
42
42
 
43
43
  /**
@@ -335,8 +335,8 @@ export function requestBidsHook(fn, reqBidsConfigObj) {
335
335
  let height = 1;
336
336
  if (Array.isArray(adUnits) && adUnits.length > 0) {
337
337
  let sizes = getAdUnitSizes(adUnits[0]);
338
- width = sizes[0][0];
339
- height = sizes[0][1];
338
+ width = sizes?.[0]?.[0] || 1;
339
+ height = sizes?.[0]?.[1] || 1;
340
340
  }
341
341
 
342
342
  return function (cb) {
@@ -28,8 +28,8 @@ const uspCallMap = {
28
28
  /**
29
29
  * This function reads the consent string from the config to obtain the consent information of the user.
30
30
  */
31
- function lookupStaticConsentData({onSuccess}) {
32
- onSuccess(staticConsentData);
31
+ function lookupStaticConsentData({onSuccess, onError}) {
32
+ processUspData(staticConsentData, {onSuccess, onError});
33
33
  }
34
34
 
35
35
  /**
@@ -41,6 +41,19 @@ function getBidFloor(bid) {
41
41
  }
42
42
  }
43
43
 
44
+ function getUserId(eids, id, source, uidExt) {
45
+ if (id) {
46
+ var uid = { id };
47
+ if (uidExt) {
48
+ uid.ext = uidExt;
49
+ }
50
+ eids.push({
51
+ source,
52
+ uids: [ uid ]
53
+ });
54
+ }
55
+ }
56
+
44
57
  export const spec = {
45
58
  code: BIDDER_CODE,
46
59
  supportedMediaTypes: [BANNER, VIDEO, NATIVE],
@@ -86,7 +99,12 @@ export const spec = {
86
99
  const placement = {
87
100
  placementId: bid.params.placementId,
88
101
  bidId: bid.bidId,
89
- bidfloor: getBidFloor(bid)
102
+ bidfloor: getBidFloor(bid),
103
+ eids: []
104
+ }
105
+
106
+ if (bid.userId) {
107
+ getUserId(placement.eids, bid.userId.id5id, 'id5-sync.com');
90
108
  }
91
109
 
92
110
  if (bid.mediaTypes && bid.mediaTypes[BANNER] && bid.mediaTypes[BANNER].sizes) {
@@ -73,8 +73,6 @@ export const ftrackIdSubmodule = {
73
73
  CCampID: '148556'
74
74
  };
75
75
  window.D9r = {
76
- DeviceID: true,
77
- SingleDeviceID: true,
78
76
  callback: function(response) {
79
77
  if (response) {
80
78
  storage.setDataInLocalStorage(`${FTRACK_STORAGE_NAME}_exp`, (new Date(Date.now() + (1000 * 60 * 60 * 24 * LOCAL_STORAGE_EXP_DAYS))).toUTCString());
@@ -88,6 +86,22 @@ export const ftrackIdSubmodule = {
88
86
  }
89
87
  };
90
88
 
89
+ // If config.params.ids does not exist, set defaults
90
+ if (!config.params.hasOwnProperty('ids')) {
91
+ window.D9r.DeviceID = true;
92
+ window.D9r.SingleDeviceID = true;
93
+ } else {
94
+ if (config.params.ids.hasOwnProperty('device id') && config.params.ids['device id'] === true) {
95
+ window.D9r.DeviceID = true;
96
+ }
97
+ if (config.params.ids.hasOwnProperty('single device id') && config.params.ids['single device id'] === true) {
98
+ window.D9r.SingleDeviceID = true;
99
+ }
100
+ if (config.params.ids.hasOwnProperty('household id') && config.params.ids['household id'] === true) {
101
+ window.D9r.HHID = true;
102
+ }
103
+ }
104
+
91
105
  if (config.params && config.params.url && config.params.url === FTRACK_URL) {
92
106
  var ftrackScript = document.createElement('script');
93
107
  ftrackScript.setAttribute('src', config.params.url);
@@ -30,7 +30,12 @@ pbjs.setConfig({
30
30
  userIds: [{
31
31
  name: 'FTrack',
32
32
  params: {
33
- url: 'https://d9.flashtalking.com/d9core' // required, if not populated ftrack will not run
33
+ url: 'https://d9.flashtalking.com/d9core', // required, if not populated ftrack will not run
34
+ ids: {
35
+ 'device id': true,
36
+ 'single device id': true,
37
+ 'household id': true
38
+ }
34
39
  },
35
40
  storage: {
36
41
  type: 'html5', // "html5" is the required storage type
@@ -47,6 +52,12 @@ pbjs.setConfig({
47
52
  | Param under userSync.userIds[] | Scope | Type | Description | Example |
48
53
  | :-- | :-- | :-- | :-- | :-- |
49
54
  | name | Required | String | The name of this module: `"FTrack"` | `"FTrack"` |
55
+ | params | Required | Object | The IDs available, if not populated then the defaults "Device ID" and "Single Device ID" will be returned | |
56
+ | params.url | Required | String | The URL for the ftrack library reference. If not populate, ftrack will not run. | 'https://d9.flashtalking.com/d9core' |
57
+ | params.ids | Optional | Object | The ftrack IDs available, if not populated then the defaults "Device ID" and "Single Device ID" will be returned | |
58
+ | params.ids['device id'] | Optional | Boolean | Should ftrack return "device id". Set to `true` to return it. If set to `undefined` or `false`, ftrack will not return "device id". Default is `false` | `true` |
59
+ | params.ids['single device id'] | Optional | Boolean | Should ftrack return "single device id". Set to `true` to return it. If set to `undefined` or `false`, ftrack will not return "single device id". Default is `false` | `true` |
60
+ | params.ids['household id'] | Optional; _Requires pairing with either "device id" or "single device id"_ | Boolean | __1.__ Should ftrack return "household id". Set to `true` to attempt to return it. If set to `undefined` or `false`, ftrack will not return "household id". Default is `false`. __2.__ _This will only return "household id" if value of this field is `true` **AND** "household id" is defined on the device._ __3.__ _"household id" requires either "device id" or "single device id" to be also set to `true`, otherwise ftrack will not return "household id"._ | `true` |
50
61
  | storage | Required | Object | Storage settings for how the User ID module will cache the FTrack ID locally | |
51
62
  | storage.type | Required | String | This is where the results of the user ID will be stored. FTrack **requires** `"html5"`. | `"html5"` |
52
63
  | storage.name | Required | String | The name of the local storage where the user ID will be stored. FTrack **requires** `"FTrackId"`. | `"FTrackId"` |
@@ -184,5 +184,5 @@ malltvAnalyticsAdapter.enableAnalytics = function (config) {
184
184
 
185
185
  adapterManager.registerAnalyticsAdapter({
186
186
  adapter: malltvAnalyticsAdapter,
187
- code: 'malltvAnalytics'
187
+ code: 'malltv'
188
188
  })
@@ -0,0 +1,135 @@
1
+ import { isFn, deepAccess, getWindowTop } from '../src/utils.js';
2
+ import { registerBidder } from '../src/adapters/bidderFactory.js';
3
+ import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
4
+
5
+ const BIDDER_CODE = 'mobfoxpb';
6
+ const AD_URL = 'https://bes.mobfox.com/pbjs';
7
+
8
+ function isBidResponseValid(bid) {
9
+ if (!bid.requestId || !bid.cpm || !bid.creativeId ||
10
+ !bid.ttl || !bid.currency) {
11
+ return false;
12
+ }
13
+ switch (bid.mediaType) {
14
+ case BANNER:
15
+ return Boolean(bid.width && bid.height && bid.ad);
16
+ case VIDEO:
17
+ return Boolean(bid.vastUrl);
18
+ case NATIVE:
19
+ return Boolean(bid.native && bid.native.impressionTrackers);
20
+ default:
21
+ return false;
22
+ }
23
+ }
24
+
25
+ function getBidFloor(bid) {
26
+ if (!isFn(bid.getFloor)) {
27
+ return deepAccess(bid, 'params.bidfloor', 0);
28
+ }
29
+
30
+ try {
31
+ const bidFloor = bid.getFloor({
32
+ currency: 'USD',
33
+ mediaType: '*',
34
+ size: '*',
35
+ });
36
+ return bidFloor.floor;
37
+ } catch (_) {
38
+ return 0
39
+ }
40
+ }
41
+
42
+ export const spec = {
43
+ code: BIDDER_CODE,
44
+ supportedMediaTypes: [BANNER, VIDEO, NATIVE],
45
+
46
+ isBidRequestValid: (bid) => {
47
+ return Boolean(bid.bidId && bid.params && bid.params.placementId);
48
+ },
49
+
50
+ buildRequests: (validBidRequests = [], bidderRequest) => {
51
+ const winTop = getWindowTop();
52
+ const location = winTop.location;
53
+ const placements = [];
54
+ const request = {
55
+ 'deviceWidth': winTop.screen.width,
56
+ 'deviceHeight': winTop.screen.height,
57
+ 'language': (navigator && navigator.language) ? navigator.language.split('-')[0] : '',
58
+ 'secure': 1,
59
+ 'host': location.host,
60
+ 'page': location.pathname,
61
+ 'placements': placements
62
+ };
63
+
64
+ if (bidderRequest) {
65
+ if (bidderRequest.uspConsent) {
66
+ request.ccpa = bidderRequest.uspConsent;
67
+ }
68
+ if (bidderRequest.gdprConsent) {
69
+ request.gdpr = bidderRequest.gdprConsent
70
+ }
71
+ }
72
+
73
+ const len = validBidRequests.length;
74
+ for (let i = 0; i < len; i++) {
75
+ const bid = validBidRequests[i];
76
+ const placement = {
77
+ placementId: bid.params.placementId,
78
+ bidId: bid.bidId,
79
+ schain: bid.schain || {},
80
+ bidfloor: getBidFloor(bid)
81
+ };
82
+ const mediaType = bid.mediaTypes
83
+
84
+ if (mediaType && mediaType[BANNER] && mediaType[BANNER].sizes) {
85
+ placement.traffic = BANNER;
86
+ placement.sizes = mediaType[BANNER].sizes;
87
+ } else if (mediaType && mediaType[VIDEO] && mediaType[VIDEO].playerSize) {
88
+ placement.traffic = VIDEO;
89
+ placement.wPlayer = mediaType[VIDEO].playerSize[0];
90
+ placement.hPlayer = mediaType[VIDEO].playerSize[1];
91
+ placement.playerSize = mediaType[VIDEO].playerSize;
92
+ placement.minduration = mediaType[VIDEO].minduration;
93
+ placement.maxduration = mediaType[VIDEO].maxduration;
94
+ placement.mimes = mediaType[VIDEO].mimes;
95
+ placement.protocols = mediaType[VIDEO].protocols;
96
+ placement.startdelay = mediaType[VIDEO].startdelay;
97
+ placement.placement = mediaType[VIDEO].placement;
98
+ placement.skip = mediaType[VIDEO].skip;
99
+ placement.skipafter = mediaType[VIDEO].skipafter;
100
+ placement.minbitrate = mediaType[VIDEO].minbitrate;
101
+ placement.maxbitrate = mediaType[VIDEO].maxbitrate;
102
+ placement.delivery = mediaType[VIDEO].delivery;
103
+ placement.playbackmethod = mediaType[VIDEO].playbackmethod;
104
+ placement.api = mediaType[VIDEO].api;
105
+ placement.linearity = mediaType[VIDEO].linearity;
106
+ } else if (mediaType && mediaType[NATIVE]) {
107
+ placement.traffic = NATIVE;
108
+ placement.native = mediaType[NATIVE];
109
+ }
110
+ placements.push(placement);
111
+ }
112
+
113
+ return {
114
+ method: 'POST',
115
+ url: AD_URL,
116
+ data: request
117
+ };
118
+ },
119
+
120
+ interpretResponse: (serverResponse) => {
121
+ let response = [];
122
+ for (let i = 0; i < serverResponse.body.length; i++) {
123
+ let resItem = serverResponse.body[i];
124
+ if (isBidResponseValid(resItem)) {
125
+ resItem.meta = resItem.meta || {};
126
+ resItem.meta.advertiserDomains = resItem.adomain || [];
127
+
128
+ response.push(resItem);
129
+ }
130
+ }
131
+ return response;
132
+ },
133
+ };
134
+
135
+ registerBidder(spec);
@@ -24,7 +24,7 @@ Module that connects to mobfox demand sources
24
24
  {
25
25
  bidder: 'mobfoxpb',
26
26
  params: {
27
- placementId: 0
27
+ placementId: 'testBanner'
28
28
  }
29
29
  }
30
30
  ]
@@ -41,7 +41,7 @@ Module that connects to mobfox demand sources
41
41
  {
42
42
  bidder: 'mobfoxpb',
43
43
  params: {
44
- placementId: 0
44
+ placementId: 'testVideo'
45
45
  }
46
46
  }
47
47
  ]
@@ -63,7 +63,7 @@ Module that connects to mobfox demand sources
63
63
  {
64
64
  bidder: 'mobfoxpb',
65
65
  params: {
66
- placementId: 0
66
+ placementId: 'testNative'
67
67
  }
68
68
  }
69
69
  ]
@@ -1,9 +1,10 @@
1
- import { isStr, _each, getBidIdParameter } from '../src/utils.js';
1
+ import { isStr, _each, parseUrl, getWindowTop, getBidIdParameter } from '../src/utils.js';
2
2
  import { registerBidder } from '../src/adapters/bidderFactory.js';
3
3
  import { BANNER } from '../src/mediaTypes.js';
4
4
 
5
5
  const BIDDER_CODE = 'nextMillennium';
6
6
  const ENDPOINT = 'https://pbs.nextmillmedia.com/openrtb2/auction';
7
+ const TEST_ENDPOINT = 'https://test.pbs.nextmillmedia.com/openrtb2/auction';
7
8
  const SYNC_ENDPOINT = 'https://statics.nextmillmedia.com/load-cookie.html?v=4';
8
9
  const TIME_TO_LIVE = 360;
9
10
 
@@ -61,9 +62,12 @@ export const spec = {
61
62
  }
62
63
  }
63
64
 
65
+ const urlParameters = parseUrl(getWindowTop().location.href).search;
66
+ const isTest = urlParameters['pbs'] && urlParameters['pbs'] === 'test';
67
+
64
68
  requests.push({
65
69
  method: 'POST',
66
- url: ENDPOINT,
70
+ url: isTest ? TEST_ENDPOINT : ENDPOINT,
67
71
  data: JSON.stringify(postBody),
68
72
  options: {
69
73
  contentType: 'application/json',
@@ -1,5 +1,6 @@
1
1
  import {ajax} from '../src/ajax.js';
2
2
  import {config} from '../src/config.js';
3
+ import { transformBidderParamKeywords } from '../src/utils.js';
3
4
  import {registerBidder} from '../src/adapters/bidderFactory.js';
4
5
  import {BANNER, VIDEO} from '../src/mediaTypes.js';
5
6
 
@@ -8,8 +9,11 @@ const BIDDER_URL = 'https://fast.nexx360.io/prebid';
8
9
  const CACHE_URL = 'https://fast.nexx360.io/cache';
9
10
  const METRICS_TRACKER_URL = 'https://fast.nexx360.io/track-imp';
10
11
 
12
+ const GVLID = 965;
13
+
11
14
  export const spec = {
12
15
  code: BIDDER_CODE,
16
+ gvlid: GVLID,
13
17
  aliases: ['revenuemaker'], // short code
14
18
  supportedMediaTypes: [BANNER, VIDEO],
15
19
  /**
@@ -19,6 +23,9 @@ export const spec = {
19
23
  * @return boolean True if this is a valid bid, and false otherwise.
20
24
  */
21
25
  isBidRequestValid: function(bid) {
26
+ if (!!bid.params.bidfloorCurrency && !['EUR', 'USD'].includes(bid.params.bidfloorCurrency)) return false;
27
+ if (!!bid.params.bidfloor && typeof bid.params.bidfloor !== 'number') return false;
28
+ if (!!bid.params.keywords && typeof bid.params.keywords !== 'object') return false;
22
29
  return !!(bid.params.account && bid.params.tagId);
23
30
  },
24
31
  /**
@@ -34,7 +41,7 @@ export const spec = {
34
41
  let userEids = null;
35
42
  Object.keys(validBidRequests).forEach(key => {
36
43
  adunitValue = validBidRequests[key];
37
- adUnits.push({
44
+ const foo = {
38
45
  account: adunitValue.params.account,
39
46
  tagId: adunitValue.params.tagId,
40
47
  videoExt: adunitValue.params.videoExt,
@@ -42,8 +49,12 @@ export const spec = {
42
49
  bidId: adunitValue.bidId,
43
50
  auctionId: adunitValue.auctionId,
44
51
  transactionId: adunitValue.transactionId,
45
- mediatypes: adunitValue.mediaTypes
46
- });
52
+ mediatypes: adunitValue.mediaTypes,
53
+ bidfloor: adunitValue.params.bidfloor || 0,
54
+ bidfloorCurrency: adunitValue.params.bidfloorCurrency || 'USD',
55
+ keywords: adunitValue.params.keywords ? transformBidderParamKeywords(adunitValue.params.keywords) : [],
56
+ }
57
+ adUnits.push(foo);
47
58
  if (adunitValue.userIdAsEids) userEids = adunitValue.userIdAsEids;
48
59
  });
49
60
  const payload = {
@@ -78,7 +89,6 @@ export const spec = {
78
89
  */
79
90
  interpretResponse: function(serverResponse, bidRequest) {
80
91
  const serverBody = serverResponse.body;
81
- // const headerValue = serverResponse.headers.get('some-response-header');
82
92
  const bidResponses = [];
83
93
  let bidResponse = null;
84
94
  let value = null;