prebid.js 6.3.0 → 6.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/.circleci/config.yml +1 -1
  2. package/gulpfile.js +87 -74
  3. package/integrationExamples/gpt/amp/creative.html +11 -33
  4. package/karma.conf.maker.js +1 -1
  5. package/modules/.submodules.json +2 -1
  6. package/modules/adbookpspBidAdapter.js +27 -10
  7. package/modules/adhashBidAdapter.js +3 -3
  8. package/modules/adkernelBidAdapter.js +148 -62
  9. package/modules/adlooxAdServerVideo.js +2 -2
  10. package/modules/adlooxAnalyticsAdapter.js +4 -4
  11. package/modules/admanBidAdapter.js +10 -4
  12. package/modules/adomikAnalyticsAdapter.js +27 -9
  13. package/modules/adqueryIdSystem.js +103 -0
  14. package/modules/adqueryIdSystem.md +35 -0
  15. package/modules/adyoulikeBidAdapter.js +13 -9
  16. package/modules/aniviewBidAdapter.js +1 -1
  17. package/modules/beopBidAdapter.js +1 -1
  18. package/modules/bidViewability.js +3 -3
  19. package/modules/bidViewabilityIO.js +3 -3
  20. package/modules/bliinkBidAdapter.js +3 -2
  21. package/modules/colossussspBidAdapter.js +12 -8
  22. package/modules/colossussspBidAdapter.md +15 -1
  23. package/modules/compassBidAdapter.js +208 -0
  24. package/modules/compassBidAdapter.md +79 -0
  25. package/modules/consentManagement.js +7 -1
  26. package/modules/consumableBidAdapter.md +1 -1
  27. package/modules/criteoBidAdapter.js +1 -1
  28. package/modules/criteoIdSystem.js +29 -7
  29. package/modules/currency.js +2 -2
  30. package/modules/dailyhuntBidAdapter.js +435 -0
  31. package/modules/dailyhuntBidAdapter.md +4 -0
  32. package/modules/docereeBidAdapter.js +10 -1
  33. package/modules/docereeBidAdapter.md +2 -0
  34. package/modules/engageyaBidAdapter.js +1 -1
  35. package/modules/feedadBidAdapter.js +2 -2
  36. package/modules/feedadBidAdapter.md +4 -2
  37. package/modules/glimpseBidAdapter.js +66 -44
  38. package/modules/gnetBidAdapter.js +3 -3
  39. package/modules/gnetBidAdapter.md +4 -4
  40. package/modules/gptPreAuction.js +55 -7
  41. package/modules/gridBidAdapter.js +4 -3
  42. package/modules/gumgumBidAdapter.js +4 -4
  43. package/modules/idImportLibrary.js +45 -8
  44. package/modules/idImportLibrary.md +4 -0
  45. package/modules/improvedigitalBidAdapter.js +42 -4
  46. package/modules/instreamTracking.js +4 -4
  47. package/modules/invibesBidAdapter.js +49 -5
  48. package/modules/invibesBidAdapter.md +2 -1
  49. package/modules/ixBidAdapter.js +53 -18
  50. package/modules/jwplayerRtdProvider.js +71 -6
  51. package/modules/jwplayerRtdProvider.md +27 -11
  52. package/modules/kargoBidAdapter.js +2 -2
  53. package/modules/limelightDigitalBidAdapter.js +2 -1
  54. package/modules/livewrappedAnalyticsAdapter.js +3 -1
  55. package/modules/livewrappedBidAdapter.js +8 -2
  56. package/modules/loglyliftBidAdapter.js +79 -0
  57. package/modules/loglyliftBidAdapter.md +55 -0
  58. package/modules/nextMillenniumBidAdapter.js +11 -7
  59. package/modules/oguryBidAdapter.js +9 -2
  60. package/modules/onetagBidAdapter.js +4 -2
  61. package/modules/optimeraRtdProvider.js +8 -1
  62. package/modules/ozoneBidAdapter.js +21 -64
  63. package/modules/pilotxBidAdapter.js +147 -0
  64. package/modules/pilotxBidAdapter.md +50 -0
  65. package/modules/proxistoreBidAdapter.js +0 -2
  66. package/modules/pubgeniusBidAdapter.js +1 -1
  67. package/modules/pubmaticAnalyticsAdapter.js +16 -0
  68. package/modules/pubxaiAnalyticsAdapter.js +17 -0
  69. package/modules/richaudienceBidAdapter.js +3 -2
  70. package/modules/riseBidAdapter.js +1 -1
  71. package/modules/rtbhouseBidAdapter.js +14 -4
  72. package/modules/rtdModule/index.js +14 -15
  73. package/modules/rubiconAnalyticsAdapter.js +3 -2
  74. package/modules/rubiconBidAdapter.js +21 -11
  75. package/modules/seedingAllianceBidAdapter.js +3 -3
  76. package/modules/sharethroughBidAdapter.js +12 -17
  77. package/modules/showheroes-bsBidAdapter.js +13 -2
  78. package/modules/synacormediaBidAdapter.js +31 -10
  79. package/modules/tappxBidAdapter.js +8 -5
  80. package/modules/teadsBidAdapter.js +1 -2
  81. package/modules/telariaBidAdapter.js +2 -2
  82. package/modules/trustxBidAdapter.js +8 -16
  83. package/modules/userId/eids.js +7 -1
  84. package/modules/userId/userId.md +8 -0
  85. package/modules/viewability.js +177 -0
  86. package/modules/viewability.md +87 -0
  87. package/modules/welectBidAdapter.js +106 -0
  88. package/modules/yieldmoBidAdapter.js +23 -5
  89. package/modules/zeta_global_sspAnalyticsAdapter.js +97 -0
  90. package/modules/zeta_global_sspAnalyticsAdapter.md +24 -0
  91. package/package.json +1 -1
  92. package/src/auction.js +2 -2
  93. package/src/config.js +27 -3
  94. package/src/hook.js +5 -1
  95. package/src/prebid.js +20 -4
  96. package/src/secureCreatives.js +3 -2
  97. package/src/utils.js +12 -1
  98. package/test/helpers/prebidGlobal.js +1 -0
  99. package/test/spec/config_spec.js +279 -0
  100. package/test/spec/modules/adbookpspBidAdapter_spec.js +17 -3
  101. package/test/spec/modules/adhashBidAdapter_spec.js +2 -2
  102. package/test/spec/modules/adlooxAnalyticsAdapter_spec.js +6 -6
  103. package/test/spec/modules/admanBidAdapter_spec.js +2 -2
  104. package/test/spec/modules/adomikAnalyticsAdapter_spec.js +9 -1
  105. package/test/spec/modules/adqueryIdSystem_spec.js +74 -0
  106. package/test/spec/modules/adyoulikeBidAdapter_spec.js +49 -0
  107. package/test/spec/modules/beopBidAdapter_spec.js +1 -1
  108. package/test/spec/modules/bidViewabilityIO_spec.js +2 -2
  109. package/test/spec/modules/bidViewability_spec.js +4 -4
  110. package/test/spec/modules/bliinkBidAdapter_spec.js +2 -0
  111. package/test/spec/modules/colossussspBidAdapter_spec.js +5 -2
  112. package/test/spec/modules/compassBidAdapter_spec.js +398 -0
  113. package/test/spec/modules/consentManagement_spec.js +20 -0
  114. package/test/spec/modules/criteoIdSystem_spec.js +6 -3
  115. package/test/spec/modules/dailyhuntBidAdapter_spec.js +404 -0
  116. package/test/spec/modules/docereeBidAdapter_spec.js +9 -1
  117. package/test/spec/modules/eids_spec.js +15 -0
  118. package/test/spec/modules/feedadBidAdapter_spec.js +15 -0
  119. package/test/spec/modules/glimpseBidAdapter_spec.js +0 -18
  120. package/test/spec/modules/gnetBidAdapter_spec.js +6 -6
  121. package/test/spec/modules/gptPreAuction_spec.js +177 -2
  122. package/test/spec/modules/idImportLibrary_spec.js +197 -10
  123. package/test/spec/modules/improvedigitalBidAdapter_spec.js +45 -1
  124. package/test/spec/modules/invibesBidAdapter_spec.js +119 -0
  125. package/test/spec/modules/ixBidAdapter_spec.js +112 -62
  126. package/test/spec/modules/jwplayerRtdProvider_spec.js +195 -2
  127. package/test/spec/modules/kargoBidAdapter_spec.js +1 -1
  128. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +75 -17
  129. package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +22 -0
  130. package/test/spec/modules/livewrappedBidAdapter_spec.js +31 -0
  131. package/test/spec/modules/loglyliftBidAdapter_spec.js +172 -0
  132. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +9 -2
  133. package/test/spec/modules/oguryBidAdapter_spec.js +10 -2
  134. package/test/spec/modules/optimeraRtdProvider_spec.js +14 -1
  135. package/test/spec/modules/ozoneBidAdapter_spec.js +43 -31
  136. package/test/spec/modules/pilotxBidAdapter_spec.js +244 -0
  137. package/test/spec/modules/pubgeniusBidAdapter_spec.js +3 -3
  138. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +13 -1
  139. package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +11 -0
  140. package/test/spec/modules/realTimeDataModule_spec.js +67 -5
  141. package/test/spec/modules/richaudienceBidAdapter_spec.js +40 -0
  142. package/test/spec/modules/riseBidAdapter_spec.js +1 -1
  143. package/test/spec/modules/rtbhouseBidAdapter_spec.js +20 -0
  144. package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +30 -0
  145. package/test/spec/modules/rubiconBidAdapter_spec.js +48 -9
  146. package/test/spec/modules/sharethroughBidAdapter_spec.js +91 -6
  147. package/test/spec/modules/showheroes-bsBidAdapter_spec.js +2 -0
  148. package/test/spec/modules/synacormediaBidAdapter_spec.js +70 -0
  149. package/test/spec/modules/tappxBidAdapter_spec.js +0 -19
  150. package/test/spec/modules/teadsBidAdapter_spec.js +14 -59
  151. package/test/spec/modules/userId_spec.js +68 -19
  152. package/test/spec/modules/viewability_spec.js +280 -0
  153. package/test/spec/modules/welectBidAdapter_spec.js +211 -0
  154. package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +427 -0
  155. package/test/spec/unit/pbjs_api_spec.js +3 -1
  156. package/test/test_deps.js +3 -0
  157. package/test/test_index.js +1 -3
@@ -155,8 +155,10 @@ export function enrichAdUnits(adUnits) {
155
155
  if (!vat) {
156
156
  return;
157
157
  }
158
+ const contentId = getContentId(vat.mediaID);
159
+ const contentData = getContentData(vat.segments);
158
160
  const targeting = formatTargetingResponse(vat);
159
- addTargetingToBids(adUnit.bids, targeting);
161
+ enrichBids(adUnit.bids, targeting, contentId, contentData);
160
162
  };
161
163
  loadVat(jwTargeting, onVatResponse);
162
164
  });
@@ -235,6 +237,9 @@ export function getVatFromPlayer(playerID, mediaID) {
235
237
  };
236
238
  }
237
239
 
240
+ /*
241
+ deprecated
242
+ */
238
243
  export function formatTargetingResponse(vat) {
239
244
  const { segments, mediaID } = vat;
240
245
  const targeting = {};
@@ -243,23 +248,83 @@ export function formatTargetingResponse(vat) {
243
248
  }
244
249
 
245
250
  if (mediaID) {
246
- const id = 'jw_' + mediaID;
247
251
  targeting.content = {
248
- id
252
+ id: getContentId(mediaID)
249
253
  }
250
254
  }
251
255
  return targeting;
252
256
  }
253
257
 
254
- function addTargetingToBids(bids, targeting) {
255
- if (!bids || !targeting) {
258
+ export function getContentId(mediaID) {
259
+ if (!mediaID) {
260
+ return;
261
+ }
262
+
263
+ return 'jw_' + mediaID;
264
+ }
265
+
266
+ export function getContentData(segments) {
267
+ if (!segments || !segments.length) {
268
+ return;
269
+ }
270
+
271
+ const formattedSegments = segments.reduce((convertedSegments, rawSegment) => {
272
+ convertedSegments.push({
273
+ id: rawSegment,
274
+ value: rawSegment
275
+ });
276
+ return convertedSegments;
277
+ }, []);
278
+
279
+ return {
280
+ name: 'jwplayer',
281
+ ext: {
282
+ segtax: 502
283
+ },
284
+ segment: formattedSegments
285
+ };
286
+ }
287
+
288
+ export function addOrtbSiteContent(bid, contentId, contentData) {
289
+ if (!contentId && !contentData) {
256
290
  return;
257
291
  }
258
292
 
259
- bids.forEach(bid => addTargetingToBid(bid, targeting));
293
+ let ortb2 = bid.ortb2 || {};
294
+ let site = ortb2.site = ortb2.site || {};
295
+ let content = site.content = site.content || {};
296
+
297
+ if (contentId) {
298
+ content.id = contentId;
299
+ }
300
+
301
+ if (contentData) {
302
+ const data = content.data = content.data || [];
303
+ data.push(contentData);
304
+ }
305
+
306
+ bid.ortb2 = ortb2;
260
307
  }
261
308
 
309
+ function enrichBids(bids, targeting, contentId, contentData) {
310
+ if (!bids) {
311
+ return;
312
+ }
313
+
314
+ bids.forEach(bid => {
315
+ addTargetingToBid(bid, targeting);
316
+ addOrtbSiteContent(bid, contentId, contentData);
317
+ });
318
+ }
319
+
320
+ /*
321
+ deprecated
322
+ */
262
323
  export function addTargetingToBid(bid, targeting) {
324
+ if (!targeting) {
325
+ return;
326
+ }
327
+
263
328
  const rtd = bid.rtd || {};
264
329
  const jwRtd = {};
265
330
  jwRtd[SUBMODULE_NAME] = Object.assign({}, rtd[SUBMODULE_NAME], { targeting });
@@ -81,20 +81,30 @@ realTimeData = {
81
81
  # Usage for Bid Adapters:
82
82
 
83
83
  Implement the `buildRequests` function. When it is called, the `bidRequests` param will be an array of bids.
84
- Each bid for which targeting information was found will conform to the following object structure:
84
+ Each bid for which targeting information was found will have a ortb2 param conforming to the [oRTB v2 object structure](https://www.iab.com/wp-content/uploads/2016/03/OpenRTB-API-Specification-Version-2-5-FINAL.pdf). The `ortb2` object will contain our proprietaty targeting segments in a format compliant with the [IAB's segment taxonomy structure](https://github.com/InteractiveAdvertisingBureau/openrtb/blob/master/extensions/community_extensions/segtax.md).
85
+
86
+ Example:
85
87
 
86
88
  ```javascript
87
89
  {
88
90
  adUnitCode: 'xyz',
89
91
  bidId: 'abc',
90
92
  ...,
91
- rtd: {
92
- jwplayer: {
93
- targeting: {
94
- segments: ['123', '456'],
95
- content: {
96
- id: 'jw_abc123'
97
- }
93
+ ortb2: {
94
+ site: {
95
+ content: {
96
+ id: 'jw_abc123',
97
+ data: [{
98
+ name: 'jwplayer',
99
+ ext: {
100
+ segtax: 502
101
+ },
102
+ segment: [{
103
+ id: '123'
104
+ }, {
105
+ id: '456'
106
+ }]
107
+ }]
98
108
  }
99
109
  }
100
110
  }
@@ -102,9 +112,15 @@ Each bid for which targeting information was found will conform to the following
102
112
  ```
103
113
 
104
114
  where:
105
- - `segments` is an array of jwpseg targeting segments, of type string.
106
- - `content` is an object containing metadata for the media. It may contain the following information:
107
- - `id` is a unique identifier for the specific media asset.
115
+ - `ortb2` is an object containing first party data
116
+ - `site` is an object containing page specific information
117
+ - `content` is an object containing metadata for the media. It may contain the following information:
118
+ - `id` is a unique identifier for the specific media asset
119
+ - `data` is an array containing segment taxonomy objects that have the following parameters:
120
+ - `name` is the `jwplayer` string indicating the provider name
121
+ - `ext.segtax` whose `502` value is the unique identifier for JW Player's proprietary taxonomy
122
+ - `segment` is an array containing the segment taxonomy values as an object where:
123
+ - `id` is the string representation of the data segment value.
108
124
 
109
125
  **Example:**
110
126
 
@@ -73,8 +73,8 @@ export const spec = {
73
73
  let meta;
74
74
  if (adUnit.metadata && adUnit.metadata.landingPageDomain) {
75
75
  meta = {
76
- clickUrl: adUnit.metadata.landingPageDomain,
77
- advertiserDomains: [adUnit.metadata.landingPageDomain]
76
+ clickUrl: adUnit.metadata.landingPageDomain[0],
77
+ advertiserDomains: adUnit.metadata.landingPageDomain
78
78
  };
79
79
  }
80
80
  bidResponses.push({
@@ -159,7 +159,8 @@ function buildPlacement(bidRequest) {
159
159
  }
160
160
  }),
161
161
  type: bidRequest.params.adUnitType.toUpperCase(),
162
- publisherId: bidRequest.params.publisherId
162
+ publisherId: bidRequest.params.publisherId,
163
+ userIdAsEids: bidRequest.userIdAsEids
163
164
  }
164
165
  }
165
166
  }
@@ -114,6 +114,7 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE
114
114
  let wonBid = cache.auctions[args.auctionId].bids[args.requestId];
115
115
  wonBid.won = true;
116
116
  wonBid.floorData = args.floorData;
117
+ wonBid.rUp = args.rUp;
117
118
  if (wonBid.sendStatus != 0) {
118
119
  livewrappedAnalyticsAdapter.sendEvents();
119
120
  }
@@ -288,7 +289,8 @@ function getWins(gdpr, auctionIds) {
288
289
  auctionId: auctionIdPos,
289
290
  auc: bid.auc,
290
291
  buc: bid.buc,
291
- lw: bid.lw
292
+ lw: bid.lw,
293
+ rUp: bid.rUp
292
294
  });
293
295
  }
294
296
  });
@@ -1,4 +1,4 @@
1
- import { isSafariBrowser, deepAccess, getWindowTop } from '../src/utils.js';
1
+ import { isSafariBrowser, deepAccess, getWindowTop, mergeDeep } from '../src/utils.js';
2
2
  import { registerBidder } from '../src/adapters/bidderFactory.js';
3
3
  import { config } from '../src/config.js';
4
4
  import find from 'core-js-pure/features/array/find.js';
@@ -60,11 +60,17 @@ export const spec = {
60
60
  const bundle = find(bidRequests, hasBundleParam);
61
61
  const tid = find(bidRequests, hasTidParam);
62
62
  const schain = bidRequests[0].schain;
63
+ let ortb2 = config.getConfig('ortb2');
64
+ const eids = handleEids(bidRequests);
63
65
  bidUrl = bidUrl ? bidUrl.params.bidUrl : URL;
64
66
  url = url ? url.params.url : (getAppDomain() || getTopWindowLocation(bidderRequest));
65
67
  test = test ? test.params.test : undefined;
66
68
  var adRequests = bidRequests.map(bidToAdRequest);
67
69
 
70
+ if (eids) {
71
+ ortb2 = mergeDeep(ortb2 || {}, eids);
72
+ }
73
+
68
74
  const payload = {
69
75
  auctionId: auctionId ? auctionId.auctionId : undefined,
70
76
  publisherId: publisherId ? publisherId.params.publisherId : undefined,
@@ -86,7 +92,7 @@ export const spec = {
86
92
  cookieSupport: !isSafariBrowser() && storage.cookiesAreEnabled(),
87
93
  rcv: getAdblockerRecovered(),
88
94
  adRequests: [...adRequests],
89
- rtbData: handleEids(bidRequests),
95
+ rtbData: ortb2,
90
96
  schain: schain
91
97
  };
92
98
 
@@ -0,0 +1,79 @@
1
+ import { config } from '../src/config.js';
2
+ import { registerBidder } from '../src/adapters/bidderFactory.js';
3
+ import { NATIVE } from '../src/mediaTypes.js';
4
+
5
+ const BIDDER_CODE = 'loglylift';
6
+ const ENDPOINT_URL = 'https://bid.logly.co.jp/prebid/client/v1';
7
+
8
+ export const spec = {
9
+ code: BIDDER_CODE,
10
+ supportedMediaTypes: [NATIVE],
11
+
12
+ isBidRequestValid: function (bid) {
13
+ return !!(bid.params && bid.params.adspotId);
14
+ },
15
+
16
+ buildRequests: function (bidRequests, bidderRequest) {
17
+ const requests = [];
18
+ for (let i = 0, len = bidRequests.length; i < len; i++) {
19
+ const request = {
20
+ method: 'POST',
21
+ url: ENDPOINT_URL + '?adspot_id=' + bidRequests[i].params.adspotId,
22
+ data: JSON.stringify(newBidRequest(bidRequests[i], bidderRequest)),
23
+ options: {},
24
+ bidderRequest
25
+ };
26
+ requests.push(request);
27
+ }
28
+ return requests;
29
+ },
30
+
31
+ interpretResponse: function (serverResponse, { bidderRequest }) {
32
+ serverResponse = serverResponse.body;
33
+ const bidResponses = [];
34
+ if (!serverResponse || serverResponse.error) {
35
+ return bidResponses;
36
+ }
37
+ serverResponse.bids.forEach(function (bid) {
38
+ bidResponses.push(bid);
39
+ })
40
+ return bidResponses;
41
+ },
42
+
43
+ getUserSyncs: function (syncOptions, serverResponses) {
44
+ const syncs = [];
45
+
46
+ if (syncOptions.iframeEnabled && serverResponses.length > 0) {
47
+ syncs.push({
48
+ type: 'iframe',
49
+ url: 'https://sync.logly.co.jp/sync/sync.html'
50
+ });
51
+ }
52
+ return syncs;
53
+ }
54
+
55
+ };
56
+
57
+ function newBidRequest(bid, bidderRequest) {
58
+ const currencyObj = config.getConfig('currency');
59
+ const currency = (currencyObj && currencyObj.adServerCurrency) || 'USD';
60
+
61
+ return {
62
+ auctionId: bid.auctionId,
63
+ bidderRequestId: bid.bidderRequestId,
64
+ transactionId: bid.transactionId,
65
+ adUnitCode: bid.adUnitCode,
66
+ bidId: bid.bidId,
67
+ mediaTypes: bid.mediaTypes,
68
+ params: bid.params,
69
+ prebidJsVersion: '$prebid.version$',
70
+ url: window.location.href,
71
+ domain: config.getConfig('publisherDomain'),
72
+ referer: bidderRequest.refererInfo.referer,
73
+ auctionStartTime: bidderRequest.auctionStart,
74
+ currency: currency,
75
+ timeout: config.getConfig('bidderTimeout')
76
+ };
77
+ }
78
+
79
+ registerBidder(spec);
@@ -0,0 +1,55 @@
1
+ # Overview
2
+ ```
3
+ Module Name: LOGLY lift for Publisher
4
+ Module Type: Bidder Adapter
5
+ Maintainer: dev@logly.co.jp
6
+ ```
7
+
8
+ # Description
9
+ Module that connects to Logly's demand sources.
10
+ Currently module supports only native mediaType.
11
+
12
+ # Test Parameters
13
+ ```
14
+ var adUnits = [
15
+ // Native adUnit
16
+ {
17
+ code: 'test-native-code',
18
+ sizes: [[1, 1]],
19
+ mediaTypes: {
20
+ native: {
21
+ title: {
22
+ required: true
23
+ },
24
+ image: {
25
+ required: true
26
+ },
27
+ sponsoredBy: {
28
+ required: true
29
+ }
30
+ }
31
+ },
32
+ bids: [{
33
+ bidder: 'loglylift',
34
+ params: {
35
+ adspotId: 4302078
36
+ }
37
+ }]
38
+ }
39
+ ];
40
+ ```
41
+
42
+ # UserSync example
43
+
44
+ ```
45
+ pbjs.setConfig({
46
+ userSync: {
47
+ filterSettings: {
48
+ iframe: {
49
+ bidders: '*', // '*' represents all bidders
50
+ filter: 'include'
51
+ }
52
+ }
53
+ }
54
+ });
55
+ ```
@@ -25,12 +25,14 @@ export const spec = {
25
25
  window.nmmRefreshCounts[bid.adUnitCode] = window.nmmRefreshCounts[bid.adUnitCode] || 0;
26
26
  const postBody = {
27
27
  'id': bid.auctionId,
28
- 'refresh_count': window.nmmRefreshCounts[bid.adUnitCode]++,
29
28
  'ext': {
30
29
  'prebid': {
31
30
  'storedrequest': {
32
31
  'id': getBidIdParameter('placement_id', bid.params)
33
32
  }
33
+ },
34
+ 'nextMillennium': {
35
+ 'refresh_count': window.nmmRefreshCounts[bid.adUnitCode]++,
34
36
  }
35
37
  }
36
38
  }
@@ -44,12 +46,14 @@ export const spec = {
44
46
  if (uspConsent) {
45
47
  postBody.regs.ext.us_privacy = uspConsent;
46
48
  }
47
- if (typeof gdprConsent.gdprApplies !== 'undefined') {
48
- postBody.regs.ext.gdpr = gdprConsent.gdprApplies ? 1 : 0;
49
- }
50
- if (typeof gdprConsent.consentString !== 'undefined') {
51
- postBody.user = {
52
- ext: { consent: gdprConsent.consentString }
49
+ if (gdprConsent) {
50
+ if (typeof gdprConsent.gdprApplies !== 'undefined') {
51
+ postBody.regs.ext.gdpr = gdprConsent.gdprApplies ? 1 : 0;
52
+ }
53
+ if (typeof gdprConsent.consentString !== 'undefined') {
54
+ postBody.user = {
55
+ ext: { consent: gdprConsent.consentString }
56
+ }
53
57
  }
54
58
  }
55
59
  }
@@ -10,6 +10,7 @@ const DEFAULT_TIMEOUT = 1000;
10
10
  const BID_HOST = 'https://mweb-hb.presage.io/api/header-bidding-request';
11
11
  const TIMEOUT_MONITORING_HOST = 'https://ms-ads-monitoring-events.presage.io';
12
12
  const MS_COOKIE_SYNC_DOMAIN = 'https://ms-cookie-sync.presage.io';
13
+ const ADAPTER_VERSION = '1.2.7';
13
14
 
14
15
  function isBidRequestValid(bid) {
15
16
  const adUnitSizes = getAdUnitSizes(bid);
@@ -55,7 +56,11 @@ function buildRequests(validBidRequests, bidderRequest) {
55
56
  consent: ''
56
57
  }
57
58
  },
58
- imp: []
59
+ imp: [],
60
+ ext: {
61
+ adapterversion: ADAPTER_VERSION,
62
+ prebidversion: '$prebid.version$'
63
+ }
59
64
  };
60
65
 
61
66
  if (bidderRequest.hasOwnProperty('gdprConsent') &&
@@ -123,7 +128,9 @@ function interpretResponse(openRtbBidResponse) {
123
128
  meta: {
124
129
  advertiserDomains: bid.adomain
125
130
  },
126
- nurl: bid.nurl
131
+ nurl: bid.nurl,
132
+ adapterVersion: ADAPTER_VERSION,
133
+ prebidVersion: '$prebid.version$'
127
134
  };
128
135
 
129
136
  bidResponse.ad = bid.adm;
@@ -347,11 +347,13 @@ function getSizes(sizes) {
347
347
  function getUserSyncs(syncOptions, serverResponses, gdprConsent, uspConsent) {
348
348
  let syncs = [];
349
349
  let params = '';
350
- if (gdprConsent && typeof gdprConsent.consentString === 'string') {
351
- params += '&gdpr_consent=' + gdprConsent.consentString;
350
+ if (gdprConsent) {
352
351
  if (typeof gdprConsent.gdprApplies === 'boolean') {
353
352
  params += '&gdpr=' + (gdprConsent.gdprApplies ? 1 : 0);
354
353
  }
354
+ if (typeof gdprConsent.consentString === 'string') {
355
+ params += '&gdpr_consent=' + gdprConsent.consentString;
356
+ }
355
357
  }
356
358
  if (uspConsent && typeof uspConsent === 'string') {
357
359
  params += '&us_privacy=' + uspConsent;
@@ -173,7 +173,9 @@ export function setScoresURL() {
173
173
  }
174
174
 
175
175
  /**
176
- * Set the scores for the divice if given.
176
+ * Set the scores for the device if given.
177
+ * Add any any insights to the winddow.optimeraInsights object.
178
+ *
177
179
  * @param {*} result
178
180
  * @returns {string} JSON string of Optimera Scores.
179
181
  */
@@ -184,6 +186,11 @@ export function setScores(result) {
184
186
  if (device !== 'default' && scores.device[device]) {
185
187
  scores = scores.device[device];
186
188
  }
189
+ logInfo(scores);
190
+ if (scores.insights) {
191
+ window.optimeraInsights = window.optimeraInsights || {};
192
+ window.optimeraInsights.data = scores.insights;
193
+ }
187
194
  } catch (e) {
188
195
  logError('Optimera score file could not be parsed.');
189
196
  }