prebid.js 8.6.0 → 8.8.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 (222) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/a1MediaRtdProvider.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/adqueryBidAdapter.js +1 -1
  9. package/dist/adqueryIdSystem.js +1 -1
  10. package/dist/adrelevantisBidAdapter.js +1 -1
  11. package/dist/adsinteractiveBidAdapter.js +1 -1
  12. package/dist/adtrgtmeBidAdapter.js +1 -1
  13. package/dist/adxcgBidAdapter.js +1 -1
  14. package/dist/adyoulikeBidAdapter.js +1 -1
  15. package/dist/ajaBidAdapter.js +1 -1
  16. package/dist/alkimiBidAdapter.js +1 -1
  17. package/dist/amxBidAdapter.js +1 -1
  18. package/dist/amxIdSystem.js +1 -1
  19. package/dist/appierAnalyticsAdapter.js +1 -1
  20. package/dist/appnexusBidAdapter.js +1 -1
  21. package/dist/asoBidAdapter.js +1 -1
  22. package/dist/automatadAnalyticsAdapter.js +1 -0
  23. package/dist/axonixBidAdapter.js +1 -1
  24. package/dist/bidViewability.js +1 -1
  25. package/dist/bidglassBidAdapter.js +1 -1
  26. package/dist/big-richmediaBidAdapter.js +1 -1
  27. package/dist/brandmetricsRtdProvider.js +1 -1
  28. package/dist/bridBidAdapter.js +1 -1
  29. package/dist/bridgewellBidAdapter.js +1 -1
  30. package/dist/brightMountainMediaBidAdapter.js +1 -1
  31. package/dist/carodaBidAdapter.js +1 -1
  32. package/dist/chtnwBidAdapter.js +1 -1
  33. package/dist/concertBidAdapter.js +1 -1
  34. package/dist/connatixBidAdapter.js +1 -0
  35. package/dist/connectadBidAdapter.js +1 -1
  36. package/dist/consumableBidAdapter.js +1 -1
  37. package/dist/conversantAnalyticsAdapter.js +1 -1
  38. package/dist/conversantBidAdapter.js +1 -1
  39. package/dist/craftBidAdapter.js +1 -1
  40. package/dist/criteoBidAdapter.js +1 -1
  41. package/dist/cwireBidAdapter.js +1 -1
  42. package/dist/dependencies.json +7 -1
  43. package/dist/dspxBidAdapter.js +1 -1
  44. package/dist/eplanningBidAdapter.js +1 -1
  45. package/dist/euidIdSystem.js +1 -1
  46. package/dist/feedadBidAdapter.js +1 -1
  47. package/dist/finativeBidAdapter.js +1 -1
  48. package/dist/freepassBidAdapter.js +1 -1
  49. package/dist/freewheel-sspBidAdapter.js +1 -1
  50. package/dist/geoedgeRtdProvider.js +1 -1
  51. package/dist/gmosspBidAdapter.js +1 -1
  52. package/dist/goldbachBidAdapter.js +1 -1
  53. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  54. package/dist/greenbidsRtdProvider.js +1 -1
  55. package/dist/gridBidAdapter.js +1 -1
  56. package/dist/gumgumBidAdapter.js +1 -1
  57. package/dist/h12mediaBidAdapter.js +1 -1
  58. package/dist/hypelabBidAdapter.js +1 -1
  59. package/dist/id5IdSystem.js +1 -1
  60. package/dist/imdsBidAdapter.js +1 -1
  61. package/dist/improvedigitalBidAdapter.js +1 -1
  62. package/dist/insticatorBidAdapter.js +1 -1
  63. package/dist/ixBidAdapter.js +1 -1
  64. package/dist/justpremiumBidAdapter.js +1 -1
  65. package/dist/kargoBidAdapter.js +1 -1
  66. package/dist/konduitAnalyticsAdapter.js +1 -1
  67. package/dist/kueezBidAdapter.js +1 -1
  68. package/dist/kueezRtbBidAdapter.js +1 -1
  69. package/dist/kulturemediaBidAdapter.js +1 -1
  70. package/dist/lassoBidAdapter.js +1 -1
  71. package/dist/lifestreetBidAdapter.js +1 -1
  72. package/dist/liveIntentIdSystem.js +1 -1
  73. package/dist/logicadBidAdapter.js +1 -1
  74. package/dist/loglyliftBidAdapter.js +1 -1
  75. package/dist/magniteAnalyticsAdapter.js +1 -1
  76. package/dist/malltvAnalyticsAdapter.js +1 -1
  77. package/dist/marsmediaBidAdapter.js +1 -1
  78. package/dist/mediafuseBidAdapter.js +1 -1
  79. package/dist/medianetBidAdapter.js +1 -1
  80. package/dist/mediasquareBidAdapter.js +1 -1
  81. package/dist/mgidBidAdapter.js +1 -1
  82. package/dist/minutemediaBidAdapter.js +1 -1
  83. package/dist/minutemediaplusBidAdapter.js +1 -1
  84. package/dist/nativoBidAdapter.js +1 -1
  85. package/dist/nexx360BidAdapter.js +1 -1
  86. package/dist/not-for-prod/prebid.js +145 -142
  87. package/dist/oguryBidAdapter.js +1 -1
  88. package/dist/onetagBidAdapter.js +1 -1
  89. package/dist/ooloAnalyticsAdapter.js +1 -1
  90. package/dist/operaadsBidAdapter.js +1 -1
  91. package/dist/operaadsIdSystem.js +1 -0
  92. package/dist/optidigitalBidAdapter.js +1 -1
  93. package/dist/outbrainBidAdapter.js +1 -1
  94. package/dist/oxxionAnalyticsAdapter.js +1 -1
  95. package/dist/parrableIdSystem.js +1 -1
  96. package/dist/pixfutureBidAdapter.js +1 -1
  97. package/dist/prebid-core.js +1 -1
  98. package/dist/publinkIdSystem.js +1 -1
  99. package/dist/pubmaticBidAdapter.js +1 -1
  100. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  101. package/dist/pxyzBidAdapter.js +1 -1
  102. package/dist/quantcastBidAdapter.js +1 -1
  103. package/dist/readpeakBidAdapter.js +1 -1
  104. package/dist/relaidoBidAdapter.js +1 -1
  105. package/dist/retailspotBidAdapter.js +1 -1
  106. package/dist/rhythmoneBidAdapter.js +1 -1
  107. package/dist/riseBidAdapter.js +1 -1
  108. package/dist/rubiconBidAdapter.js +1 -1
  109. package/dist/seedingAllianceBidAdapter.js +1 -1
  110. package/dist/seedtagBidAdapter.js +1 -1
  111. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  112. package/dist/sharethroughBidAdapter.js +1 -1
  113. package/dist/shinezBidAdapter.js +1 -1
  114. package/dist/smaatoBidAdapter.js +1 -1
  115. package/dist/smartadserverBidAdapter.js +1 -1
  116. package/dist/smartxBidAdapter.js +1 -1
  117. package/dist/smartyadsBidAdapter.js +1 -1
  118. package/dist/smilewantedBidAdapter.js +1 -1
  119. package/dist/snigelBidAdapter.js +1 -1
  120. package/dist/sonobiBidAdapter.js +1 -1
  121. package/dist/sovrnAnalyticsAdapter.js +1 -1
  122. package/dist/sovrnBidAdapter.js +1 -1
  123. package/dist/sspBCBidAdapter.js +1 -1
  124. package/dist/stvBidAdapter.js +1 -1
  125. package/dist/sublimeBidAdapter.js +1 -1
  126. package/dist/tappxBidAdapter.js +1 -1
  127. package/dist/targetVideoBidAdapter.js +1 -1
  128. package/dist/teadsBidAdapter.js +1 -1
  129. package/dist/topicsFpdModule.js +1 -1
  130. package/dist/trionBidAdapter.js +1 -1
  131. package/dist/tripleliftBidAdapter.js +1 -1
  132. package/dist/ttdBidAdapter.js +1 -1
  133. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  134. package/dist/uid2IdSystem.js +1 -1
  135. package/dist/underdogmediaBidAdapter.js +1 -1
  136. package/dist/undertoneBidAdapter.js +1 -1
  137. package/dist/vidazooBidAdapter.js +1 -1
  138. package/dist/videobyteBidAdapter.js +1 -1
  139. package/dist/visxBidAdapter.js +1 -1
  140. package/dist/vuukleBidAdapter.js +1 -1
  141. package/dist/widespaceBidAdapter.js +1 -1
  142. package/dist/winrBidAdapter.js +1 -1
  143. package/dist/yahoosspBidAdapter.js +1 -1
  144. package/dist/yieldmoBidAdapter.js +1 -1
  145. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  146. package/integrationExamples/topics/topics-server.js +72 -0
  147. package/modules/.submodules.json +2 -1
  148. package/modules/a1MediaRtdProvider.js +1 -1
  149. package/modules/adagioBidAdapter.js +15 -1
  150. package/modules/adgenerationBidAdapter.js +4 -3
  151. package/modules/admaticBidAdapter.js +5 -0
  152. package/modules/adqueryBidAdapter.js +23 -21
  153. package/modules/adqueryIdSystem.js +45 -30
  154. package/modules/adrelevantisBidAdapter.js +2 -0
  155. package/modules/adsinteractiveBidAdapter.js +2 -0
  156. package/modules/alkimiBidAdapter.js +19 -7
  157. package/modules/automatadAnalyticsAdapter.js +325 -0
  158. package/modules/automatadAnalyticsAdapter.md +23 -0
  159. package/modules/bidViewability.js +7 -0
  160. package/modules/bidViewability.md +9 -8
  161. package/modules/brandmetricsRtdProvider.js +30 -27
  162. package/modules/connatixBidAdapter.js +185 -0
  163. package/modules/connatixBidAdapter.md +37 -0
  164. package/modules/criteoBidAdapter.js +73 -50
  165. package/modules/freepassBidAdapter.js +20 -1
  166. package/modules/freepassBidAdapter.md +4 -1
  167. package/modules/geoedgeRtdProvider.js +43 -13
  168. package/modules/geoedgeRtdProvider.md +2 -1
  169. package/modules/gridBidAdapter.js +1 -8
  170. package/modules/liveIntentIdSystem.js +16 -1
  171. package/modules/medianetBidAdapter.js +7 -4
  172. package/modules/mediasquareBidAdapter.js +3 -0
  173. package/modules/nativoBidAdapter.js +21 -3
  174. package/modules/onetagBidAdapter.js +3 -0
  175. package/modules/operaadsBidAdapter.js +5 -0
  176. package/modules/operaadsBidAdapter.md +5 -5
  177. package/modules/operaadsIdSystem.js +106 -0
  178. package/modules/operaadsIdSystem.md +52 -0
  179. package/modules/optidigitalBidAdapter.js +25 -16
  180. package/modules/oxxionAnalyticsAdapter.js +22 -5
  181. package/modules/rubiconBidAdapter.js +2 -2
  182. package/modules/smartyadsBidAdapter.js +18 -1
  183. package/modules/snigelBidAdapter.js +69 -16
  184. package/modules/snigelBidAdapter.md +9 -3
  185. package/modules/tappxBidAdapter.js +17 -14
  186. package/modules/topicsFpdModule.js +35 -9
  187. package/modules/undertoneBidAdapter.md +1 -1
  188. package/modules/userId/eids.md +7 -0
  189. package/modules/visxBidAdapter.js +51 -1
  190. package/package.json +2 -2
  191. package/src/adloader.js +1 -0
  192. package/src/native.js +2 -2
  193. package/test/spec/modules/adagioBidAdapter_spec.js +89 -0
  194. package/test/spec/modules/adgenerationBidAdapter_spec.js +6 -6
  195. package/test/spec/modules/admaticBidAdapter_spec.js +5 -0
  196. package/test/spec/modules/adqueryIdSystem_spec.js +13 -24
  197. package/test/spec/modules/alkimiBidAdapter_spec.js +3 -9
  198. package/test/spec/modules/automatadAnalyticsAdapter_spec.js +533 -0
  199. package/test/spec/modules/bidViewability_spec.js +32 -1
  200. package/test/spec/modules/brandmetricsRtdProvider_spec.js +6 -0
  201. package/test/spec/modules/connatixBidAdapter_spec.js +366 -0
  202. package/test/spec/modules/criteoBidAdapter_spec.js +249 -0
  203. package/test/spec/modules/eids_spec.js +48 -0
  204. package/test/spec/modules/freepassBidAdapter_spec.js +44 -0
  205. package/test/spec/modules/geoedgeRtdProvider_spec.js +44 -24
  206. package/test/spec/modules/gridBidAdapter_spec.js +68 -0
  207. package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +5 -0
  208. package/test/spec/modules/liveIntentIdSystem_spec.js +5 -0
  209. package/test/spec/modules/medianetBidAdapter_spec.js +18 -18
  210. package/test/spec/modules/mediasquareBidAdapter_spec.js +5 -0
  211. package/test/spec/modules/nativoBidAdapter_spec.js +6 -1
  212. package/test/spec/modules/onetagBidAdapter_spec.js +69 -0
  213. package/test/spec/modules/operaadsIdSystem_spec.js +53 -0
  214. package/test/spec/modules/optidigitalBidAdapter_spec.js +9 -2
  215. package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +6 -1
  216. package/test/spec/modules/rubiconBidAdapter_spec.js +24 -0
  217. package/test/spec/modules/smartyadsBidAdapter_spec.js +49 -0
  218. package/test/spec/modules/snigelBidAdapter_spec.js +57 -6
  219. package/test/spec/modules/tappxBidAdapter_spec.js +19 -0
  220. package/test/spec/modules/topicsFpdModule_spec.js +102 -1
  221. package/test/spec/modules/visxBidAdapter_spec.js +151 -1
  222. package/test/spec/native_spec.js +5 -3
@@ -0,0 +1,37 @@
1
+
2
+ # Overview
3
+
4
+ ```
5
+ Module Name: Connatix Bidder Adapter
6
+ Module Type: Bidder Adapter
7
+ Maintainer: prebid_integration@connatix.com
8
+ ```
9
+
10
+ # Description
11
+ Connects to Connatix demand source to fetch bids.
12
+ Please use ```connatix``` as the bidder code.
13
+
14
+ # Test Parameters
15
+ ```
16
+ var adUnits = [
17
+ {
18
+ code: '1',
19
+ mediaTypes: {
20
+ banner: {
21
+ sizes: [[640, 480], [320, 180]],
22
+ },
23
+ },
24
+ bids: [
25
+ {
26
+ bidder: 'connatix',
27
+ params: {
28
+ placementId: 'e4984e88-9ff4-45a3-8b9d-33aabcad634e', // required
29
+ bidfloor: 2.5, // optional
30
+ },
31
+ },
32
+ // Add more bidders and their parameters as needed
33
+ ],
34
+ },
35
+ // Define more ad units here if necessary
36
+ ];
37
+ ```
@@ -3,7 +3,6 @@ import { loadExternalScript } from '../src/adloader.js';
3
3
  import { registerBidder } from '../src/adapters/bidderFactory.js';
4
4
  import { config } from '../src/config.js';
5
5
  import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
6
- import { find } from '../src/polyfill.js';
7
6
  import { verify } from 'criteo-direct-rsa-validate/build/verify.js'; // ref#2
8
7
  import { getStorageManager } from '../src/storageManager.js';
9
8
  import { getRefererInfo } from '../src/refererDetection.js';
@@ -29,7 +28,7 @@ const LOG_PREFIX = 'Criteo: ';
29
28
  Unminified source code can be found in the privately shared repo: https://github.com/Prebid-org/prebid-js-external-js-criteo/blob/master/dist/prod.js
30
29
  */
31
30
  const FAST_BID_VERSION_PLACEHOLDER = '%FAST_BID_VERSION%';
32
- export const FAST_BID_VERSION_CURRENT = 136;
31
+ export const FAST_BID_VERSION_CURRENT = 139;
33
32
  const FAST_BID_VERSION_LATEST = 'latest';
34
33
  const FAST_BID_VERSION_NONE = 'none';
35
34
  const PUBLISHER_TAG_URL_TEMPLATE = 'https://static.criteo.net/js/ld/publishertag.prebid' + FAST_BID_VERSION_PLACEHOLDER + '.js';
@@ -219,51 +218,53 @@ export const spec = {
219
218
 
220
219
  if (body && body.slots && isArray(body.slots)) {
221
220
  body.slots.forEach(slot => {
222
- const bidRequest = find(request.bidRequests, b => b.adUnitCode === slot.impid && (!b.params.zoneId || parseInt(b.params.zoneId) === slot.zoneid));
223
- const bidId = bidRequest.bidId;
224
- const bid = {
225
- requestId: bidId,
226
- cpm: slot.cpm,
227
- currency: slot.currency,
228
- netRevenue: true,
229
- ttl: slot.ttl || 60,
230
- creativeId: slot.creativecode,
231
- width: slot.width,
232
- height: slot.height,
233
- dealId: slot.deal,
234
- };
235
- if (body.ext?.paf?.transmission && slot.ext?.paf?.content_id) {
236
- const pafResponseMeta = {
237
- content_id: slot.ext.paf.content_id,
238
- transmission: response.ext.paf.transmission
221
+ const bidRequest = getAssociatedBidRequest(request.bidRequests, slot);
222
+ if (bidRequest) {
223
+ const bidId = bidRequest.bidId;
224
+ const bid = {
225
+ requestId: bidId,
226
+ cpm: slot.cpm,
227
+ currency: slot.currency,
228
+ netRevenue: true,
229
+ ttl: slot.ttl || 60,
230
+ creativeId: slot.creativecode,
231
+ width: slot.width,
232
+ height: slot.height,
233
+ dealId: slot.deal,
239
234
  };
240
- bid.meta = Object.assign({}, bid.meta, { paf: pafResponseMeta });
241
- }
242
- if (slot.adomain) {
243
- bid.meta = Object.assign({}, bid.meta, { advertiserDomains: [slot.adomain].flat() });
244
- }
245
- if (slot.ext?.meta?.networkName) {
246
- bid.meta = Object.assign({}, bid.meta, { networkName: slot.ext.meta.networkName })
247
- }
248
- if (slot.native) {
249
- if (bidRequest.params.nativeCallback) {
250
- bid.ad = createNativeAd(bidId, slot.native, bidRequest.params.nativeCallback);
251
- } else {
252
- bid.native = createPrebidNativeAd(slot.native);
253
- bid.mediaType = NATIVE;
235
+ if (body.ext?.paf?.transmission && slot.ext?.paf?.content_id) {
236
+ const pafResponseMeta = {
237
+ content_id: slot.ext.paf.content_id,
238
+ transmission: response.ext.paf.transmission
239
+ };
240
+ bid.meta = Object.assign({}, bid.meta, { paf: pafResponseMeta });
254
241
  }
255
- } else if (slot.video) {
256
- bid.vastUrl = slot.displayurl;
257
- bid.mediaType = VIDEO;
258
- const context = deepAccess(bidRequest, 'mediaTypes.video.context');
259
- // if outstream video, add a default render for it.
260
- if (context === OUTSTREAM) {
261
- bid.renderer = createOutstreamVideoRenderer(slot);
242
+ if (slot.adomain) {
243
+ bid.meta = Object.assign({}, bid.meta, { advertiserDomains: [slot.adomain].flat() });
262
244
  }
263
- } else {
264
- bid.ad = slot.creative;
245
+ if (slot.ext?.meta?.networkName) {
246
+ bid.meta = Object.assign({}, bid.meta, { networkName: slot.ext.meta.networkName })
247
+ }
248
+ if (slot.native) {
249
+ if (bidRequest.params.nativeCallback) {
250
+ bid.ad = createNativeAd(bidId, slot.native, bidRequest.params.nativeCallback);
251
+ } else {
252
+ bid.native = createPrebidNativeAd(slot.native);
253
+ bid.mediaType = NATIVE;
254
+ }
255
+ } else if (slot.video) {
256
+ bid.vastUrl = slot.displayurl;
257
+ bid.mediaType = VIDEO;
258
+ const context = deepAccess(bidRequest, 'mediaTypes.video.context');
259
+ // if outstream video, add a default render for it.
260
+ if (context === OUTSTREAM) {
261
+ bid.renderer = createOutstreamVideoRenderer(slot);
262
+ }
263
+ } else {
264
+ bid.ad = slot.creative;
265
+ }
266
+ bids.push(bid);
265
267
  }
266
- bids.push(bid);
267
268
  });
268
269
  }
269
270
 
@@ -315,14 +316,14 @@ export const spec = {
315
316
  const id = readFromAllStorages(BUNDLE_COOKIE_NAME);
316
317
  if (id) {
317
318
  deleteFromAllStorages(BUNDLE_COOKIE_NAME);
319
+ ajax('https://privacy.criteo.com/api/privacy/datadeletionrequest',
320
+ null,
321
+ JSON.stringify({ publisherUserId: id }),
322
+ {
323
+ contentType: 'application/json',
324
+ method: 'POST'
325
+ });
318
326
  }
319
- ajax('https://privacy.criteo.com/api/privacy/datadeletionrequest',
320
- null,
321
- JSON.stringify({ publisherUserId: id }),
322
- {
323
- contentType: 'application/json',
324
- method: 'POST'
325
- });
326
327
  }
327
328
  };
328
329
 
@@ -462,6 +463,7 @@ function buildCdbRequest(context, bidRequests, bidderRequest) {
462
463
  networkId = bidRequest.params.networkId || networkId;
463
464
  schain = bidRequest.schain || schain;
464
465
  const slot = {
466
+ slotid: bidRequest.bidId,
465
467
  impid: bidRequest.adUnitCode,
466
468
  transactionid: bidRequest.ortb2Imp?.ext?.tid
467
469
  };
@@ -786,6 +788,27 @@ function createOutstreamVideoRenderer(slot) {
786
788
  return renderer;
787
789
  }
788
790
 
791
+ function getAssociatedBidRequest(bidRequests, slot) {
792
+ for (const request of bidRequests) {
793
+ if (request.adUnitCode === slot.impid) {
794
+ if (request.params.zoneId && parseInt(request.params.zoneId) === slot.zoneid) {
795
+ return request;
796
+ } else if (slot.native) {
797
+ if (request.mediaTypes?.native || request.nativeParams) {
798
+ return request;
799
+ }
800
+ } else if (slot.video) {
801
+ if (request.mediaTypes?.video) {
802
+ return request;
803
+ }
804
+ } else if (request.mediaTypes?.banner || request.sizes) {
805
+ return request;
806
+ }
807
+ }
808
+ }
809
+ return undefined;
810
+ }
811
+
789
812
  export function tryGetCriteoFastBid() {
790
813
  // begin ref#1
791
814
  try {
@@ -48,7 +48,7 @@ export const spec = {
48
48
 
49
49
  isBidRequestValid(bid) {
50
50
  logMessage('Validating bid: ', bid);
51
- return !!bid.adUnitCode;
51
+ return !(!bid.adUnitCode || !bid.params || !bid.params.publisherId);
52
52
  },
53
53
 
54
54
  buildRequests(validBidRequests, bidderRequest) {
@@ -72,6 +72,25 @@ export const spec = {
72
72
  data.user = prepareUserInfo(data.user, freepassId);
73
73
  data.device = prepareDeviceInfo(data.device, freepassId);
74
74
 
75
+ // set site.page & site.publisher
76
+ data.site = data.site || {};
77
+ data.site.publisher = data.site.publisher || {};
78
+ // set site.publisher.id. from params.publisherId required
79
+ data.site.publisher.id = validBidRequests[0].params.publisherId;
80
+ // set site.publisher.domain from params.publisherUrl. optional
81
+ data.site.publisher.domain = validBidRequests[0].params?.publisherUrl;
82
+
83
+ // set source
84
+ data.source = data.source || {};
85
+ data.source.fd = 0;
86
+ data.source.tid = validBidRequests.ortb2?.source?.tid;
87
+ data.source.pchain = '';
88
+
89
+ // set imp.ext
90
+ validBidRequests.forEach((bidRequest, index) => {
91
+ data.imp[index].tagId = bidRequest.adUnitCode;
92
+ });
93
+
75
94
  data.test = validBidRequests[0].test || 0;
76
95
 
77
96
  logMessage('FreePass BidAdapter augmented ORTB bid request user: ', data.user);
@@ -23,7 +23,10 @@ This BidAdapter requires the FreePass IdSystem to be configured. Please contact
23
23
  }
24
24
  },
25
25
  bids: [{
26
- bidder: 'freepass'
26
+ bidder: 'freepass',
27
+ params: {
28
+ publisherId: '12345'
29
+ }
27
30
  }]
28
31
  }
29
32
  ];
@@ -20,6 +20,8 @@ import { ajax } from '../src/ajax.js';
20
20
  import { generateUUID, insertElement, isEmpty, logError } from '../src/utils.js';
21
21
  import * as events from '../src/events.js';
22
22
  import CONSTANTS from '../src/constants.json';
23
+ import { loadExternalScript } from '../src/adloader.js';
24
+ import { auctionManager } from '../src/auctionManager.js';
23
25
 
24
26
  /** @type {string} */
25
27
  const SUBMODULE_NAME = 'geoedge';
@@ -33,9 +35,13 @@ const PV_ID = generateUUID();
33
35
  /** @type {string} */
34
36
  const HOST_NAME = 'https://rumcdn.geoedge.be';
35
37
  /** @type {string} */
36
- const FILE_NAME = 'grumi.js';
38
+ const FILE_NAME_CLIENT = 'grumi.js';
39
+ /** @type {string} */
40
+ const FILE_NAME_INPAGE = 'grumi-ip.js';
41
+ /** @type {function} */
42
+ export let getClientUrl = (key) => `${HOST_NAME}/${key}/${FILE_NAME_CLIENT}`;
37
43
  /** @type {function} */
38
- export let getClientUrl = (key) => `${HOST_NAME}/${key}/${FILE_NAME}`;
44
+ export let getInPageUrl = (key) => `${HOST_NAME}/${key}/${FILE_NAME_INPAGE}`;
39
45
  /** @type {string} */
40
46
  export let wrapper
41
47
  /** @type {boolean} */;
@@ -177,7 +183,8 @@ function isSupportedBidder(bidder, paramsBidders) {
177
183
  function shouldWrap(bid, params) {
178
184
  let supportedBidder = isSupportedBidder(bid.bidderCode, params.bidders);
179
185
  let donePreload = params.wap ? preloaded : true;
180
- return wrapperReady && supportedBidder && donePreload;
186
+ let isGPT = params.gpt;
187
+ return wrapperReady && supportedBidder && donePreload && !isGPT;
181
188
  }
182
189
 
183
190
  function conditionallyWrap(bidResponse, config, userConsent) {
@@ -187,31 +194,55 @@ function conditionallyWrap(bidResponse, config, userConsent) {
187
194
  }
188
195
  }
189
196
 
197
+ function isBillingMessage(data, params) {
198
+ return data.key === params.key && data.impression;
199
+ }
200
+
190
201
  /**
191
- * Fire billable events for applicable bids
202
+ * Fire billable events when our client sends a message
203
+ * Messages will be sent only when:
204
+ * a. applicable bids are wrapped
205
+ * b. our code laoded and executed sucesfully
192
206
  */
193
207
  function fireBillableEventsForApplicableBids(params) {
194
- events.on(CONSTANTS.EVENTS.BID_WON, function (winningBid) {
195
- if (shouldWrap(winningBid, params)) {
208
+ window.addEventListener('message', function (message) {
209
+ let data = message.data;
210
+ if (isBillingMessage(data, params)) {
211
+ let winningBid = auctionManager.findBidByAdId(data.adId);
196
212
  events.emit(CONSTANTS.EVENTS.BILLABLE_EVENT, {
197
213
  vendor: SUBMODULE_NAME,
198
- billingId: generateUUID(),
199
- type: 'impression',
200
- transactionId: winningBid.transactionId,
201
- auctionId: winningBid.auctionId,
202
- bidId: winningBid.requestId
214
+ billingId: data.impressionId,
215
+ type: winningBid ? 'impression' : data.type,
216
+ transactionId: winningBid?.transactionId || data.transactionId,
217
+ auctionId: winningBid?.auctionId || data.auctionId,
218
+ bidId: winningBid?.requestId || data.requestId
203
219
  });
204
220
  }
205
221
  });
206
222
  }
207
223
 
224
+ /**
225
+ * Loads Geoedge in page script that monitors all ad slots created by GPT
226
+ * @param {Object} params
227
+ */
228
+ function setupInPage(params) {
229
+ window.grumi = params;
230
+ window.grumi.fromPrebid = true;
231
+ loadExternalScript(getInPageUrl(params.key), SUBMODULE_NAME);
232
+ }
233
+
208
234
  function init(config, userConsent) {
209
235
  let params = config.params;
210
236
  if (!params || !params.key) {
211
237
  logError('missing key for geoedge RTD module provider');
212
238
  return false;
213
239
  }
214
- preloadClient(params.key);
240
+ if (params.gpt) {
241
+ setupInPage(params);
242
+ } else {
243
+ fetchWrapper(setWrapper);
244
+ preloadClient(params.key);
245
+ }
215
246
  fireBillableEventsForApplicableBids(params);
216
247
  return true;
217
248
  }
@@ -228,7 +259,6 @@ export const geoedgeSubmodule = {
228
259
  };
229
260
 
230
261
  export function beforeInit() {
231
- fetchWrapper(setWrapper);
232
262
  submodule('realTimeData', geoedgeSubmodule);
233
263
  }
234
264
 
@@ -5,7 +5,7 @@ Module Type: Rtd Provider
5
5
  Maintainer: guy.books@geoedge.com
6
6
 
7
7
  The Geoedge Realtime module lets publishers block bad ads such as automatic redirects, malware, offensive creatives and landing pages.
8
- To use this module, you'll need to work with [Geoedge](https://www.geoedge.com/publishers-real-time-protection/) to get an account and cutomer key.
8
+ To use this module, you'll need to work with [Geoedge](https://www.geoedge.com/publishers-real-time-protection/) to get an account and customer key.
9
9
 
10
10
  ## Integration
11
11
 
@@ -49,6 +49,7 @@ Parameters details:
49
49
  |params.key | String | Customer key |Required, contact Geoedge to get your key |
50
50
  |params.bidders | Object | Bidders to monitor |Optional, list of bidder to include / exclude from monitoring. Omitting this will monitor bids from all bidders. |
51
51
  |params.wap |Boolean |Wrap after preload |Optional, defaults to `false`. Set to `true` if you want to monitor only after the module has preloaded the monitoring client. |
52
+ |params.gpt |Boolean |Wrap all GPT ad slots |Optional, defaults to `false`. Set to `true` if you want to monitor all Google Publisher Tag ad slots, regaedless if the winning bid comes from Prebid or Google Ad Manager (Direct, Adx, Adesnse, Open Bidding, etc). |
52
53
 
53
54
  ## Example
54
55
 
@@ -137,16 +137,9 @@ export const spec = {
137
137
  }
138
138
 
139
139
  if (ortb2Imp.ext) {
140
+ impObj.ext.gpid = ortb2Imp.ext.gpid?.toString() || ortb2Imp.ext.data?.pbadslot?.toString() || ortb2Imp.ext.data?.adserver?.adslot?.toString();
140
141
  if (ortb2Imp.ext.data) {
141
142
  impObj.ext.data = ortb2Imp.ext.data;
142
- if (impObj.ext.data.adserver && impObj.ext.data.adserver.adslot) {
143
- impObj.ext.gpid = impObj.ext.data.adserver.adslot.toString();
144
- } else if (ortb2Imp.ext.data.pbadslot) {
145
- impObj.ext.gpid = ortb2Imp.ext.data.pbadslot.toString();
146
- }
147
- }
148
- if (ortb2Imp.ext.gpid) {
149
- impObj.ext.gpid = ortb2Imp.ext.gpid.toString();
150
143
  }
151
144
  }
152
145
  }
@@ -205,6 +205,10 @@ export const liveIntentIdSubmodule = {
205
205
  result.magnite = { 'id': value.magnite, ext: { provider: LI_PROVIDER_DOMAIN } }
206
206
  }
207
207
 
208
+ if (value.index) {
209
+ result.index = { 'id': value.index, ext: { provider: LI_PROVIDER_DOMAIN } }
210
+ }
211
+
208
212
  return result
209
213
  }
210
214
 
@@ -294,7 +298,18 @@ export const liveIntentIdSubmodule = {
294
298
  }
295
299
  }
296
300
  },
297
-
301
+ 'index': {
302
+ source: 'liveintent.indexexchange.com',
303
+ atype: 3,
304
+ getValue: function(data) {
305
+ return data.id;
306
+ },
307
+ getUidExt: function(data) {
308
+ if (data.ext) {
309
+ return data.ext;
310
+ }
311
+ }
312
+ }
298
313
  }
299
314
  };
300
315
 
@@ -20,7 +20,9 @@ import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
20
20
  import {getGlobal} from '../src/prebidGlobal.js';
21
21
 
22
22
  const BIDDER_CODE = 'medianet';
23
+ const TRUSTEDSTACK_CODE = 'trustedstack';
23
24
  const BID_URL = 'https://prebid.media.net/rtb/prebid';
25
+ const TRUSTEDSTACK_URL = 'https://prebid.trustedstack.com/rtb/trustedstack';
24
26
  const PLAYER_URL = 'https://prebid.media.net/video/bundle.js';
25
27
  const SLOT_VISIBILITY = {
26
28
  NOT_DETERMINED: 0,
@@ -49,7 +51,7 @@ mnData.urlData = {
49
51
  };
50
52
 
51
53
  const aliases = [
52
- { code: 'aax', gvlid: 720 },
54
+ { code: TRUSTEDSTACK_CODE },
53
55
  ];
54
56
 
55
57
  getGlobal().medianetGlobals = getGlobal().medianetGlobals || {};
@@ -323,8 +325,9 @@ function normalizeCoordinates(coordinates) {
323
325
  }
324
326
  }
325
327
 
326
- function getBidderURL(cid) {
327
- return BID_URL + '?cid=' + encodeURIComponent(cid);
328
+ function getBidderURL(bidderCode, cid) {
329
+ const url = (bidderCode === TRUSTEDSTACK_CODE) ? TRUSTEDSTACK_URL : BID_URL;
330
+ return url + '?cid=' + encodeURIComponent(cid);
328
331
  }
329
332
 
330
333
  function generatePayload(bidRequests, bidderRequests) {
@@ -463,7 +466,7 @@ export const spec = {
463
466
  let payload = generatePayload(bidRequests, bidderRequests);
464
467
  return {
465
468
  method: 'POST',
466
- url: getBidderURL(payload.ext.customer_id),
469
+ url: getBidderURL(bidderRequests.bidderCode, payload.ext.customer_id),
467
470
  data: JSON.stringify(payload)
468
471
  };
469
472
  },
@@ -179,6 +179,9 @@ export const spec = {
179
179
  paramsToSearchFor.forEach(param => {
180
180
  if (bid['mediasquare'].hasOwnProperty(param)) {
181
181
  params[param] = bid['mediasquare'][param];
182
+ if (typeof params[param] == 'number') {
183
+ params[param] = params[param].toString();
184
+ }
182
185
  }
183
186
  });
184
187
  };
@@ -2,7 +2,20 @@ import { deepAccess, isEmpty } from '../src/utils.js'
2
2
  import { registerBidder } from '../src/adapters/bidderFactory.js'
3
3
  import { BANNER } from '../src/mediaTypes.js'
4
4
  import { getGlobal } from '../src/prebidGlobal.js'
5
- // import { config } from 'src/config'
5
+ import { ortbConverter } from '../libraries/ortbConverter/converter.js'
6
+
7
+ const converter = ortbConverter({
8
+ context: {
9
+ // `netRevenue` and `ttl` are required properties of bid responses - provide a default for them
10
+ netRevenue: true, // or false if your adapter should set bidResponse.netRevenue = false
11
+ ttl: 30 // default bidResponse.ttl (when not specified in ORTB response.seatbid[].bid[].exp)
12
+ },
13
+ imp(buildImp, bidRequest, context) {
14
+ const imp = buildImp(bidRequest, context);
15
+ imp.tagid = bidRequest.adUnitCode
16
+ return imp;
17
+ }
18
+ });
6
19
 
7
20
  const BIDDER_CODE = 'nativo'
8
21
  const BIDDER_ENDPOINT = 'https://exchange.postrelease.com/prebid'
@@ -136,6 +149,10 @@ export const spec = {
136
149
  * @return ServerRequest Info describing the request to the server.
137
150
  */
138
151
  buildRequests: function (validBidRequests, bidderRequest) {
152
+ // Get OpenRTB Data
153
+ const openRTBData = converter.toORTB({bidRequests: validBidRequests, bidderRequest})
154
+ const openRTBDataString = JSON.stringify(openRTBData)
155
+
139
156
  const requestData = new RequestData()
140
157
  requestData.addBidRequestDataSource(new UserEIDs())
141
158
 
@@ -271,8 +288,9 @@ export const spec = {
271
288
  const requestUrl = buildRequestUrl(BIDDER_ENDPOINT, qsParamStrings)
272
289
 
273
290
  let serverRequest = {
274
- method: 'GET',
275
- url: requestUrl
291
+ method: 'POST',
292
+ url: requestUrl,
293
+ data: openRTBDataString,
276
294
  }
277
295
 
278
296
  return serverRequest
@@ -70,6 +70,9 @@ function buildRequests(validBidRequests, bidderRequest) {
70
70
  if (bidderRequest && bidderRequest.uspConsent) {
71
71
  payload.usPrivacy = bidderRequest.uspConsent;
72
72
  }
73
+ if (bidderRequest && bidderRequest.ortb2) {
74
+ payload.ortb2 = bidderRequest.ortb2;
75
+ }
73
76
  if (validBidRequests && validBidRequests.length !== 0 && validBidRequests[0].userIdAsEids) {
74
77
  payload.userId = validBidRequests[0].userIdAsEids;
75
78
  }
@@ -680,6 +680,11 @@ function mapNativeImage(image, type) {
680
680
  * @returns {String} userId
681
681
  */
682
682
  function getUserId(bidRequest) {
683
+ let operaId = deepAccess(bidRequest, 'userId.operaId');
684
+ if (operaId) {
685
+ return operaId;
686
+ }
687
+
683
688
  let sharedId = deepAccess(bidRequest, 'userId.sharedid.id');
684
689
  if (sharedId) {
685
690
  return sharedId;
@@ -135,18 +135,18 @@ var adUnits = [{
135
135
 
136
136
  ### User Ids
137
137
 
138
- Opera Ads Bid Adapter uses `sharedId`, `pubcid` or `tdid`, please config at least one.
138
+ Opera Ads Bid Adapter uses `operaId`, please refer to [`Opera ID System`](./operaadsIdSystem.md).
139
139
 
140
140
  ```javascript
141
141
  pbjs.setConfig({
142
142
  ...,
143
143
  userSync: {
144
144
  userIds: [{
145
- name: 'sharedId',
145
+ name: 'operaId',
146
146
  storage: {
147
- name: '_sharedID', // name of the 1st party cookie
148
- type: 'cookie',
149
- expires: 30
147
+ name: 'operaId',
148
+ type: 'html5',
149
+ expires: 14
150
150
  }
151
151
  }]
152
152
  }
@@ -0,0 +1,106 @@
1
+ /**
2
+ * This module adds operaId to the User ID module
3
+ * The {@link module:modules/userId} module is required
4
+ * @module modules/operaadsIdSystem
5
+ * @requires module:modules/userId
6
+ */
7
+ import * as ajax from '../src/ajax.js';
8
+ import { submodule } from '../src/hook.js';
9
+ import { logMessage, logError } from '../src/utils.js';
10
+
11
+ const MODULE_NAME = 'operaId';
12
+ const ID_KEY = MODULE_NAME;
13
+ const version = '1.0';
14
+ const SYNC_URL = 'https://t.adx.opera.com/identity/';
15
+ const AJAX_TIMEOUT = 300;
16
+ const AJAX_OPTIONS = {method: 'GET', withCredentials: true, contentType: 'application/json'};
17
+
18
+ function constructUrl(pairs) {
19
+ const queries = [];
20
+ for (let key in pairs) {
21
+ queries.push(`${key}=${encodeURIComponent(pairs[key])}`);
22
+ }
23
+ return `${SYNC_URL}?${queries.join('&')}`;
24
+ }
25
+
26
+ function asyncRequest(url, cb) {
27
+ ajax.ajaxBuilder(AJAX_TIMEOUT)(
28
+ url,
29
+ {
30
+ success: response => {
31
+ try {
32
+ const jsonResponse = JSON.parse(response);
33
+ const { uid: operaId } = jsonResponse;
34
+ cb(operaId);
35
+ return;
36
+ } catch (e) {
37
+ logError(`${MODULE_NAME}: invalid response`, response);
38
+ }
39
+ cb();
40
+ },
41
+ error: (err) => {
42
+ logError(`${MODULE_NAME}: ID error response`, err);
43
+ cb();
44
+ }
45
+ },
46
+ null,
47
+ AJAX_OPTIONS
48
+ );
49
+ }
50
+
51
+ export const operaIdSubmodule = {
52
+ /**
53
+ * used to link submodule with config
54
+ * @type {string}
55
+ */
56
+ name: MODULE_NAME,
57
+
58
+ /**
59
+ * @type {string}
60
+ */
61
+ version,
62
+
63
+ /**
64
+ * decode the stored id value for passing to bid requests
65
+ * @function
66
+ * @param {string} id
67
+ * @returns {{'operaId': string}}
68
+ */
69
+ decode: (id) =>
70
+ id != null && id.length > 0
71
+ ? { [ID_KEY]: id }
72
+ : undefined,
73
+
74
+ /**
75
+ * performs action to obtain id and return a value in the callback's response argument
76
+ * @function
77
+ * @param {SubmoduleConfig} [config]
78
+ * @returns {IdResponse|undefined}
79
+ */
80
+ getId(config, consentData) {
81
+ logMessage(`${MODULE_NAME}: start synchronizing opera uid`);
82
+ const params = (config && config.params) || {};
83
+ if (typeof params.pid !== 'string' || params.pid.length == 0) {
84
+ logError(`${MODULE_NAME}: submodule requires a publisher ID to be defined`);
85
+ return;
86
+ }
87
+
88
+ const { pid, syncUrl = SYNC_URL } = params;
89
+ const url = constructUrl(syncUrl, { publisherId: pid });
90
+
91
+ return {
92
+ callback: (cb) => {
93
+ asyncRequest(url, cb);
94
+ }
95
+ }
96
+ },
97
+
98
+ eids: {
99
+ 'operaId': {
100
+ source: 't.adx.opera.com',
101
+ atype: 1
102
+ },
103
+ }
104
+ };
105
+
106
+ submodule('userId', operaIdSubmodule);