prebid.js 7.46.0 → 7.48.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 (195) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/ablidaBidAdapter.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/admaticBidAdapter.js +1 -1
  8. package/dist/adrelevantisBidAdapter.js +1 -1
  9. package/dist/adrinoBidAdapter.js +1 -1
  10. package/dist/adtrgtmeBidAdapter.js +1 -1
  11. package/dist/adxcgBidAdapter.js +1 -1
  12. package/dist/adyoulikeBidAdapter.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/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/asoBidAdapter.js +1 -1
  19. package/dist/axonixBidAdapter.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/carodaBidAdapter.js +1 -1
  25. package/dist/chtnwBidAdapter.js +1 -1
  26. package/dist/concertBidAdapter.js +1 -1
  27. package/dist/connectIdSystem.js +1 -1
  28. package/dist/connectadBidAdapter.js +1 -1
  29. package/dist/consumableBidAdapter.js +1 -1
  30. package/dist/conversantAnalyticsAdapter.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/criteoIdSystem.js +1 -1
  35. package/dist/cwireBidAdapter.js +1 -1
  36. package/dist/dependencies.json +4 -0
  37. package/dist/dspxBidAdapter.js +1 -1
  38. package/dist/emtvBidAdapter.js +1 -0
  39. package/dist/eplanningBidAdapter.js +1 -1
  40. package/dist/feedadBidAdapter.js +1 -1
  41. package/dist/finativeBidAdapter.js +1 -1
  42. package/dist/freewheel-sspBidAdapter.js +1 -1
  43. package/dist/glimpseBidAdapter.js +1 -1
  44. package/dist/gmosspBidAdapter.js +1 -1
  45. package/dist/goldbachBidAdapter.js +1 -1
  46. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  47. package/dist/greenbidsRtdProvider.js +1 -0
  48. package/dist/gridBidAdapter.js +1 -1
  49. package/dist/gumgumBidAdapter.js +1 -1
  50. package/dist/h12mediaBidAdapter.js +1 -1
  51. package/dist/id5IdSystem.js +1 -1
  52. package/dist/impactifyBidAdapter.js +1 -1
  53. package/dist/improvedigitalBidAdapter.js +1 -1
  54. package/dist/inmarBidAdapter.js +1 -1
  55. package/dist/insticatorBidAdapter.js +1 -1
  56. package/dist/iqmBidAdapter.js +1 -1
  57. package/dist/ixBidAdapter.js +1 -1
  58. package/dist/justpremiumBidAdapter.js +1 -1
  59. package/dist/kargoBidAdapter.js +1 -1
  60. package/dist/konduitAnalyticsAdapter.js +1 -1
  61. package/dist/kueezBidAdapter.js +1 -1
  62. package/dist/kueezRtbBidAdapter.js +1 -1
  63. package/dist/kulturemediaBidAdapter.js +1 -1
  64. package/dist/lassoBidAdapter.js +1 -1
  65. package/dist/lifestreetBidAdapter.js +1 -1
  66. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  67. package/dist/logicadBidAdapter.js +1 -1
  68. package/dist/loglyliftBidAdapter.js +1 -1
  69. package/dist/magniteAnalyticsAdapter.js +1 -1
  70. package/dist/malltvAnalyticsAdapter.js +1 -1
  71. package/dist/marsmediaBidAdapter.js +1 -1
  72. package/dist/mediafuseBidAdapter.js +1 -1
  73. package/dist/mediasquareBidAdapter.js +1 -1
  74. package/dist/mgidBidAdapter.js +1 -1
  75. package/dist/minutemediaBidAdapter.js +1 -1
  76. package/dist/minutemediaplusBidAdapter.js +1 -1
  77. package/dist/missenaBidAdapter.js +1 -1
  78. package/dist/nextMillenniumBidAdapter.js +1 -1
  79. package/dist/nexx360BidAdapter.js +1 -1
  80. package/dist/not-for-prod/prebid.js +142 -139
  81. package/dist/oguryBidAdapter.js +1 -1
  82. package/dist/onetagBidAdapter.js +1 -1
  83. package/dist/ooloAnalyticsAdapter.js +1 -1
  84. package/dist/optidigitalBidAdapter.js +1 -1
  85. package/dist/orbitsoftBidAdapter.js +1 -1
  86. package/dist/outbrainBidAdapter.js +1 -1
  87. package/dist/parrableIdSystem.js +1 -1
  88. package/dist/pixfutureBidAdapter.js +1 -1
  89. package/dist/prebid-core.js +1 -1
  90. package/dist/publinkIdSystem.js +1 -1
  91. package/dist/pubmaticBidAdapter.js +1 -1
  92. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  93. package/dist/pxyzBidAdapter.js +1 -1
  94. package/dist/quantcastBidAdapter.js +1 -1
  95. package/dist/radsBidAdapter.js +1 -1
  96. package/dist/readpeakBidAdapter.js +1 -1
  97. package/dist/relaidoBidAdapter.js +1 -1
  98. package/dist/relevantdigitalBidAdapter.js +1 -0
  99. package/dist/rhythmoneBidAdapter.js +1 -1
  100. package/dist/riseBidAdapter.js +1 -1
  101. package/dist/rtbhouseBidAdapter.js +1 -1
  102. package/dist/rubiconAnalyticsAdapter.js +1 -1
  103. package/dist/rubiconBidAdapter.js +1 -1
  104. package/dist/seedingAllianceBidAdapter.js +1 -1
  105. package/dist/seedtagBidAdapter.js +1 -1
  106. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  107. package/dist/sharethroughBidAdapter.js +1 -1
  108. package/dist/shinezBidAdapter.js +1 -1
  109. package/dist/smaatoBidAdapter.js +1 -1
  110. package/dist/smartadserverBidAdapter.js +1 -1
  111. package/dist/smartxBidAdapter.js +1 -1
  112. package/dist/smilewantedBidAdapter.js +1 -1
  113. package/dist/sonobiBidAdapter.js +1 -1
  114. package/dist/sovrnAnalyticsAdapter.js +1 -1
  115. package/dist/sovrnBidAdapter.js +1 -1
  116. package/dist/sspBCBidAdapter.js +1 -1
  117. package/dist/stvBidAdapter.js +1 -1
  118. package/dist/sublimeBidAdapter.js +1 -1
  119. package/dist/synacormediaBidAdapter.js +1 -1
  120. package/dist/targetVideoBidAdapter.js +1 -1
  121. package/dist/teadsBidAdapter.js +1 -1
  122. package/dist/trionBidAdapter.js +1 -1
  123. package/dist/tripleliftBidAdapter.js +1 -1
  124. package/dist/ttdBidAdapter.js +1 -1
  125. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  126. package/dist/uid2IdSystem.js +1 -1
  127. package/dist/underdogmediaBidAdapter.js +1 -1
  128. package/dist/undertoneBidAdapter.js +1 -1
  129. package/dist/userId.js +1 -1
  130. package/dist/vdoaiBidAdapter.js +1 -1
  131. package/dist/vidazooBidAdapter.js +1 -1
  132. package/dist/videobyteBidAdapter.js +1 -1
  133. package/dist/vidoomyBidAdapter.js +1 -1
  134. package/dist/visxBidAdapter.js +1 -1
  135. package/dist/vuukleBidAdapter.js +1 -1
  136. package/dist/widespaceBidAdapter.js +1 -1
  137. package/dist/winrBidAdapter.js +1 -1
  138. package/dist/wipesBidAdapter.js +1 -1
  139. package/dist/yahoosspBidAdapter.js +1 -1
  140. package/dist/yieldmoBidAdapter.js +1 -1
  141. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  142. package/dist/yieldoneBidAdapter.js +1 -1
  143. package/modules/ablidaBidAdapter.js +4 -5
  144. package/modules/admaticBidAdapter.js +32 -5
  145. package/modules/adrinoBidAdapter.js +11 -4
  146. package/modules/axonixBidAdapter.js +6 -6
  147. package/modules/connectIdSystem.js +5 -2
  148. package/modules/criteoBidAdapter.js +3 -5
  149. package/modules/criteoIdSystem.js +27 -14
  150. package/modules/dspxBidAdapter.js +2 -3
  151. package/modules/emtvBidAdapter.js +211 -0
  152. package/modules/emtvBidAdapter.md +79 -0
  153. package/modules/freewheel-sspBidAdapter.js +32 -7
  154. package/modules/greenbidsRtdProvider.js +110 -0
  155. package/modules/greenbidsRtdProvider.md +65 -0
  156. package/modules/impactifyBidAdapter.js +0 -1
  157. package/modules/iqmBidAdapter.js +1 -2
  158. package/modules/missenaBidAdapter.js +1 -1
  159. package/modules/nextMillenniumBidAdapter.js +2 -0
  160. package/modules/orbitsoftBidAdapter.js +1 -2
  161. package/modules/radsBidAdapter.js +3 -4
  162. package/modules/relevantdigitalBidAdapter.js +198 -0
  163. package/modules/relevantdigitalBidAdapter.md +117 -0
  164. package/modules/rtbhouseBidAdapter.js +9 -12
  165. package/modules/sovrnBidAdapter.js +4 -0
  166. package/modules/stvBidAdapter.js +4 -5
  167. package/modules/tripleliftBidAdapter.js +14 -3
  168. package/modules/ttdBidAdapter.js +73 -71
  169. package/modules/underdogmediaBidAdapter.js +9 -12
  170. package/modules/userId/index.js +1 -1
  171. package/modules/vdoaiBidAdapter.js +2 -3
  172. package/modules/vidoomyBidAdapter.js +19 -6
  173. package/modules/vidoomyBidAdapter.md +12 -2
  174. package/modules/wipesBidAdapter.js +2 -3
  175. package/modules/yieldmoBidAdapter.js +2 -2
  176. package/modules/yieldoneBidAdapter.js +3 -4
  177. package/package.json +1 -1
  178. package/test/spec/modules/adlooxAdServerVideo_spec.js +18 -35
  179. package/test/spec/modules/admaticBidAdapter_spec.js +164 -11
  180. package/test/spec/modules/adrinoBidAdapter_spec.js +50 -2
  181. package/test/spec/modules/connectIdSystem_spec.js +4 -4
  182. package/test/spec/modules/criteoBidAdapter_spec.js +56 -0
  183. package/test/spec/modules/criteoIdSystem_spec.js +99 -9
  184. package/test/spec/modules/emtvBidAdapter_spec.js +400 -0
  185. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +31 -2
  186. package/test/spec/modules/greenbidsRtdProvider_spec.js +210 -0
  187. package/test/spec/modules/relevantdigitalBidAdapter_spec.js +295 -0
  188. package/test/spec/modules/rtbhouseBidAdapter_spec.js +24 -2
  189. package/test/spec/modules/sovrnBidAdapter_spec.js +65 -0
  190. package/test/spec/modules/tripleliftBidAdapter_spec.js +53 -8
  191. package/test/spec/modules/ttdBidAdapter_spec.js +20 -0
  192. package/test/spec/modules/vidoomyBidAdapter_spec.js +49 -0
  193. package/test/spec/modules/yieldmoBidAdapter_spec.js +2 -2
  194. package/test/spec/ortbConverter/userId_spec.js +12 -0
  195. package/test/spec/modules/realvuAnalyticsAdapter_spec.js +0 -189
@@ -0,0 +1,211 @@
1
+ import { isFn, deepAccess, logMessage, logError } from '../src/utils.js';
2
+ import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
3
+
4
+ import { registerBidder } from '../src/adapters/bidderFactory.js';
5
+ import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
6
+ import { config } from '../src/config.js';
7
+
8
+ const BIDDER_CODE = 'emtv';
9
+ const AD_URL = 'https://us-east-ep.engagemedia.tv/pbjs';
10
+ const SYNC_URL = 'https://cs.engagemedia.tv';
11
+
12
+ function isBidResponseValid(bid) {
13
+ if (!bid.requestId || !bid.cpm || !bid.creativeId || !bid.ttl || !bid.currency) {
14
+ return false;
15
+ }
16
+
17
+ switch (bid.mediaType) {
18
+ case BANNER:
19
+ return Boolean(bid.width && bid.height && bid.ad);
20
+ case VIDEO:
21
+ return Boolean(bid.vastUrl || bid.vastXml);
22
+ case NATIVE:
23
+ return Boolean(bid.native && bid.native.impressionTrackers && bid.native.impressionTrackers.length);
24
+ default:
25
+ return false;
26
+ }
27
+ }
28
+
29
+ function getPlacementReqData(bid) {
30
+ const { params, bidId, mediaTypes } = bid;
31
+ const schain = bid.schain || {};
32
+ const { placementId, endpointId } = params;
33
+ const bidfloor = getBidFloor(bid);
34
+
35
+ const placement = {
36
+ bidId,
37
+ schain,
38
+ bidfloor
39
+ };
40
+
41
+ if (placementId) {
42
+ placement.placementId = placementId;
43
+ placement.type = 'publisher';
44
+ } else if (endpointId) {
45
+ placement.endpointId = endpointId;
46
+ placement.type = 'network';
47
+ }
48
+
49
+ if (mediaTypes && mediaTypes[BANNER]) {
50
+ placement.adFormat = BANNER;
51
+ placement.sizes = mediaTypes[BANNER].sizes;
52
+ } else if (mediaTypes && mediaTypes[VIDEO]) {
53
+ placement.adFormat = VIDEO;
54
+ placement.playerSize = mediaTypes[VIDEO].playerSize;
55
+ placement.minduration = mediaTypes[VIDEO].minduration;
56
+ placement.maxduration = mediaTypes[VIDEO].maxduration;
57
+ placement.mimes = mediaTypes[VIDEO].mimes;
58
+ placement.protocols = mediaTypes[VIDEO].protocols;
59
+ placement.startdelay = mediaTypes[VIDEO].startdelay;
60
+ placement.placement = mediaTypes[VIDEO].placement;
61
+ placement.skip = mediaTypes[VIDEO].skip;
62
+ placement.skipafter = mediaTypes[VIDEO].skipafter;
63
+ placement.minbitrate = mediaTypes[VIDEO].minbitrate;
64
+ placement.maxbitrate = mediaTypes[VIDEO].maxbitrate;
65
+ placement.delivery = mediaTypes[VIDEO].delivery;
66
+ placement.playbackmethod = mediaTypes[VIDEO].playbackmethod;
67
+ placement.api = mediaTypes[VIDEO].api;
68
+ placement.linearity = mediaTypes[VIDEO].linearity;
69
+ } else if (mediaTypes && mediaTypes[NATIVE]) {
70
+ placement.native = mediaTypes[NATIVE];
71
+ placement.adFormat = NATIVE;
72
+ }
73
+
74
+ return placement;
75
+ }
76
+
77
+ function getBidFloor(bid) {
78
+ if (!isFn(bid.getFloor)) {
79
+ return deepAccess(bid, 'params.bidfloor', 0);
80
+ }
81
+
82
+ try {
83
+ const bidFloor = bid.getFloor({
84
+ currency: 'USD',
85
+ mediaType: '*',
86
+ size: '*',
87
+ });
88
+ return bidFloor.floor;
89
+ } catch (err) {
90
+ logError(err);
91
+ return 0;
92
+ }
93
+ }
94
+
95
+ export const spec = {
96
+ code: BIDDER_CODE,
97
+ supportedMediaTypes: [BANNER, VIDEO, NATIVE],
98
+
99
+ isBidRequestValid: (bid = {}) => {
100
+ const { params, bidId, mediaTypes } = bid;
101
+ let valid = Boolean(bidId && params && (params.placementId || params.endpointId));
102
+
103
+ if (mediaTypes && mediaTypes[BANNER]) {
104
+ valid = valid && Boolean(mediaTypes[BANNER] && mediaTypes[BANNER].sizes);
105
+ } else if (mediaTypes && mediaTypes[VIDEO]) {
106
+ valid = valid && Boolean(mediaTypes[VIDEO] && mediaTypes[VIDEO].playerSize);
107
+ } else if (mediaTypes && mediaTypes[NATIVE]) {
108
+ valid = valid && Boolean(mediaTypes[NATIVE]);
109
+ } else {
110
+ valid = false;
111
+ }
112
+ return valid;
113
+ },
114
+
115
+ buildRequests: (validBidRequests = [], bidderRequest = {}) => {
116
+ // convert Native ORTB definition to old-style prebid native definition
117
+ validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
118
+
119
+ let deviceWidth = 0;
120
+ let deviceHeight = 0;
121
+
122
+ let winLocation;
123
+ try {
124
+ const winTop = window.top;
125
+ deviceWidth = winTop.screen.width;
126
+ deviceHeight = winTop.screen.height;
127
+ winLocation = winTop.location;
128
+ } catch (e) {
129
+ logMessage(e);
130
+ winLocation = window.location;
131
+ }
132
+
133
+ const refferUrl = bidderRequest.refererInfo && bidderRequest.refererInfo.page;
134
+ let refferLocation;
135
+ try {
136
+ refferLocation = refferUrl && new URL(refferUrl);
137
+ } catch (e) {
138
+ logMessage(e);
139
+ }
140
+ let location = refferLocation || winLocation;
141
+ const language = (navigator && navigator.language) ? navigator.language.split('-')[0] : '';
142
+ const host = location.host;
143
+ const page = location.pathname;
144
+ const secure = location.protocol === 'https:' ? 1 : 0;
145
+ const placements = [];
146
+ const request = {
147
+ deviceWidth,
148
+ deviceHeight,
149
+ language,
150
+ secure,
151
+ host,
152
+ page,
153
+ placements,
154
+ coppa: config.getConfig('coppa') === true ? 1 : 0,
155
+ ccpa: bidderRequest.uspConsent || undefined,
156
+ gdpr: bidderRequest.gdprConsent || undefined,
157
+ tmax: config.getConfig('bidderTimeout')
158
+ };
159
+
160
+ const len = validBidRequests.length;
161
+ for (let i = 0; i < len; i++) {
162
+ const bid = validBidRequests[i];
163
+ placements.push(getPlacementReqData(bid));
164
+ }
165
+
166
+ return {
167
+ method: 'POST',
168
+ url: AD_URL,
169
+ data: request
170
+ };
171
+ },
172
+
173
+ interpretResponse: (serverResponse) => {
174
+ let response = [];
175
+ for (let i = 0; i < serverResponse.body.length; i++) {
176
+ let resItem = serverResponse.body[i];
177
+ if (isBidResponseValid(resItem)) {
178
+ const advertiserDomains = resItem.adomain && resItem.adomain.length ? resItem.adomain : [];
179
+ resItem.meta = { ...resItem.meta, advertiserDomains };
180
+
181
+ response.push(resItem);
182
+ }
183
+ }
184
+ return response;
185
+ },
186
+
187
+ getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => {
188
+ let syncType = syncOptions.iframeEnabled ? 'iframe' : 'image';
189
+ let syncUrl = SYNC_URL + `/${syncType}?pbjs=1`;
190
+ if (gdprConsent && gdprConsent.consentString) {
191
+ if (typeof gdprConsent.gdprApplies === 'boolean') {
192
+ syncUrl += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
193
+ } else {
194
+ syncUrl += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`;
195
+ }
196
+ }
197
+ if (uspConsent && uspConsent.consentString) {
198
+ syncUrl += `&ccpa_consent=${uspConsent.consentString}`;
199
+ }
200
+
201
+ const coppa = config.getConfig('coppa') ? 1 : 0;
202
+ syncUrl += `&coppa=${coppa}`;
203
+
204
+ return [{
205
+ type: syncType,
206
+ url: syncUrl
207
+ }];
208
+ }
209
+ };
210
+
211
+ registerBidder(spec);
@@ -0,0 +1,79 @@
1
+ # Overview
2
+
3
+ ```
4
+ Module Name: EMTV Bidder Adapter
5
+ Module Type: EMTV Bidder Adapter
6
+ Maintainer: support@engagemedia.tv
7
+ ```
8
+
9
+ # Description
10
+
11
+ Connects to EMTV exchange for bids.
12
+ EMTV bid adapter supports Banner, Video (instream and outstream) and Native.
13
+
14
+ # Test Parameters
15
+ ```
16
+ var adUnits = [
17
+ // Will return static test banner
18
+ {
19
+ code: 'adunit1',
20
+ mediaTypes: {
21
+ banner: {
22
+ sizes: [ [300, 250], [320, 50] ],
23
+ }
24
+ },
25
+ bids: [
26
+ {
27
+ bidder: 'emtv',
28
+ params: {
29
+ placementId: 'testBanner',
30
+ }
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ code: 'addunit2',
36
+ mediaTypes: {
37
+ video: {
38
+ playerSize: [ [640, 480] ],
39
+ context: 'instream',
40
+ minduration: 5,
41
+ maxduration: 60,
42
+ }
43
+ },
44
+ bids: [
45
+ {
46
+ bidder: 'emtv',
47
+ params: {
48
+ placementId: 'testVideo',
49
+ }
50
+ }
51
+ ]
52
+ },
53
+ {
54
+ code: 'addunit3',
55
+ mediaTypes: {
56
+ native: {
57
+ title: {
58
+ required: true
59
+ },
60
+ body: {
61
+ required: true
62
+ },
63
+ icon: {
64
+ required: true,
65
+ size: [64, 64]
66
+ }
67
+ }
68
+ },
69
+ bids: [
70
+ {
71
+ bidder: 'emtv',
72
+ params: {
73
+ placementId: 'testNative',
74
+ }
75
+ }
76
+ ]
77
+ }
78
+ ];
79
+ ```
@@ -1,4 +1,4 @@
1
- import { logWarn, isArray, isFn, deepAccess } from '../src/utils.js';
1
+ import { logWarn, isArray, isFn, deepAccess, formatQS } from '../src/utils.js';
2
2
  import { BANNER, VIDEO } from '../src/mediaTypes.js';
3
3
  import { registerBidder } from '../src/adapters/bidderFactory.js';
4
4
  import { config } from '../src/config.js';
@@ -372,6 +372,15 @@ export const spec = {
372
372
  requestParams._fw_us_privacy = bidderRequest.uspConsent;
373
373
  }
374
374
 
375
+ // Add GPP consent
376
+ if (bidderRequest && bidderRequest.gppConsent) {
377
+ requestParams.gpp = bidderRequest.gppConsent.gppString;
378
+ requestParams.gpp_sid = bidderRequest.gppConsent.applicableSections;
379
+ } else if (bidderRequest && bidderRequest.ortb2 && bidderRequest.ortb2.regs && bidderRequest.ortb2.regs.gpp) {
380
+ requestParams.gpp = bidderRequest.ortb2.regs.gpp;
381
+ requestParams.gpp_sid = bidderRequest.ortb2.regs.gpp_sid;
382
+ }
383
+
375
384
  // Add schain object
376
385
  var schain = currentBidRequest.schain;
377
386
  if (schain) {
@@ -526,26 +535,42 @@ export const spec = {
526
535
  return bidResponses;
527
536
  },
528
537
 
529
- getUserSyncs: function(syncOptions, responses, gdprConsent, usPrivacy) {
530
- var gdprParams = '';
538
+ getUserSyncs: function(syncOptions, responses, gdprConsent, usPrivacy, gppConsent) {
539
+ const params = {};
540
+
531
541
  if (gdprConsent) {
532
542
  if (typeof gdprConsent.gdprApplies === 'boolean') {
533
- gdprParams = `?gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
543
+ params.gdpr = Number(gdprConsent.gdprApplies);
544
+ params.gdpr_consent = gdprConsent.consentString;
534
545
  } else {
535
- gdprParams = `?gdpr_consent=${gdprConsent.consentString}`;
546
+ params.gdpr_consent = gdprConsent.consentString;
536
547
  }
537
548
  }
538
549
 
550
+ if (gppConsent) {
551
+ if (typeof gppConsent.gppString === 'string') {
552
+ params.gpp = gppConsent.gppString;
553
+ }
554
+ if (gppConsent.applicableSections) {
555
+ params.gpp_sid = gppConsent.applicableSections;
556
+ }
557
+ }
558
+
559
+ var queryString = '';
560
+ if (params) {
561
+ queryString = '?' + `${formatQS(params)}`;
562
+ }
563
+
539
564
  const syncs = [];
540
565
  if (syncOptions && syncOptions.pixelEnabled) {
541
566
  syncs.push({
542
567
  type: 'image',
543
- url: USER_SYNC_URL + gdprParams
568
+ url: USER_SYNC_URL + queryString
544
569
  });
545
570
  } else if (syncOptions.iframeEnabled) {
546
571
  syncs.push({
547
572
  type: 'iframe',
548
- url: USER_SYNC_URL + gdprParams
573
+ url: USER_SYNC_URL + queryString
549
574
  });
550
575
  }
551
576
 
@@ -0,0 +1,110 @@
1
+ import { logError } from '../src/utils.js';
2
+ import { ajax } from '../src/ajax.js';
3
+ import { submodule } from '../src/hook.js';
4
+
5
+ const MODULE_NAME = 'greenbidsRtdProvider';
6
+ const MODULE_VERSION = '1.0.0';
7
+ const ENDPOINT = 'https://europe-west1-greenbids-357713.cloudfunctions.net/partner-selection';
8
+
9
+ const auctionInfo = {};
10
+ const rtdOptions = {};
11
+
12
+ function init(moduleConfig) {
13
+ let params = moduleConfig?.params;
14
+ if (!params?.pbuid) {
15
+ logError('Greenbids pbuid is not set!');
16
+ return false;
17
+ } else {
18
+ rtdOptions.pbuid = params?.pbuid;
19
+ rtdOptions.targetTPR = params?.targetTPR || 0.99;
20
+ rtdOptions.timeout = params?.timeout || 200;
21
+ return true;
22
+ }
23
+ }
24
+
25
+ function onAuctionInitEvent(auctionDetails) {
26
+ auctionInfo.auctionId = auctionDetails.auctionId;
27
+ }
28
+
29
+ function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) {
30
+ let promise = createPromise(reqBidsConfigObj);
31
+ promise.then(callback);
32
+ }
33
+
34
+ function createPromise(reqBidsConfigObj) {
35
+ return new Promise((resolve) => {
36
+ const timeoutId = setTimeout(() => {
37
+ resolve(reqBidsConfigObj);
38
+ }, rtdOptions.timeout);
39
+ ajax(
40
+ ENDPOINT,
41
+ {
42
+ success: (response) => {
43
+ processSuccessResponse(response, timeoutId, reqBidsConfigObj);
44
+ resolve(reqBidsConfigObj);
45
+ },
46
+ error: () => {
47
+ clearTimeout(timeoutId);
48
+ resolve(reqBidsConfigObj);
49
+ },
50
+ },
51
+ createPayload(reqBidsConfigObj),
52
+ { contentType: 'application/json' }
53
+ );
54
+ });
55
+ }
56
+
57
+ function processSuccessResponse(response, timeoutId, reqBidsConfigObj) {
58
+ clearTimeout(timeoutId);
59
+ const responseAdUnits = JSON.parse(response);
60
+
61
+ updateAdUnitsBasedOnResponse(reqBidsConfigObj.adUnits, responseAdUnits);
62
+ }
63
+
64
+ function updateAdUnitsBasedOnResponse(adUnits, responseAdUnits) {
65
+ adUnits.forEach((adUnit) => {
66
+ const matchingAdUnit = findMatchingAdUnit(responseAdUnits, adUnit.code);
67
+ if (matchingAdUnit) {
68
+ removeFalseBidders(adUnit, matchingAdUnit);
69
+ }
70
+ });
71
+ }
72
+
73
+ function findMatchingAdUnit(responseAdUnits, adUnitCode) {
74
+ return responseAdUnits.find((responseAdUnit) => responseAdUnit.code === adUnitCode);
75
+ }
76
+
77
+ function removeFalseBidders(adUnit, matchingAdUnit) {
78
+ const falseBidders = getFalseBidders(matchingAdUnit.bidders);
79
+ adUnit.bids = adUnit.bids.filter((bidRequest) => !falseBidders.includes(bidRequest.bidder));
80
+ }
81
+
82
+ function getFalseBidders(bidders) {
83
+ return Object.entries(bidders)
84
+ .filter(([bidder, shouldKeep]) => !shouldKeep)
85
+ .map(([bidder]) => bidder);
86
+ }
87
+
88
+ function createPayload(reqBidsConfigObj) {
89
+ return JSON.stringify({
90
+ auctionId: auctionInfo.auctionId,
91
+ version: MODULE_VERSION,
92
+ referrer: window.location.href,
93
+ prebid: '$prebid.version$',
94
+ rtdOptions: rtdOptions,
95
+ adUnits: reqBidsConfigObj.adUnits,
96
+ });
97
+ }
98
+
99
+ export const greenbidsSubmodule = {
100
+ name: MODULE_NAME,
101
+ init: init,
102
+ onAuctionInitEvent: onAuctionInitEvent,
103
+ getBidRequestData: getBidRequestData,
104
+ updateAdUnitsBasedOnResponse: updateAdUnitsBasedOnResponse,
105
+ findMatchingAdUnit: findMatchingAdUnit,
106
+ removeFalseBidders: removeFalseBidders,
107
+ getFalseBidders: getFalseBidders,
108
+ };
109
+
110
+ submodule('realTimeData', greenbidsSubmodule);
@@ -0,0 +1,65 @@
1
+ # Overview
2
+
3
+ ```
4
+ Module Name: Greenbids RTD Provider
5
+ Module Type: RTD Provider
6
+ Maintainer: jb@greenbids.ai
7
+ ```
8
+
9
+ # Description
10
+
11
+ The Greenbids RTD adapter allows to dynamically filter calls to SSP to reduce outgoing call to the programmatics chain, reducing ad serving carbon impact
12
+
13
+ ## Configuration
14
+
15
+ This module is configured as part of the `realTimeData.dataProviders` object.
16
+
17
+ {: .table .table-bordered .table-striped }
18
+ | Name | Scope | Description | Example | Type |
19
+ |------------|----------|----------------------------------------|---------------|----------|
20
+ | `name ` | required | Real time data module name | `'greenbidsRtdProvider'` | `string` |
21
+ | `waitForIt ` | required (mandatory true value) | Tells prebid auction to wait for the result of this module | `'true'` | `boolean` |
22
+ | `params` | required | | | `Object` |
23
+ | `params.pbuid` | required | The client site id provided by Greenbids. | `'TEST_FROM_GREENBIDS'` | `string` |
24
+ | `params.targetTPR` | optional (default 0.95) | Target True positive rate for the throttling model | `0.99` | `[0-1]` |
25
+ | `params.timeout` | optional (default 200) | Maximum amount of milliseconds allowed for module to finish working (has to be <= to the realTimeData.auctionDelay property) | `200` | `number` |
26
+
27
+ #### Example
28
+
29
+ ```javascript
30
+ const greenbidsDataProvider = {
31
+ name: 'greenbidsRtdProvider',
32
+ waitForIt: true,
33
+ params: {
34
+ pbuid: 'TEST_FROM_GREENBIDS',
35
+ timeout: 200
36
+ }
37
+ };
38
+
39
+ pbjs.setConfig({
40
+ realTimeData: {
41
+ auctionDelay: 200,
42
+ dataProviders: [greenbidsDataProvider]
43
+ }
44
+ });
45
+ ```
46
+
47
+ ## Integration
48
+ To install the module, follow these instructions:
49
+
50
+ #### Step 1: Contact Greenbids to get a pbuid and account
51
+
52
+ #### Step 2: Integrate the Greenbids Analytics Adapter
53
+
54
+ Greenbids RTD module works hand in hand with Greenbids Analytics module
55
+ See prebid Analytics modules -> Greenbids Analytics module
56
+
57
+ #### Step 3: Prepare the base Prebid file
58
+
59
+ - Option 1: Use Prebid [Download](/download.html) page to build the prebid package. Ensure that you do check *Greenbids RTD Provider* module
60
+
61
+ - Option 2: From the command line, run `gulp build --modules=greenbidsRtdProvider,...`
62
+
63
+ #### Step 4: Set configuration
64
+
65
+ Enable Greenbids Real Time Module using `pbjs.setConfig`. Example is provided in Configuration section.
@@ -91,7 +91,6 @@ const createOpenRtbRequest = (validBidRequests, bidderRequest) => {
91
91
 
92
92
  if (bidderRequest.uspConsent) {
93
93
  deepSetValue(request, 'regs.ext.us_privacy', bidderRequest.uspConsent);
94
- this.syncStore.uspConsent = bidderRequest.uspConsent;
95
94
  }
96
95
 
97
96
  if (GETCONFIG('coppa') == true) deepSetValue(request, 'regs.coppa', 1);
@@ -1,6 +1,5 @@
1
1
  import {_each, deepAccess, getBidIdParameter, isArray} from '../src/utils.js';
2
2
  import {registerBidder} from '../src/adapters/bidderFactory.js';
3
- import {config} from '../src/config.js';
4
3
  import {BANNER, VIDEO} from '../src/mediaTypes.js';
5
4
  import {INSTREAM} from '../src/video.js';
6
5
 
@@ -155,7 +154,7 @@ export const spec = {
155
154
  auctionId: bidRequest.data.auctionId,
156
155
  mediaType: bidRequest.data.imp.mediatype,
157
156
 
158
- ttl: bid.ttl || config.getConfig('_bidderTimeout')
157
+ ttl: bid.ttl || 60
159
158
  };
160
159
 
161
160
  if (bidRequest.data.imp.mediatype === VIDEO) {
@@ -8,7 +8,7 @@ const EVENTS_DOMAIN = 'events.missena.io';
8
8
  const EVENTS_DOMAIN_DEV = 'events.staging.missena.xyz';
9
9
 
10
10
  export const spec = {
11
- aliases: [BIDDER_CODE],
11
+ aliases: ['msna'],
12
12
  code: BIDDER_CODE,
13
13
  gvlid: 687,
14
14
  supportedMediaTypes: [BANNER],
@@ -31,6 +31,7 @@ const VIDEO_PARAMS = [
31
31
  'api', 'linearity', 'maxduration', 'mimes', 'minduration', 'placement',
32
32
  'playbackmethod', 'protocols', 'startdelay'
33
33
  ];
34
+ const GVLID = 1060;
34
35
 
35
36
  const sendingDataStatistic = initSendingDataStatistic();
36
37
  events.on(CONSTANTS.EVENTS.AUCTION_INIT, auctionInitHandler);
@@ -44,6 +45,7 @@ events.on(CONSTANTS.EVENTS.BID_WON, bidWonHandler);
44
45
  export const spec = {
45
46
  code: BIDDER_CODE,
46
47
  supportedMediaTypes: [BANNER, VIDEO],
48
+ gvlid: GVLID,
47
49
 
48
50
  isBidRequestValid: function(bid) {
49
51
  return !!(
@@ -1,6 +1,5 @@
1
1
  import * as utils from '../src/utils.js';
2
2
  import {registerBidder} from '../src/adapters/bidderFactory.js';
3
- import {config} from '../src/config.js';
4
3
 
5
4
  const BIDDER_CODE = 'orbitsoft';
6
5
  let styleParamsMap = {
@@ -122,7 +121,7 @@ export const spec = {
122
121
  const HEIGHT = serverBody.height;
123
122
  const CREATIVE = serverBody.content_url;
124
123
  const CALLBACK_UID = serverBody.callback_uid;
125
- const TIME_TO_LIVE = config.getConfig('_bidderTimeout');
124
+ const TIME_TO_LIVE = 60;
126
125
  const REFERER = utils.getWindowTop();
127
126
  let bidRequest = request.bidRequest;
128
127
  if (CPM > 0 && WIDTH > 0 && HEIGHT > 0) {
@@ -1,7 +1,6 @@
1
- import { deepAccess } from '../src/utils.js';
2
- import {config} from '../src/config.js';
1
+ import {deepAccess} from '../src/utils.js';
3
2
  import {registerBidder} from '../src/adapters/bidderFactory.js';
4
- import { BANNER, VIDEO } from '../src/mediaTypes.js';
3
+ import {BANNER, VIDEO} from '../src/mediaTypes.js';
5
4
 
6
5
  const BIDDER_CODE = 'rads';
7
6
  const ENDPOINT_URL = 'https://rads.recognified.net/md.request.php';
@@ -86,7 +85,7 @@ export const spec = {
86
85
  dealId: dealId,
87
86
  currency: currency,
88
87
  netRevenue: netRevenue,
89
- ttl: config.getConfig('_bidderTimeout'),
88
+ ttl: 60,
90
89
  meta: {
91
90
  advertiserDomains: response.adomain || []
92
91
  }