prebid.js 5.19.0 → 6.2.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 (161) hide show
  1. package/.babelrc.js +1 -10
  2. package/README.md +4 -2
  3. package/browsers.json +13 -37
  4. package/gulpfile.js +1 -0
  5. package/karma.conf.maker.js +1 -1
  6. package/modules/adheseBidAdapter.js +7 -2
  7. package/modules/adkernelBidAdapter.js +1 -0
  8. package/modules/adlivetechBidAdapter.md +61 -0
  9. package/modules/admixerBidAdapter.js +2 -1
  10. package/modules/adnuntiusBidAdapter.js +2 -1
  11. package/modules/adomikAnalyticsAdapter.js +10 -4
  12. package/modules/adplusBidAdapter.js +203 -0
  13. package/modules/adplusBidAdapter.md +39 -0
  14. package/modules/adyoulikeBidAdapter.js +7 -2
  15. package/modules/airgridRtdProvider.js +1 -1
  16. package/modules/appnexusBidAdapter.js +28 -5
  17. package/modules/atsAnalyticsAdapter.js +67 -46
  18. package/modules/atsAnalyticsAdapter.md +1 -0
  19. package/modules/beachfrontBidAdapter.js +14 -17
  20. package/modules/betweenBidAdapter.js +2 -1
  21. package/modules/browsiRtdProvider.js +106 -18
  22. package/modules/cleanioRtdProvider.js +192 -0
  23. package/modules/cleanioRtdProvider.md +59 -0
  24. package/modules/codefuelBidAdapter.js +1 -3
  25. package/modules/codefuelBidAdapter.md +3 -3
  26. package/modules/craftBidAdapter.js +5 -3
  27. package/modules/datablocksBidAdapter.js +3 -3
  28. package/modules/dchain.js +149 -0
  29. package/modules/dchain.md +45 -0
  30. package/modules/deepintentBidAdapter.js +1 -1
  31. package/modules/deltaprojectsBidAdapter.js +252 -0
  32. package/modules/deltaprojectsBidAdapter.md +32 -0
  33. package/modules/emx_digitalBidAdapter.js +9 -1
  34. package/modules/engageyaBidAdapter.js +68 -54
  35. package/modules/freewheel-sspBidAdapter.js +6 -0
  36. package/modules/glimpseBidAdapter.js +31 -16
  37. package/modules/goldbachBidAdapter.js +1176 -0
  38. package/modules/goldbachBidAdapter.md +151 -0
  39. package/modules/gptPreAuction.js +11 -5
  40. package/modules/gridBidAdapter.js +1 -0
  41. package/modules/gumgumBidAdapter.js +5 -1
  42. package/modules/id5IdSystem.md +6 -6
  43. package/modules/imRtdProvider.js +31 -0
  44. package/modules/intersectionRtdProvider.js +114 -0
  45. package/modules/invibesBidAdapter.js +15 -9
  46. package/modules/ipromBidAdapter.js +79 -0
  47. package/modules/ixBidAdapter.js +173 -22
  48. package/modules/jixieBidAdapter.js +8 -2
  49. package/modules/justpremiumBidAdapter.js +6 -1
  50. package/modules/limelightDigitalBidAdapter.js +2 -1
  51. package/modules/livewrappedAnalyticsAdapter.js +5 -0
  52. package/modules/luponmediaBidAdapter.js +570 -0
  53. package/modules/merkleIdSystem.js +5 -0
  54. package/modules/missenaBidAdapter.js +89 -0
  55. package/modules/multibid/index.js +3 -3
  56. package/modules/nativoBidAdapter.js +32 -2
  57. package/modules/oguryBidAdapter.js +2 -1
  58. package/modules/openxBidAdapter.js +7 -2
  59. package/modules/operaadsBidAdapter.js +21 -1
  60. package/modules/otmBidAdapter.js +146 -0
  61. package/modules/otmBidAdapter.md +27 -26
  62. package/modules/outbrainBidAdapter.js +5 -0
  63. package/modules/playwireBidAdapter.md +61 -0
  64. package/modules/prebidServerBidAdapter/index.js +3 -3
  65. package/modules/pubmaticBidAdapter.js +5 -3
  66. package/modules/relaidoBidAdapter.js +86 -65
  67. package/modules/richaudienceBidAdapter.js +1 -1
  68. package/modules/rtdModule/index.js +2 -2
  69. package/modules/saambaaBidAdapter.js +420 -0
  70. package/modules/saambaaBidAdapter.md +65 -68
  71. package/modules/seedtagBidAdapter.js +6 -0
  72. package/modules/smaatoBidAdapter.js +9 -1
  73. package/modules/smartxBidAdapter.js +17 -1
  74. package/modules/sonobiBidAdapter.js +7 -0
  75. package/modules/sortableBidAdapter.js +1 -0
  76. package/modules/sspBCBidAdapter.js +34 -3
  77. package/modules/tappxBidAdapter.js +3 -1
  78. package/modules/teadsBidAdapter.js +3 -0
  79. package/modules/trustxBidAdapter.js +18 -7
  80. package/modules/undertoneBidAdapter.js +8 -1
  81. package/modules/userId/index.js +27 -2
  82. package/modules/ventes.md +71 -0
  83. package/modules/ventesBidAdapter.js +410 -0
  84. package/modules/ventesBidAdapter.md +93 -0
  85. package/modules/vidoomyBidAdapter.js +51 -100
  86. package/modules/visxBidAdapter.js +20 -3
  87. package/modules/visxBidAdapter.md +4 -6
  88. package/modules/yahoosspBidAdapter.js +6 -6
  89. package/modules/yahoosspBidAdapter.md +1 -1
  90. package/modules/yieldlabBidAdapter.js +41 -10
  91. package/modules/yieldlabBidAdapter.md +91 -48
  92. package/modules/yieldoneBidAdapter.js +115 -11
  93. package/package.json +6 -1
  94. package/src/adapterManager.js +14 -8
  95. package/src/auction.js +14 -13
  96. package/src/targeting.js +2 -2
  97. package/src/utils.js +7 -0
  98. package/test/spec/integration/faker/googletag.js +6 -0
  99. package/test/spec/modules/adheseBidAdapter_spec.js +27 -1
  100. package/test/spec/modules/adnuntiusBidAdapter_spec.js +18 -0
  101. package/test/spec/modules/adomikAnalyticsAdapter_spec.js +3 -1
  102. package/test/spec/modules/adplusBidAdapter_spec.js +213 -0
  103. package/test/spec/modules/adyoulikeBidAdapter_spec.js +26 -0
  104. package/test/spec/modules/appnexusBidAdapter_spec.js +65 -2
  105. package/test/spec/modules/atsAnalyticsAdapter_spec.js +42 -9
  106. package/test/spec/modules/beachfrontBidAdapter_spec.js +65 -1
  107. package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
  108. package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
  109. package/test/spec/modules/codefuelBidAdapter_spec.js +1 -1
  110. package/test/spec/modules/datablocksBidAdapter_spec.js +3 -3
  111. package/test/spec/modules/dchain_spec.js +329 -0
  112. package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
  113. package/test/spec/modules/emx_digitalBidAdapter_spec.js +10 -0
  114. package/test/spec/modules/engageyaBidAdapter_spec.js +231 -95
  115. package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
  116. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
  117. package/test/spec/modules/glimpseBidAdapter_spec.js +33 -0
  118. package/test/spec/modules/goldbachBidAdapter_spec.js +1359 -0
  119. package/test/spec/modules/gptPreAuction_spec.js +58 -4
  120. package/test/spec/modules/gumgumBidAdapter_spec.js +6 -0
  121. package/test/spec/modules/imRtdProvider_spec.js +25 -0
  122. package/test/spec/modules/intersectionRtdProvider_spec.js +141 -0
  123. package/test/spec/modules/invibesBidAdapter_spec.js +29 -4
  124. package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
  125. package/test/spec/modules/ixBidAdapter_spec.js +288 -5
  126. package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
  127. package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
  128. package/test/spec/modules/konduitWrapper_spec.js +0 -1
  129. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +10 -7
  130. package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +23 -4
  131. package/test/spec/modules/luponmediaBidAdapter_spec.js +412 -0
  132. package/test/spec/modules/merkleIdSystem_spec.js +18 -0
  133. package/test/spec/modules/missenaBidAdapter_spec.js +134 -0
  134. package/test/spec/modules/multibid_spec.js +31 -31
  135. package/test/spec/modules/nativoBidAdapter_spec.js +35 -18
  136. package/test/spec/modules/oguryBidAdapter_spec.js +13 -11
  137. package/test/spec/modules/openxBidAdapter_spec.js +5 -26
  138. package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
  139. package/test/spec/modules/otmBidAdapter_spec.js +67 -0
  140. package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
  141. package/test/spec/modules/prebidServerBidAdapter_spec.js +19 -2
  142. package/test/spec/modules/pubmaticBidAdapter_spec.js +1 -1
  143. package/test/spec/modules/relaidoBidAdapter_spec.js +71 -63
  144. package/test/spec/modules/seedtagBidAdapter_spec.js +3 -0
  145. package/test/spec/modules/smaatoBidAdapter_spec.js +61 -0
  146. package/test/spec/modules/smartxBidAdapter_spec.js +9 -0
  147. package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
  148. package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
  149. package/test/spec/modules/sspBCBidAdapter_spec.js +33 -3
  150. package/test/spec/modules/tappxBidAdapter_spec.js +4 -0
  151. package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
  152. package/test/spec/modules/trustxBidAdapter_spec.js +45 -3
  153. package/test/spec/modules/userId_spec.js +51 -0
  154. package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
  155. package/test/spec/modules/vidoomyBidAdapter_spec.js +32 -13
  156. package/test/spec/modules/visxBidAdapter_spec.js +121 -5
  157. package/test/spec/modules/yieldlabBidAdapter_spec.js +81 -0
  158. package/test/spec/modules/yieldoneBidAdapter_spec.js +299 -53
  159. package/test/spec/unit/core/adapterManager_spec.js +26 -7
  160. package/test/spec/unit/core/targeting_spec.js +44 -0
  161. package/wdio.conf.js +1 -1
@@ -17,6 +17,16 @@ const adUnitsRequested = {}
17
17
 
18
18
  // Prebid adapter referrence doc: https://docs.prebid.org/dev-docs/bidder-adaptor.html
19
19
 
20
+ // Validity checks for optionsl paramters
21
+ const validParameter = {
22
+ url: (value) => typeof value === 'string',
23
+ placementId: (value) => {
24
+ const isString = typeof value === 'string'
25
+ const isNumber = typeof value === 'number'
26
+ return isString || isNumber
27
+ },
28
+ }
29
+
20
30
  export const spec = {
21
31
  code: BIDDER_CODE,
22
32
  gvlid: GVLID,
@@ -30,7 +40,23 @@ export const spec = {
30
40
  * @return boolean True if this is a valid bid, and false otherwise.
31
41
  */
32
42
  isBidRequestValid: function (bid) {
33
- return true
43
+ // We don't need any specific parameters to make a bid request
44
+ // If not parameters are supplied just verify it's the correct bidder code
45
+ if (!bid.params) return bid.bidder === BIDDER_CODE
46
+
47
+ // Check if any supplied parameters are invalid
48
+ const hasInvalidParameters = Object.keys(bid.params).some(key => {
49
+ const value = bid.params[key]
50
+ const validityCheck = validParameter[key]
51
+
52
+ // We don't have a test for this so it's not a paramter we care about
53
+ if (!validityCheck) return false
54
+
55
+ // Return if the check is not passed
56
+ return !validityCheck(value)
57
+ })
58
+
59
+ return !hasInvalidParameters
34
60
  },
35
61
 
36
62
  /**
@@ -98,7 +124,11 @@ export const spec = {
98
124
  ]
99
125
 
100
126
  if (placementIds.size > 0) {
101
- params.unshift({ key: 'ntv_ptd', value: [...placementIds].join(',') })
127
+ // Convert Set to Array (IE 11 Safe)
128
+ const placements = []
129
+ placementIds.forEach((value) => placements.push(value))
130
+ // Append to query string paramters
131
+ params.unshift({ key: 'ntv_ptd', value: placements.join(',') })
102
132
  }
103
133
 
104
134
  if (bidderRequest.gdprConsent) {
@@ -83,7 +83,8 @@ function buildRequests(validBidRequests, bidderRequest) {
83
83
  bidfloor: getFloor(bidRequest),
84
84
  banner: {
85
85
  format: sizes
86
- }
86
+ },
87
+ ext: bidRequest.params
87
88
  });
88
89
  }
89
90
  });
@@ -42,7 +42,12 @@ export const USER_ID_CODE_TO_QUERY_ARG = {
42
42
  novatiq: 'novatiqid', // Novatiq ID
43
43
  mwOpenLinkId: 'mwopenlinkid', // MediaWallah OpenLink ID
44
44
  dapId: 'dapid', // Akamai DAP ID
45
- amxId: 'amxid' // AMX RTB ID
45
+ amxId: 'amxid', // AMX RTB ID
46
+ kpuid: 'kpuid', // Kinesso ID
47
+ publinkId: 'publinkid', // Publisher Link
48
+ naveggId: 'naveggid', // Navegg ID
49
+ imuid: 'imuid', // IM-UID by Intimate Merger
50
+ adtelligentId: 'adtelligentid' // Adtelligent ID
46
51
  };
47
52
 
48
53
  export const spec = {
@@ -322,7 +327,7 @@ function buildFpdQueryParams(fpdPath) {
322
327
  return acc;
323
328
  }, {})
324
329
  return Object.keys(fpd)
325
- .map((name, _) => name + ':' + [...new Set(fpd[name])].join('|'))
330
+ .map((name, _) => name + ':' + fpd[name].join('|'))
326
331
  .join(',')
327
332
  }
328
333
 
@@ -8,6 +8,7 @@ import { OUTSTREAM } from '../src/video.js';
8
8
  const BIDDER_CODE = 'operaads';
9
9
 
10
10
  const ENDPOINT = 'https://s.adx.opera.com/ortb/v2/';
11
+ const USER_SYNC_ENDPOINT = 'https://s.adx.opera.com/usersync/page';
11
12
 
12
13
  const OUTSTREAM_RENDERER_URL = 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js';
13
14
 
@@ -137,6 +138,25 @@ export const spec = {
137
138
  * @return {UserSync[]} The user syncs which should be dropped.
138
139
  */
139
140
  getUserSyncs: function (syncOptions, serverResponses, gdprConsent, uspConsent) {
141
+ if ('iframeEnabled' in syncOptions && syncOptions.iframeEnabled) {
142
+ return [{
143
+ type: 'iframe',
144
+ url: USER_SYNC_ENDPOINT
145
+ }];
146
+ }
147
+ if ('pixelEnabled' in syncOptions && syncOptions.pixelEnabled) {
148
+ const pixels = deepAccess(serverResponses, '0.body.pixels')
149
+ if (Array.isArray(pixels)) {
150
+ const userSyncPixels = []
151
+ for (const pixel of pixels) {
152
+ userSyncPixels.push({
153
+ type: 'image',
154
+ url: pixel
155
+ })
156
+ }
157
+ return userSyncPixels;
158
+ }
159
+ }
140
160
  return [];
141
161
  },
142
162
 
@@ -212,7 +232,7 @@ function buildOpenRtbBidRequest(bidRequest, bidderRequest) {
212
232
  ext: {}
213
233
  },
214
234
  user: {
215
- id: getUserId(bidRequest)
235
+ buyeruid: getUserId(bidRequest)
216
236
  }
217
237
  }
218
238
 
@@ -0,0 +1,146 @@
1
+ import { registerBidder } from '../src/adapters/bidderFactory.js';
2
+ import {logInfo, logError, getBidIdParameter, _each, getValue, isFn, isPlainObject} from '../src/utils.js';
3
+ import { BANNER } from '../src/mediaTypes.js';
4
+
5
+ const BIDDER_CODE = 'otm';
6
+ const OTM_BID_URL = 'https://ssp.otm-r.com/adjson';
7
+ const DEF_CUR = 'RUB'
8
+
9
+ export const spec = {
10
+
11
+ code: BIDDER_CODE,
12
+ url: OTM_BID_URL,
13
+ supportedMediaTypes: [ BANNER ],
14
+
15
+ /**
16
+ * Determines whether or not the given bid request is valid.
17
+ *
18
+ * @param {object} bid The bid to validate.
19
+ * @return boolean True if this is a valid bid, and false otherwise.
20
+ */
21
+ isBidRequestValid: function (bid) {
22
+ return !!bid.params.tid;
23
+ },
24
+
25
+ /**
26
+ * Build bidder requests.
27
+ *
28
+ * @param validBidRequests
29
+ * @param bidderRequest
30
+ * @returns {[]}
31
+ */
32
+ buildRequests: function (validBidRequests, bidderRequest) {
33
+ logInfo('validBidRequests', validBidRequests);
34
+
35
+ const bidRequests = [];
36
+ let tz = new Date().getTimezoneOffset()
37
+ let referrer = '';
38
+ if (bidderRequest && bidderRequest.refererInfo) {
39
+ referrer = bidderRequest.refererInfo.referer;
40
+ }
41
+
42
+ _each(validBidRequests, (bid) => {
43
+ let domain = getValue(bid.params, 'domain') || ''
44
+ let tid = getValue(bid.params, 'tid')
45
+ let cur = getValue(bid.params, 'currency') || DEF_CUR
46
+ let bidid = getBidIdParameter('bidId', bid)
47
+ let transactionid = getBidIdParameter('transactionId', bid)
48
+ let auctionid = getBidIdParameter('auctionId', bid)
49
+ let bidfloor = _getBidFloor(bid)
50
+
51
+ _each(bid.sizes, size => {
52
+ let width = 0;
53
+ let height = 0;
54
+ if (size.length && typeof size[0] === 'number' && typeof size[1] === 'number') {
55
+ width = size[0];
56
+ height = size[1];
57
+ }
58
+ bidRequests.push({
59
+ method: 'GET',
60
+ url: OTM_BID_URL,
61
+ data: {
62
+ tz: tz,
63
+ w: width,
64
+ h: height,
65
+ domain: domain,
66
+ l: referrer,
67
+ s: tid,
68
+ cur: cur,
69
+ bidid: bidid,
70
+ transactionid: transactionid,
71
+ auctionid: auctionid,
72
+ bidfloor: bidfloor,
73
+ },
74
+ })
75
+ })
76
+ })
77
+ return bidRequests;
78
+ },
79
+
80
+ /**
81
+ * Generate response.
82
+ *
83
+ * @param serverResponse
84
+ * @param request
85
+ * @returns {[]|*[]}
86
+ */
87
+ interpretResponse: function (serverResponse, request) {
88
+ logInfo('serverResponse', serverResponse.body);
89
+
90
+ const responsesBody = serverResponse ? serverResponse.body : {};
91
+ const bidResponses = [];
92
+ try {
93
+ if (responsesBody.length === 0) {
94
+ return [];
95
+ }
96
+
97
+ _each(responsesBody, (bid) => {
98
+ if (bid.ad) {
99
+ bidResponses.push({
100
+ requestId: bid.bidid,
101
+ cpm: bid.cpm,
102
+ width: bid.w,
103
+ height: bid.h,
104
+ creativeId: bid.creativeid,
105
+ currency: bid.currency || 'RUB',
106
+ netRevenue: true,
107
+ ad: bid.ad,
108
+ ttl: bid.ttl,
109
+ transactionId: bid.transactionid,
110
+ meta: {
111
+ advertiserDomains: bid.adDomain ? [bid.adDomain] : []
112
+ }
113
+ });
114
+ }
115
+ });
116
+ } catch (error) {
117
+ logError(error);
118
+ }
119
+
120
+ return bidResponses;
121
+ }
122
+ };
123
+
124
+ /**
125
+ * Get floor value
126
+ * @param bid
127
+ * @returns {null|*}
128
+ * @private
129
+ */
130
+ function _getBidFloor(bid) {
131
+ if (!isFn(bid.getFloor)) {
132
+ return bid.params.bidfloor ? bid.params.bidfloor : 0;
133
+ }
134
+
135
+ let floor = bid.getFloor({
136
+ currency: DEF_CUR,
137
+ mediaType: '*',
138
+ size: '*'
139
+ });
140
+ if (isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === DEF_CUR) {
141
+ return floor.floor;
142
+ }
143
+ return 0;
144
+ }
145
+
146
+ registerBidder(spec);
@@ -1,36 +1,37 @@
1
1
  # Overview
2
2
 
3
- Module Name: OTM Bidder Adapter
4
- Module Type: Bidder Adapter
5
- Maintainer: ?
3
+ **Module Name**: OTM Bidder Adapter
4
+ **Module Type**: Bidder Adapter
5
+ **Maintainer**: e.kretsu@otm-r.com
6
6
 
7
7
  # Description
8
8
 
9
- You can use this adapter to get a bid from otm-r.com.
9
+ OTM Bidder Adapter for Prebid.js. About: https://otm-r.com
10
10
 
11
- About us : http://otm-r.com
11
+ Use `otm` as bidder:
12
12
 
13
+ # Params
14
+ - `tid` required, specific id AdUnit slot.
15
+ - `domain` optional, specific custom domain.
16
+ - `bidfloor` optional.
13
17
 
14
- # Test Parameters
15
- ```javascript
16
- var adUnits = [
17
- {
18
- code: 'div-otm-example',
19
- sizes: [[320, 480]],
20
- bids: [
21
- {
22
- bidder: "otm",
23
- params: {
24
- tid: "99",
25
- bidfloor: 20
26
- }
27
- }
28
- ]
29
- }
30
- ];
18
+ ## AdUnits configuration example
31
19
  ```
20
+ var adUnits = [{
21
+ code: 'your-slot', //use exactly the same code as your slot div id.
22
+ mediaTypes: {
23
+ banner: {
24
+ sizes: [[320, 480]]
25
+ }
26
+ },
27
+ bids: [{
28
+ bidder: 'otm',
29
+ params: {
30
+ tid: 'XXXXX',
31
+ domain: 'specific custom domain, if needed',
32
+ bidfloor: 20
33
+ }
34
+ }]
35
+ }];
32
36
 
33
- Where:
34
-
35
- * tid - A tag id (should have low cardinality)
36
- * bidfloor - Floor price
37
+ ```
@@ -40,6 +40,7 @@ export const spec = {
40
40
  const publisher = setOnAny(validBidRequests, 'params.publisher');
41
41
  const bcat = setOnAny(validBidRequests, 'params.bcat');
42
42
  const badv = setOnAny(validBidRequests, 'params.badv');
43
+ const eids = setOnAny(validBidRequests, 'userIdAsEids')
43
44
  const cur = CURRENCY;
44
45
  const endpointUrl = config.getConfig('outbrain.bidderUrl');
45
46
  const timeout = bidderRequest.timeout;
@@ -105,6 +106,10 @@ export const spec = {
105
106
  deepSetValue(request, 'regs.coppa', config.getConfig('coppa') & 1)
106
107
  }
107
108
 
109
+ if (eids) {
110
+ deepSetValue(request, 'user.ext.eids', eids);
111
+ }
112
+
108
113
  return {
109
114
  method: 'POST',
110
115
  url: endpointUrl,
@@ -0,0 +1,61 @@
1
+ # Overview
2
+
3
+ Module Name: Playwire Bidder Adapter
4
+ Module Type: Bidder Adapter
5
+ Maintainer: grid-tech@themediagrid.com
6
+
7
+ # Description
8
+
9
+ Module that connects to Grid demand source to fetch bids.
10
+ The adapter is GDPR compliant and supports banner and video (instream and outstream).
11
+
12
+ # Test Parameters
13
+ ```
14
+ var adUnits = [
15
+ {
16
+ code: 'test-div',
17
+ sizes: [[300, 250]],
18
+ bids: [
19
+ {
20
+ bidder: "playwire",
21
+ params: {
22
+ uid: '1',
23
+ bidFloor: 0.5
24
+ }
25
+ }
26
+ ]
27
+ },{
28
+ code: 'test-div',
29
+ sizes: [[728, 90]],
30
+ bids: [
31
+ {
32
+ bidder: "playwire",
33
+ params: {
34
+ uid: 2,
35
+ keywords: {
36
+ brandsafety: ['disaster'],
37
+ topic: ['stress', 'fear']
38
+ }
39
+ }
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ code: 'test-div',
45
+ sizes: [[728, 90]],
46
+ mediaTypes: { video: {
47
+ context: 'instream',
48
+ playerSize: [728, 90],
49
+ mimes: ['video/mp4']
50
+ },
51
+ bids: [
52
+ {
53
+ bidder: "playwire",
54
+ params: {
55
+ uid: 11
56
+ }
57
+ }
58
+ ]
59
+ }
60
+ ];
61
+ ```
@@ -731,7 +731,7 @@ const OPEN_RTB_PROTOCOL = {
731
731
  return;
732
732
  }
733
733
  const request = {
734
- id: s2sBidRequest.tid,
734
+ id: firstBidRequest.auctionId,
735
735
  source: {tid: s2sBidRequest.tid},
736
736
  tmax: s2sConfig.timeout,
737
737
  imp: imps,
@@ -751,7 +751,7 @@ const OPEN_RTB_PROTOCOL = {
751
751
  }
752
752
  };
753
753
 
754
- // Sets pbjs version, can be overwritten below if channel exists in s2sConfig.extPrebid
754
+ // This is no longer overwritten unless name and version explicitly overwritten by extPrebid (mergeDeep)
755
755
  request.ext.prebid = Object.assign(request.ext.prebid, {channel: {name: 'pbjs', version: $$PREBID_GLOBAL$$.version}})
756
756
 
757
757
  // set debug flag if in debug mode
@@ -761,7 +761,7 @@ const OPEN_RTB_PROTOCOL = {
761
761
 
762
762
  // s2sConfig video.ext.prebid is passed through openrtb to PBS
763
763
  if (s2sConfig.extPrebid && typeof s2sConfig.extPrebid === 'object') {
764
- request.ext.prebid = Object.assign(request.ext.prebid, s2sConfig.extPrebid);
764
+ request.ext.prebid = mergeDeep(request.ext.prebid, s2sConfig.extPrebid);
765
765
  }
766
766
 
767
767
  /**
@@ -11,6 +11,7 @@ const USER_SYNC_URL_IFRAME = 'https://ads.pubmatic.com/AdServer/js/user_sync.htm
11
11
  const USER_SYNC_URL_IMAGE = 'https://image8.pubmatic.com/AdServer/ImgSync?p=';
12
12
  const DEFAULT_CURRENCY = 'USD';
13
13
  const AUCTION_TYPE = 1;
14
+ const GROUPM_ALIAS = {code: 'groupm', gvlid: 98};
14
15
  const UNDEFINED = undefined;
15
16
  const DEFAULT_WIDTH = 0;
16
17
  const DEFAULT_HEIGHT = 0;
@@ -866,10 +867,10 @@ function _handleEids(payload, validBidRequests) {
866
867
 
867
868
  function _checkMediaType(bid, newBid) {
868
869
  // Create a regex here to check the strings
869
- if (bid.ext && bid.ext['BidType'] != undefined) {
870
- newBid.mediaType = MEDIATYPE[bid.ext.BidType];
870
+ if (bid.ext && bid.ext['bidtype'] != undefined) {
871
+ newBid.mediaType = MEDIATYPE[bid.ext.bidtype];
871
872
  } else {
872
- logInfo(LOG_WARN_PREFIX + 'bid.ext.BidType does not exist, checking alternatively for mediaType')
873
+ logInfo(LOG_WARN_PREFIX + 'bid.ext.bidtype does not exist, checking alternatively for mediaType')
873
874
  var adm = bid.adm;
874
875
  var admStr = '';
875
876
  var videoRegex = new RegExp(/VAST\s+version/);
@@ -1005,6 +1006,7 @@ export const spec = {
1005
1006
  code: BIDDER_CODE,
1006
1007
  gvlid: 76,
1007
1008
  supportedMediaTypes: [BANNER, VIDEO, NATIVE],
1009
+ aliases: [GROUPM_ALIAS],
1008
1010
  /**
1009
1011
  * Determines whether or not the given bid request is valid. Valid bid request must have placementId and hbid
1010
1012
  *
@@ -6,7 +6,7 @@ import { getStorageManager } from '../src/storageManager.js';
6
6
 
7
7
  const BIDDER_CODE = 'relaido';
8
8
  const BIDDER_DOMAIN = 'api.relaido.jp';
9
- const ADAPTER_VERSION = '1.0.6';
9
+ const ADAPTER_VERSION = '1.0.7';
10
10
  const DEFAULT_TTL = 300;
11
11
  const UUID_KEY = 'relaido_uuid';
12
12
 
@@ -31,14 +31,14 @@ function isBidRequestValid(bid) {
31
31
  }
32
32
 
33
33
  function buildRequests(validBidRequests, bidderRequest) {
34
- let bidRequests = [];
34
+ const bids = [];
35
+ let imuid = null;
36
+ let bidDomain = null;
37
+ let bidder = null;
38
+ let count = null;
35
39
 
36
40
  for (let i = 0; i < validBidRequests.length; i++) {
37
41
  const bidRequest = validBidRequests[i];
38
- const placementId = getBidIdParameter('placementId', bidRequest.params);
39
- const bidDomain = bidRequest.params.domain || BIDDER_DOMAIN;
40
- const bidUrl = `https://${bidDomain}/bid/v1/prebid/${placementId}`;
41
- const uuid = getUuid();
42
42
  let mediaType = '';
43
43
  let width = 0;
44
44
  let height = 0;
@@ -55,46 +55,63 @@ function buildRequests(validBidRequests, bidderRequest) {
55
55
  mediaType = BANNER;
56
56
  }
57
57
 
58
- let payload = {
59
- version: ADAPTER_VERSION,
60
- timeout_ms: bidderRequest.timeout,
61
- ad_unit_code: bidRequest.adUnitCode,
62
- auction_id: bidRequest.auctionId,
63
- bidder: bidRequest.bidder,
64
- bidder_request_id: bidRequest.bidderRequestId,
65
- bid_requests_count: bidRequest.bidRequestsCount,
66
- bid_id: bidRequest.bidId,
67
- transaction_id: bidRequest.transactionId,
68
- media_type: mediaType,
69
- uuid: uuid,
70
- width: width,
71
- height: height,
72
- pv: '$prebid.version$'
73
- };
58
+ if (!imuid) {
59
+ const pickImuid = deepAccess(bidRequest, 'userId.imuid');
60
+ if (pickImuid) {
61
+ imuid = pickImuid;
62
+ }
63
+ }
64
+
65
+ if (!bidDomain) {
66
+ bidDomain = bidRequest.params.domain;
67
+ }
68
+
69
+ if (!bidder) {
70
+ bidder = bidRequest.bidder
71
+ }
72
+
73
+ if (!bidder) {
74
+ bidder = bidRequest.bidder
75
+ }
74
76
 
75
- const imuid = deepAccess(bidRequest, 'userId.imuid');
76
- if (imuid) {
77
- payload.imuid = imuid;
77
+ if (!count) {
78
+ count = bidRequest.bidRequestsCount;
78
79
  }
79
80
 
80
- // It may not be encoded, so add it at the end of the payload
81
- payload.ref = bidderRequest.refererInfo.referer;
82
-
83
- bidRequests.push({
84
- method: 'GET',
85
- url: bidUrl,
86
- data: payload,
87
- options: {
88
- withCredentials: true
89
- },
90
- bidId: bidRequest.bidId,
81
+ bids.push({
82
+ bid_id: bidRequest.bidId,
83
+ placement_id: getBidIdParameter('placementId', bidRequest.params),
84
+ transaction_id: bidRequest.transactionId,
85
+ bidder_request_id: bidRequest.bidderRequestId,
86
+ ad_unit_code: bidRequest.adUnitCode,
87
+ auction_id: bidRequest.auctionId,
91
88
  player: bidRequest.params.player,
92
- width: payload.width,
93
- height: payload.height,
94
- mediaType: payload.media_type
89
+ width: width,
90
+ height: height,
91
+ media_type: mediaType
95
92
  });
96
93
  }
97
- return bidRequests;
94
+
95
+ const data = JSON.stringify({
96
+ version: ADAPTER_VERSION,
97
+ bids: bids,
98
+ timeout_ms: bidderRequest.timeout,
99
+ bidder: bidder,
100
+ bid_requests_count: count,
101
+ uuid: getUuid(),
102
+ pv: '$prebid.version$',
103
+ imuid: imuid,
104
+ ref: bidderRequest.refererInfo.referer
105
+ })
106
+
107
+ return {
108
+ method: 'POST',
109
+ url: `https://${bidDomain || BIDDER_DOMAIN}/bid/v1/sprebid`,
110
+ options: {
111
+ withCredentials: true
112
+ },
113
+ data: data
114
+ };
98
115
  }
99
116
 
100
117
  function interpretResponse(serverResponse, bidRequest) {
@@ -105,34 +122,38 @@ function interpretResponse(serverResponse, bidRequest) {
105
122
  }
106
123
 
107
124
  const playerUrl = bidRequest.player || body.playerUrl;
108
- const mediaType = bidRequest.mediaType || VIDEO;
109
-
110
- let bidResponse = {
111
- requestId: bidRequest.bidId,
112
- width: bidRequest.width,
113
- height: bidRequest.height,
114
- cpm: body.price,
115
- currency: body.currency,
116
- creativeId: body.creativeId,
117
- dealId: body.dealId || '',
118
- ttl: body.ttl || DEFAULT_TTL,
119
- netRevenue: true,
120
- mediaType: mediaType,
121
- meta: {
122
- advertiserDomains: body.adomain || [],
123
- mediaType: VIDEO
125
+
126
+ for (const res of body.ads) {
127
+ let bidResponse = {
128
+ requestId: res.bidId,
129
+ width: res.width,
130
+ height: res.height,
131
+ cpm: res.price,
132
+ currency: res.currency,
133
+ creativeId: res.creativeId,
134
+ dealId: body.dealId || '',
135
+ ttl: body.ttl || DEFAULT_TTL,
136
+ netRevenue: true,
137
+ mediaType: res.mediaType || VIDEO,
138
+ meta: {
139
+ advertiserDomains: res.adomain || [],
140
+ mediaType: VIDEO
141
+ }
142
+ };
143
+
144
+ if (bidResponse.mediaType === VIDEO) {
145
+ bidResponse.vastXml = res.vast;
146
+ bidResponse.renderer = newRenderer(res.bidId, playerUrl);
147
+ } else {
148
+ const playerTag = createPlayerTag(playerUrl);
149
+ const renderTag = createRenderTag(res.width, res.height, res.vast);
150
+ bidResponse.ad = `<div id="rop-prebid">${playerTag}${renderTag}</div>`;
124
151
  }
125
- };
126
- if (mediaType === VIDEO) {
127
- bidResponse.vastXml = body.vast;
128
- bidResponse.renderer = newRenderer(bidRequest.bidId, playerUrl);
129
- } else {
130
- const playerTag = createPlayerTag(playerUrl);
131
- const renderTag = createRenderTag(bidRequest.width, bidRequest.height, body.vast);
132
- bidResponse.ad = `<div id="rop-prebid">${playerTag}${renderTag}</div>`;
152
+ bidResponses.push(bidResponse);
133
153
  }
134
- bidResponses.push(bidResponse);
135
154
 
155
+ // eslint-disable-next-line no-console
156
+ console.log(JSON.stringify(bidResponses));
136
157
  return bidResponses;
137
158
  }
138
159
 
@@ -296,7 +296,7 @@ function raiGetFloor(bid, config) {
296
296
  } else if (typeof bid.getFloor == 'function') {
297
297
  let floorSpec = bid.getFloor({
298
298
  currency: config.getConfig('currency.adServerCurrency'),
299
- mediaType: bid.mediaType.banner ? 'banner' : 'video',
299
+ mediaType: typeof bid.mediaTypes['banner'] == 'object' ? 'banner' : 'video',
300
300
  size: '*'
301
301
  })
302
302