prebid.js 6.5.0 → 6.9.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 (139) hide show
  1. package/.eslintrc.js +8 -1
  2. package/integrationExamples/gpt/amp/creative.html +11 -33
  3. package/integrationExamples/gpt/weboramaRtdProvider_example.html +154 -115
  4. package/integrationExamples/gpt/x-domain/creative.html +63 -29
  5. package/modules/.submodules.json +2 -1
  6. package/modules/adagioBidAdapter.js +0 -8
  7. package/modules/adagioBidAdapter.md +1 -1
  8. package/modules/adbookpspBidAdapter.js +27 -10
  9. package/modules/adhashBidAdapter.js +3 -3
  10. package/modules/adkernelBidAdapter.js +2 -1
  11. package/modules/admanBidAdapter.js +10 -4
  12. package/modules/adomikAnalyticsAdapter.js +23 -11
  13. package/modules/adqueryIdSystem.js +103 -0
  14. package/modules/adqueryIdSystem.md +35 -0
  15. package/modules/appnexusBidAdapter.js +14 -2
  16. package/modules/asealBidAdapter.js +58 -0
  17. package/modules/asealBidAdapter.md +52 -0
  18. package/modules/bliinkBidAdapter.js +2 -1
  19. package/modules/brandmetricsRtdProvider.js +168 -0
  20. package/modules/brandmetricsRtdProvider.md +40 -0
  21. package/modules/colossussspBidAdapter.js +12 -8
  22. package/modules/colossussspBidAdapter.md +15 -1
  23. package/modules/compassBidAdapter.js +10 -3
  24. package/modules/consumableBidAdapter.md +1 -1
  25. package/modules/conversantBidAdapter.js +7 -0
  26. package/modules/criteoBidAdapter.js +10 -1
  27. package/modules/criteoIdSystem.js +29 -7
  28. package/modules/currency.js +26 -1
  29. package/modules/displayioBidAdapter.js +157 -0
  30. package/modules/displayioBidAdapter.md +148 -0
  31. package/modules/e_volutionBidAdapter.js +158 -0
  32. package/modules/glimpseBidAdapter.js +66 -44
  33. package/modules/gnetBidAdapter.js +3 -3
  34. package/modules/gnetBidAdapter.md +4 -4
  35. package/modules/gumgumBidAdapter.js +56 -42
  36. package/modules/idImportLibrary.js +45 -8
  37. package/modules/idImportLibrary.md +4 -0
  38. package/modules/improvedigitalBidAdapter.js +29 -2
  39. package/modules/interactiveOffersBidAdapter.js +9 -6
  40. package/modules/jwplayerRtdProvider.js +71 -6
  41. package/modules/jwplayerRtdProvider.md +27 -11
  42. package/modules/kargoBidAdapter.js +2 -2
  43. package/modules/lunamediahbBidAdapter.js +32 -4
  44. package/modules/nextMillenniumBidAdapter.js +3 -1
  45. package/modules/oguryBidAdapter.js +14 -14
  46. package/modules/onetagBidAdapter.js +4 -2
  47. package/modules/pilotxBidAdapter.js +147 -0
  48. package/modules/pilotxBidAdapter.md +50 -0
  49. package/modules/priceFloors.js +2 -1
  50. package/modules/proxistoreBidAdapter.js +0 -2
  51. package/modules/pubmaticAnalyticsAdapter.js +16 -0
  52. package/modules/richaudienceBidAdapter.js +10 -4
  53. package/modules/riseBidAdapter.js +18 -7
  54. package/modules/rtbhouseBidAdapter.js +14 -4
  55. package/modules/rtdModule/index.js +14 -15
  56. package/modules/rubiconAnalyticsAdapter.js +8 -2
  57. package/modules/seedingAllianceBidAdapter.js +3 -3
  58. package/modules/sharethroughBidAdapter.js +12 -17
  59. package/modules/showheroes-bsBidAdapter.js +13 -2
  60. package/modules/sortableAnalyticsAdapter.js +5 -4
  61. package/modules/sovrnBidAdapter.js +93 -18
  62. package/modules/sovrnBidAdapter.md +80 -2
  63. package/modules/synacormediaBidAdapter.js +31 -10
  64. package/modules/tappxBidAdapter.js +8 -5
  65. package/modules/teadsBidAdapter.js +1 -2
  66. package/modules/undertoneBidAdapter.js +17 -1
  67. package/modules/userId/eids.js +7 -1
  68. package/modules/userId/userId.md +8 -0
  69. package/modules/viewability.js +177 -0
  70. package/modules/viewability.md +87 -0
  71. package/modules/weboramaRtdProvider.js +264 -34
  72. package/modules/weboramaRtdProvider.md +110 -40
  73. package/modules/welectBidAdapter.js +106 -0
  74. package/modules/yahoosspBidAdapter.js +2 -0
  75. package/package.json +2 -1
  76. package/src/adRendering.js +38 -0
  77. package/src/adloader.js +2 -1
  78. package/src/auction.js +103 -73
  79. package/src/bidderSettings.js +69 -0
  80. package/src/hook.js +5 -1
  81. package/src/prebid.js +19 -21
  82. package/src/secureCreatives.js +131 -47
  83. package/src/targeting.js +3 -2
  84. package/src/utils.js +13 -10
  85. package/test/helpers/syncPromise.js +71 -0
  86. package/test/spec/auctionmanager_spec.js +179 -15
  87. package/test/spec/modules/adagioBidAdapter_spec.js +0 -10
  88. package/test/spec/modules/adbookpspBidAdapter_spec.js +17 -3
  89. package/test/spec/modules/adhashBidAdapter_spec.js +2 -2
  90. package/test/spec/modules/admanBidAdapter_spec.js +2 -2
  91. package/test/spec/modules/adomikAnalyticsAdapter_spec.js +3 -1
  92. package/test/spec/modules/adqueryIdSystem_spec.js +74 -0
  93. package/test/spec/modules/appnexusBidAdapter_spec.js +27 -0
  94. package/test/spec/modules/asealBidAdapter_spec.js +144 -0
  95. package/test/spec/modules/bliinkBidAdapter_spec.js +2 -0
  96. package/test/spec/modules/brandmetricsRtdProvider_spec.js +191 -0
  97. package/test/spec/modules/colossussspBidAdapter_spec.js +5 -2
  98. package/test/spec/modules/compassBidAdapter_spec.js +1 -0
  99. package/test/spec/modules/conversantBidAdapter_spec.js +54 -2
  100. package/test/spec/modules/criteoBidAdapter_spec.js +21 -0
  101. package/test/spec/modules/criteoIdSystem_spec.js +6 -3
  102. package/test/spec/modules/currency_spec.js +21 -6
  103. package/test/spec/modules/displayioBidAdapter_spec.js +239 -0
  104. package/test/spec/modules/e_volutionBidAdapter_spec.js +242 -0
  105. package/test/spec/modules/eids_spec.js +15 -0
  106. package/test/spec/modules/glimpseBidAdapter_spec.js +0 -18
  107. package/test/spec/modules/gnetBidAdapter_spec.js +6 -6
  108. package/test/spec/modules/gumgumBidAdapter_spec.js +46 -0
  109. package/test/spec/modules/idImportLibrary_spec.js +197 -10
  110. package/test/spec/modules/improvedigitalBidAdapter_spec.js +61 -0
  111. package/test/spec/modules/jwplayerRtdProvider_spec.js +195 -2
  112. package/test/spec/modules/kargoBidAdapter_spec.js +1 -1
  113. package/test/spec/modules/loglyliftBidAdapter_spec.js +1 -1
  114. package/test/spec/modules/lunamediahbBidAdapter_spec.js +27 -1
  115. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +1 -1
  116. package/test/spec/modules/oguryBidAdapter_spec.js +69 -3
  117. package/test/spec/modules/pilotxBidAdapter_spec.js +244 -0
  118. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +13 -1
  119. package/test/spec/modules/realTimeDataModule_spec.js +67 -5
  120. package/test/spec/modules/richaudienceBidAdapter_spec.js +40 -0
  121. package/test/spec/modules/riseBidAdapter_spec.js +31 -5
  122. package/test/spec/modules/rtbhouseBidAdapter_spec.js +20 -0
  123. package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +61 -1
  124. package/test/spec/modules/sharethroughBidAdapter_spec.js +91 -6
  125. package/test/spec/modules/showheroes-bsBidAdapter_spec.js +2 -0
  126. package/test/spec/modules/sortableAnalyticsAdapter_spec.js +2 -3
  127. package/test/spec/modules/sovrnBidAdapter_spec.js +413 -333
  128. package/test/spec/modules/synacormediaBidAdapter_spec.js +70 -0
  129. package/test/spec/modules/tappxBidAdapter_spec.js +0 -19
  130. package/test/spec/modules/teadsBidAdapter_spec.js +14 -59
  131. package/test/spec/modules/undertoneBidAdapter_spec.js +55 -2
  132. package/test/spec/modules/userId_spec.js +68 -19
  133. package/test/spec/modules/viewability_spec.js +280 -0
  134. package/test/spec/modules/weboramaRtdProvider_spec.js +536 -20
  135. package/test/spec/modules/welectBidAdapter_spec.js +211 -0
  136. package/test/spec/modules/yahoosspBidAdapter_spec.js +10 -0
  137. package/test/spec/unit/core/bidderSettings_spec.js +123 -0
  138. package/test/spec/unit/pbjs_api_spec.js +21 -8
  139. package/test/spec/unit/secureCreatives_spec.js +143 -24
@@ -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({
@@ -1,9 +1,11 @@
1
1
  import { logMessage } from '../src/utils.js';
2
2
  import { registerBidder } from '../src/adapters/bidderFactory.js';
3
3
  import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
4
+ import { config } from '../src/config.js';
4
5
 
5
6
  const BIDDER_CODE = 'lunamediahb';
6
7
  const AD_URL = 'https://balancer.lmgssp.com/?c=o&m=multi';
8
+ const SYNC_URL = 'https://cookie.lmgssp.com';
7
9
 
8
10
  function isBidResponseValid(bid) {
9
11
  if (!bid.requestId || !bid.cpm || !bid.creativeId ||
@@ -14,7 +16,7 @@ function isBidResponseValid(bid) {
14
16
  case BANNER:
15
17
  return Boolean(bid.width && bid.height && bid.ad);
16
18
  case VIDEO:
17
- return Boolean(bid.vastUrl);
19
+ return Boolean(bid.vastUrl) || Boolean(bid.vastXml);
18
20
  case NATIVE:
19
21
  return Boolean(bid.native && bid.native.impressionTrackers);
20
22
  default:
@@ -74,10 +76,13 @@ export const spec = {
74
76
  if (mediaType && mediaType[BANNER] && mediaType[BANNER].sizes) {
75
77
  placement.sizes = mediaType[BANNER].sizes;
76
78
  placement.traffic = BANNER;
77
- } else if (mediaType && mediaType[VIDEO] && mediaType[VIDEO].playerSize) {
78
- placement.wPlayer = mediaType[VIDEO].playerSize[0];
79
- placement.hPlayer = mediaType[VIDEO].playerSize[1];
79
+ } else if (mediaType && mediaType[VIDEO]) {
80
+ if (mediaType[VIDEO].playerSize) {
81
+ placement.wPlayer = mediaType[VIDEO].playerSize[0];
82
+ placement.hPlayer = mediaType[VIDEO].playerSize[1];
83
+ }
80
84
  placement.traffic = VIDEO;
85
+ placement.videoContext = mediaType[VIDEO].context || 'instream'
81
86
  } else if (mediaType && mediaType[NATIVE]) {
82
87
  placement.native = mediaType[NATIVE];
83
88
  placement.traffic = NATIVE;
@@ -102,6 +107,29 @@ export const spec = {
102
107
  }
103
108
  return response;
104
109
  },
110
+
111
+ getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => {
112
+ let syncType = syncOptions.iframeEnabled ? 'iframe' : 'image';
113
+ let syncUrl = SYNC_URL + `/${syncType}?pbjs=1`;
114
+ if (gdprConsent && gdprConsent.consentString) {
115
+ if (typeof gdprConsent.gdprApplies === 'boolean') {
116
+ syncUrl += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
117
+ } else {
118
+ syncUrl += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`;
119
+ }
120
+ }
121
+ if (uspConsent && uspConsent.consentString) {
122
+ syncUrl += `&ccpa_consent=${uspConsent.consentString}`;
123
+ }
124
+
125
+ const coppa = config.getConfig('coppa') ? 1 : 0;
126
+ syncUrl += `&coppa=${coppa}`;
127
+
128
+ return [{
129
+ type: syncType,
130
+ url: syncUrl
131
+ }];
132
+ }
105
133
  };
106
134
 
107
135
  registerBidder(spec);
@@ -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
  }
@@ -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.9';
13
14
 
14
15
  function isBidRequestValid(bid) {
15
16
  const adUnitSizes = getAdUnitSizes(bid);
@@ -43,7 +44,7 @@ function buildRequests(validBidRequests, bidderRequest) {
43
44
  at: 2,
44
45
  regs: {
45
46
  ext: {
46
- gdpr: 1
47
+ gdpr: bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies ? 1 : 0
47
48
  },
48
49
  },
49
50
  site: {
@@ -55,17 +56,14 @@ 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
- if (bidderRequest.hasOwnProperty('gdprConsent') &&
62
- bidderRequest.gdprConsent.hasOwnProperty('gdprApplies')) {
63
- openRtbBidRequestBanner.regs.ext.gdpr = bidderRequest.gdprConsent.gdprApplies ? 1 : 0
64
- }
65
-
66
- if (bidderRequest.hasOwnProperty('gdprConsent') &&
67
- bidderRequest.gdprConsent.hasOwnProperty('consentString') &&
68
- bidderRequest.gdprConsent.consentString.length > 0) {
66
+ if (bidderRequest.gdprConsent && bidderRequest.gdprConsent.consentString) {
69
67
  openRtbBidRequestBanner.user.ext.consent = bidderRequest.gdprConsent.consentString
70
68
  }
71
69
 
@@ -73,7 +71,7 @@ function buildRequests(validBidRequests, bidderRequest) {
73
71
  const sizes = getAdUnitSizes(bidRequest)
74
72
  .map(size => ({ w: size[0], h: size[1] }));
75
73
 
76
- if (bidRequest.hasOwnProperty('mediaTypes') &&
74
+ if (bidRequest.mediaTypes &&
77
75
  bidRequest.mediaTypes.hasOwnProperty('banner')) {
78
76
  openRtbBidRequestBanner.site.id = bidRequest.params.assetKey;
79
77
 
@@ -123,7 +121,9 @@ function interpretResponse(openRtbBidResponse) {
123
121
  meta: {
124
122
  advertiserDomains: bid.adomain
125
123
  },
126
- nurl: bid.nurl
124
+ nurl: bid.nurl,
125
+ adapterVersion: ADAPTER_VERSION,
126
+ prebidVersion: '$prebid.version$'
127
127
  };
128
128
 
129
129
  bidResponse.ad = bid.adm;
@@ -159,11 +159,11 @@ function onBidWon(bid) {
159
159
  w.OG_PREBID_BID_OBJECT = {
160
160
  ...(bid && { ...bid }),
161
161
  }
162
- if (bid && bid.hasOwnProperty('nurl') && bid.nurl.length > 0) ajax(bid['nurl'], null);
162
+ if (bid && bid.nurl) ajax(bid.nurl, null);
163
163
  }
164
164
 
165
165
  function onTimeout(timeoutData) {
166
- ajax(`${TIMEOUT_MONITORING_HOST}/bid_timeout`, null, JSON.stringify(timeoutData[0]), {
166
+ ajax(`${TIMEOUT_MONITORING_HOST}/bid_timeout`, null, JSON.stringify({...timeoutData[0], location: window.location.href}), {
167
167
  method: 'POST',
168
168
  contentType: 'application/json'
169
169
  });
@@ -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;
@@ -0,0 +1,147 @@
1
+ import { registerBidder } from '../src/adapters/bidderFactory.js';
2
+ const BIDDER_CODE = 'pilotx';
3
+ const ENDPOINT_URL = '//adn.pilotx.tv/hb'
4
+ export const spec = {
5
+ code: BIDDER_CODE,
6
+ supportedMediaTypes: ['banner', 'video'],
7
+ aliases: ['pilotx'], // short code
8
+ /**
9
+ * Determines whether or not the given bid request is valid.
10
+ *
11
+ * @param {BidRequest} bid The bid params to validate.
12
+ * @return boolean True if this is a valid bid, and false otherwise.
13
+ */
14
+ isBidRequestValid: function (bid) {
15
+ let sizesCheck = !!bid.sizes
16
+ let paramSizesCheck = !!bid.params.sizes
17
+ var sizeConfirmed = false
18
+ if (sizesCheck) {
19
+ if (bid.sizes.length < 1) {
20
+ return false
21
+ } else {
22
+ sizeConfirmed = true
23
+ }
24
+ }
25
+ if (paramSizesCheck) {
26
+ if (bid.params.sizes.length < 1 && !sizeConfirmed) {
27
+ return false
28
+ } else {
29
+ sizeConfirmed = true
30
+ }
31
+ }
32
+ if (!sizeConfirmed) {
33
+ return false
34
+ }
35
+ return !!(bid.params.placementId);
36
+ },
37
+ /**
38
+ * Make a server request from the list of BidRequests.
39
+ *
40
+ * @param {validBidRequests[]} - an array of bids
41
+ * @return ServerRequest Info describing the request to the server.
42
+ */
43
+ buildRequests: function (validBidRequests, bidderRequest) {
44
+ let payloadItems = {};
45
+ validBidRequests.forEach(bidRequest => {
46
+ let sizes = [];
47
+ let placementId = this.setPlacementID(bidRequest.params.placementId)
48
+ payloadItems[placementId] = {}
49
+ if (bidRequest.sizes.length > 0) {
50
+ if (Array.isArray(bidRequest.sizes[0])) {
51
+ for (let i = 0; i < bidRequest.sizes.length; i++) {
52
+ sizes[i] = [(bidRequest.sizes[i])[0], (bidRequest.sizes[i])[1]]
53
+ }
54
+ } else {
55
+ sizes[0] = [bidRequest.sizes[0], bidRequest.sizes[1]]
56
+ }
57
+ payloadItems[placementId]['sizes'] = sizes
58
+ }
59
+ if (bidRequest.mediaTypes != null) {
60
+ for (let i in bidRequest.mediaTypes) {
61
+ payloadItems[placementId][i] = {
62
+ ...bidRequest.mediaTypes[i]
63
+ }
64
+ }
65
+ }
66
+ let consentTemp = ''
67
+ let consentRequiredTemp = false
68
+ if (bidderRequest && bidderRequest.gdprConsent) {
69
+ consentTemp = bidderRequest.gdprConsent.consentString
70
+ // will check if the gdprApplies field was populated with a boolean value (ie from page config). If it's undefined, then default to true
71
+ consentRequiredTemp = (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') ? bidderRequest.gdprConsent.gdprApplies : true
72
+ }
73
+
74
+ payloadItems[placementId]['gdprConsentString'] = consentTemp
75
+ payloadItems[placementId]['gdprConsentRequired'] = consentRequiredTemp
76
+ payloadItems[placementId]['bidId'] = bidRequest.bidId
77
+ });
78
+ const payload = payloadItems;
79
+ const payloadString = JSON.stringify(payload);
80
+ return {
81
+ method: 'POST',
82
+ url: ENDPOINT_URL,
83
+ data: payloadString,
84
+ };
85
+ },
86
+ /**
87
+ * Unpack the response from the server into a list of bids.
88
+ *
89
+ * @param {ServerResponse} serverResponse A successful response from the server.
90
+ * @return {Bid[]} An array of bids which were nested inside the server.
91
+ */
92
+ interpretResponse: function (serverResponse, bidRequest) {
93
+ const serverBody = serverResponse.body;
94
+ const bidResponses = [];
95
+ if (serverBody.mediaType == 'banner') {
96
+ const bidResponse = {
97
+ requestId: serverBody.requestId,
98
+ cpm: serverBody.cpm,
99
+ width: serverBody.width,
100
+ height: serverBody.height,
101
+ creativeId: serverBody.creativeId,
102
+ currency: serverBody.currency,
103
+ netRevenue: false,
104
+ ttl: serverBody.ttl,
105
+ ad: serverBody.ad,
106
+ mediaType: 'banner',
107
+ meta: {
108
+ mediaType: 'banner',
109
+ advertiserDomains: serverBody.advertiserDomains
110
+ }
111
+ }
112
+ bidResponses.push(bidResponse)
113
+ } else if (serverBody.mediaType == 'video') {
114
+ const bidResponse = {
115
+ requestId: serverBody.requestId,
116
+ cpm: serverBody.cpm,
117
+ width: serverBody.width,
118
+ height: serverBody.height,
119
+ creativeId: serverBody.creativeId,
120
+ currency: serverBody.currency,
121
+ netRevenue: false,
122
+ ttl: serverBody.ttl,
123
+ vastUrl: serverBody.vastUrl,
124
+ mediaType: 'video',
125
+ meta: {
126
+ mediaType: 'video',
127
+ advertiserDomains: serverBody.advertiserDomains
128
+ }
129
+ }
130
+ bidResponses.push(bidResponse)
131
+ }
132
+
133
+ return bidResponses;
134
+ },
135
+
136
+ /**
137
+ * Formats placement ids for adserver ingestion purposes
138
+ * @param {string[]} The placement ID/s in an array
139
+ */
140
+ setPlacementID: function (placementId) {
141
+ if (Array.isArray(placementId)) {
142
+ return placementId.join('#')
143
+ }
144
+ return placementId
145
+ },
146
+ }
147
+ registerBidder(spec);
@@ -0,0 +1,50 @@
1
+ # Overview
2
+
3
+ ```
4
+ Module Name: Pilotx Prebid Adapter
5
+ Module Type: Bidder Adapter
6
+ Maintainer: tony@pilotx.tv
7
+ ```
8
+
9
+ # Description
10
+
11
+ Connects to Pilotx
12
+
13
+ Pilotx's bid adapter supports banner and video.
14
+
15
+ # Test Parameters
16
+ ```
17
+ // Banner adUnit
18
+ var adUnits = [{
19
+ code: 'div-gpt-ad-1460505748561-0',
20
+ mediaTypes: {
21
+ banner: {
22
+ sizes: [[300, 250], [300,600]],
23
+ }
24
+ },
25
+ bids: [{
26
+ bidder: 'pilotx',
27
+ params: {
28
+ placementId: ["1423"]
29
+ }
30
+ }]
31
+
32
+ }];
33
+
34
+ // Video adUnit
35
+ var videoAdUnit = {
36
+ code: 'video1',
37
+ mediaTypes: {
38
+ video: {
39
+ context: 'instream',
40
+ playerSize: [640, 480],
41
+ }
42
+ },
43
+ bids: [{
44
+ bidder: 'pilotx',
45
+ params: {
46
+ placementId: '1422',
47
+ }
48
+ }]
49
+ };
50
+ ```
@@ -8,6 +8,7 @@ import { getHook } from '../src/hook.js';
8
8
  import { createBid } from '../src/bidfactory.js';
9
9
  import find from 'core-js-pure/features/array/find.js';
10
10
  import { getRefererInfo } from '../src/refererDetection.js';
11
+ import {bidderSettings} from '../src/bidderSettings.js';
11
12
 
12
13
  /**
13
14
  * @summary This Module is intended to provide users with the ability to dynamically set and enforce price floors on a per auction basis.
@@ -147,7 +148,7 @@ function generatePossibleEnumerations(arrayOfFields, delimiter) {
147
148
  * @summary If a the input bidder has a registered cpmadjustment it returns the input CPM after being adjusted
148
149
  */
149
150
  export function getBiddersCpmAdjustment(bidderName, inputCpm, bid = {}) {
150
- const adjustmentFunction = deepAccess(getGlobal(), `bidderSettings.${bidderName}.bidCpmAdjustment`) || deepAccess(getGlobal(), 'bidderSettings.standard.bidCpmAdjustment');
151
+ const adjustmentFunction = bidderSettings.get(bidderName, 'bidCpmAdjustment');
151
152
  if (adjustmentFunction) {
152
153
  return parseFloat(adjustmentFunction(inputCpm, {...bid, cpm: inputCpm}));
153
154
  }
@@ -172,8 +172,6 @@ function interpretResponse(serverResponse, bidRequest) {
172
172
 
173
173
  function _assignFloor(bid) {
174
174
  if (!isFn(bid.getFloor)) {
175
- // eslint-disable-next-line no-console
176
- console.log(bid.params.bidFloor);
177
175
  return bid.params.bidFloor ? bid.params.bidFloor : null;
178
176
  }
179
177
  const floor = bid.getFloor({
@@ -200,6 +200,21 @@ function getAdapterNameForAlias(aliasName) {
200
200
  return adapterManager.aliasRegistry[aliasName] || aliasName;
201
201
  }
202
202
 
203
+ function getAdDomain(bidResponse) {
204
+ if (bidResponse.meta && bidResponse.meta.advertiserDomains) {
205
+ let adomain = bidResponse.meta.advertiserDomains[0]
206
+ if (adomain) {
207
+ try {
208
+ let hostname = (new URL(adomain));
209
+ return hostname.hostname.replace('www.', '');
210
+ } catch (e) {
211
+ logWarn(LOG_PRE_FIX + 'Adomain URL (Not a proper URL):', adomain);
212
+ return adomain.replace('www.', '');
213
+ }
214
+ }
215
+ }
216
+ }
217
+
203
218
  function gatherPartnerBidsForAdUnitForLogger(adUnit, adUnitId, highestBid) {
204
219
  highestBid = (highestBid && highestBid.length > 0) ? highestBid[0] : null;
205
220
  return Object.keys(adUnit.bids).reduce(function(partnerBids, bidId) {
@@ -218,6 +233,7 @@ function gatherPartnerBidsForAdUnitForLogger(adUnit, adUnitId, highestBid) {
218
233
  'dc': bid.bidResponse ? (bid.bidResponse.dealChannel || EMPTY_STRING) : EMPTY_STRING,
219
234
  'l1': bid.bidResponse ? bid.clientLatencyTimeMs : 0,
220
235
  'l2': 0,
236
+ 'adv': bid.bidResponse ? getAdDomain(bid.bidResponse) || undefined : undefined,
221
237
  'ss': (s2sBidders.indexOf(bid.bidder) > -1) ? 1 : 0,
222
238
  't': (bid.status == ERROR && bid.error.code == TIMEOUT_ERROR) ? 1 : 0,
223
239
  'wb': (highestBid && highestBid.requestId === bid.bidId ? 1 : 0),
@@ -1,4 +1,4 @@
1
- import { isEmpty, deepAccess, isStr } from '../src/utils.js';
1
+ import {isEmpty, deepAccess, isStr} from '../src/utils.js';
2
2
  import {registerBidder} from '../src/adapters/bidderFactory.js';
3
3
  import {config} from '../src/config.js';
4
4
  import {BANNER, VIDEO} from '../src/mediaTypes.js';
@@ -52,16 +52,22 @@ export const spec = {
52
52
  videoData: raiGetVideoInfo(bid),
53
53
  scr_rsl: raiGetResolution(),
54
54
  cpuc: (typeof window.navigator != 'undefined' ? window.navigator.hardwareConcurrency : null),
55
- kws: (!isEmpty(bid.params.keywords) ? bid.params.keywords : null)
55
+ kws: (!isEmpty(bid.params.keywords) ? bid.params.keywords : null),
56
+ schain: bid.schain
56
57
  };
57
58
 
58
59
  REFERER = (typeof bidderRequest.refererInfo.referer != 'undefined' ? encodeURIComponent(bidderRequest.refererInfo.referer) : null)
59
60
 
60
61
  payload.gdpr_consent = '';
61
- payload.gdpr = bidderRequest.gdprConsent.gdprApplies;
62
+ payload.gdpr = false;
62
63
 
63
64
  if (bidderRequest && bidderRequest.gdprConsent) {
64
- payload.gdpr_consent = bidderRequest.gdprConsent.consentString;
65
+ if (typeof bidderRequest.gdprConsent.gdprApplies != 'undefined') {
66
+ payload.gdpr = bidderRequest.gdprConsent.gdprApplies;
67
+ }
68
+ if (typeof bidderRequest.gdprConsent.consentString != 'undefined') {
69
+ payload.gdpr_consent = bidderRequest.gdprConsent.consentString;
70
+ }
65
71
  }
66
72
 
67
73
  var payloadString = JSON.stringify(payload);
@@ -1,4 +1,4 @@
1
- import { logWarn, isArray, isFn, deepAccess, isEmpty, contains, timestamp, getBidIdParameter } from '../src/utils.js';
1
+ import { logWarn, logInfo, isArray, isFn, deepAccess, isEmpty, contains, timestamp, getBidIdParameter, triggerPixel } from '../src/utils.js';
2
2
  import {registerBidder} from '../src/adapters/bidderFactory.js';
3
3
  import {VIDEO} from '../src/mediaTypes.js';
4
4
  import {config} from '../src/config.js';
@@ -23,7 +23,7 @@ export const spec = {
23
23
  gvlid: 1043,
24
24
  version: ADAPTER_VERSION,
25
25
  supportedMediaTypes: SUPPORTED_AD_TYPES,
26
- isBidRequestValid: function(bidRequest) {
26
+ isBidRequestValid: function (bidRequest) {
27
27
  if (!bidRequest.params) {
28
28
  logWarn('no params have been set to Rise adapter');
29
29
  return false;
@@ -49,7 +49,7 @@ export const spec = {
49
49
 
50
50
  return requests;
51
51
  },
52
- interpretResponse: function({body}) {
52
+ interpretResponse: function ({body}) {
53
53
  const bidResponses = [];
54
54
 
55
55
  const bidResponse = {
@@ -62,6 +62,7 @@ export const spec = {
62
62
  netRevenue: body.netRevenue,
63
63
  ttl: body.ttl || TTL,
64
64
  vastXml: body.vastXml,
65
+ nurl: body.nurl,
65
66
  mediaType: VIDEO
66
67
  };
67
68
 
@@ -73,7 +74,7 @@ export const spec = {
73
74
 
74
75
  return bidResponses;
75
76
  },
76
- getUserSyncs: function(syncOptions, serverResponses) {
77
+ getUserSyncs: function (syncOptions, serverResponses) {
77
78
  const syncs = [];
78
79
  for (const response of serverResponses) {
79
80
  if (syncOptions.iframeEnabled && response.body.userSyncURL) {
@@ -93,8 +94,18 @@ export const spec = {
93
94
  }
94
95
  }
95
96
  return syncs;
96
- }
97
- };
97
+ },
98
+ onBidWon: function (bid) {
99
+ if (bid == null) {
100
+ return;
101
+ }
102
+
103
+ logInfo('onBidWon:', bid);
104
+ if (bid.hasOwnProperty('nurl') && bid.nurl.length > 0) {
105
+ triggerPixel(bid.nurl);
106
+ }
107
+ },
108
+ }
98
109
 
99
110
  registerBidder(spec);
100
111
 
@@ -159,7 +170,7 @@ function getSupplyChain(schainObject) {
159
170
  scStr += '!';
160
171
  scStr += `${getEncodedValIfNotEmpty(node.asi)},`;
161
172
  scStr += `${getEncodedValIfNotEmpty(node.sid)},`;
162
- scStr += `${getEncodedValIfNotEmpty(node.hp)},`;
173
+ scStr += `${node.hp ? encodeURIComponent(node.hp) : ''},`;
163
174
  scStr += `${getEncodedValIfNotEmpty(node.rid)},`;
164
175
  scStr += `${getEncodedValIfNotEmpty(node.name)},`;
165
176
  scStr += `${getEncodedValIfNotEmpty(node.domain)}`;
@@ -165,16 +165,26 @@ function mapBanner(slot) {
165
165
  * @returns {object} Site by OpenRTB 2.5 §3.2.13
166
166
  */
167
167
  function mapSite(slot, bidderRequest) {
168
- const pubId = slot && slot.length > 0
169
- ? slot[0].params.publisherId
170
- : 'unknown';
171
- return {
168
+ let pubId = 'unknown';
169
+ let channel = null;
170
+ if (slot && slot.length > 0) {
171
+ pubId = slot[0].params.publisherId;
172
+ channel = slot[0].params.channel &&
173
+ slot[0].params.channel
174
+ .toString()
175
+ .slice(0, 50);
176
+ }
177
+ let siteData = {
172
178
  publisher: {
173
179
  id: pubId.toString(),
174
180
  },
175
181
  page: bidderRequest.refererInfo.referer,
176
182
  name: getOrigin()
183
+ };
184
+ if (channel) {
185
+ siteData.channel = channel;
177
186
  }
187
+ return siteData;
178
188
  }
179
189
 
180
190
  /**