prebid.js 5.17.0 → 6.0.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 (145) hide show
  1. package/.babelrc.js +3 -6
  2. package/README.md +3 -1
  3. package/browsers.json +1 -8
  4. package/integrationExamples/gpt/akamaidap_segments_example.html +132 -0
  5. package/modules/.submodules.json +1 -0
  6. package/modules/adfBidAdapter.js +21 -16
  7. package/modules/adgenerationBidAdapter.js +28 -4
  8. package/modules/adkernelBidAdapter.js +2 -1
  9. package/modules/admixerBidAdapter.js +11 -0
  10. package/modules/adtelligentBidAdapter.js +2 -1
  11. package/modules/airgridRtdProvider.js +1 -1
  12. package/modules/akamaiDapRtdProvider.js +474 -0
  13. package/modules/akamaiDapRtdProvider.md +47 -0
  14. package/modules/aolBidAdapter.js +2 -1
  15. package/modules/appnexusBidAdapter.js +5 -3
  16. package/modules/atsAnalyticsAdapter.js +67 -46
  17. package/modules/atsAnalyticsAdapter.md +1 -0
  18. package/modules/betweenBidAdapter.js +20 -3
  19. package/modules/bliinkBidAdapter.js +58 -32
  20. package/modules/bliinkBidAdapter.md +29 -6
  21. package/modules/browsiRtdProvider.js +106 -18
  22. package/modules/cleanioRtdProvider.js +192 -0
  23. package/modules/cleanioRtdProvider.md +59 -0
  24. package/modules/codefuelBidAdapter.js +183 -0
  25. package/modules/codefuelBidAdapter.md +111 -0
  26. package/modules/connectIdSystem.js +104 -0
  27. package/modules/connectIdSystem.md +33 -0
  28. package/modules/cwireBidAdapter.js +272 -0
  29. package/modules/cwireBidAdapter.md +43 -0
  30. package/modules/deepintentBidAdapter.js +106 -9
  31. package/modules/deepintentBidAdapter.md +36 -1
  32. package/modules/deltaprojectsBidAdapter.js +252 -0
  33. package/modules/deltaprojectsBidAdapter.md +32 -0
  34. package/modules/dgkeywordRtdProvider.js +0 -1
  35. package/modules/engageyaBidAdapter.js +157 -0
  36. package/modules/gridBidAdapter.js +1 -0
  37. package/modules/gumgumBidAdapter.js +8 -0
  38. package/modules/inskinBidAdapter.js +7 -3
  39. package/modules/ixBidAdapter.js +8 -1
  40. package/modules/jixieBidAdapter.js +8 -2
  41. package/modules/justpremiumBidAdapter.js +6 -1
  42. package/modules/limelightDigitalBidAdapter.js +22 -2
  43. package/modules/livewrappedAnalyticsAdapter.js +53 -3
  44. package/modules/mediakeysBidAdapter.js +2 -1
  45. package/modules/multibid/index.js +3 -3
  46. package/modules/nativoBidAdapter.js +6 -2
  47. package/modules/nextMillenniumBidAdapter.js +12 -3
  48. package/modules/oguryBidAdapter.js +36 -7
  49. package/modules/openxBidAdapter.js +34 -22
  50. package/modules/operaadsBidAdapter.js +21 -1
  51. package/modules/otmBidAdapter.js +146 -0
  52. package/modules/otmBidAdapter.md +27 -26
  53. package/modules/outbrainBidAdapter.js +5 -0
  54. package/modules/pixfutureBidAdapter.js +24 -4
  55. package/modules/pixfutureBidAdapter.md +127 -0
  56. package/modules/playwireBidAdapter.md +61 -0
  57. package/modules/prebidServerBidAdapter/index.js +1 -1
  58. package/modules/proxistoreBidAdapter.js +4 -6
  59. package/modules/publinkIdSystem.js +11 -6
  60. package/modules/pubmaticBidAdapter.js +9 -0
  61. package/modules/pubmaticBidAdapter.md +1 -1
  62. package/modules/rtdModule/index.js +2 -2
  63. package/modules/sonobiBidAdapter.js +7 -0
  64. package/modules/sortableBidAdapter.js +1 -0
  65. package/modules/talkadsBidAdapter.js +129 -0
  66. package/modules/talkadsBidAdapter.md +60 -0
  67. package/modules/teadsBidAdapter.js +3 -0
  68. package/modules/tripleliftBidAdapter.js +22 -5
  69. package/modules/trustxBidAdapter.js +8 -6
  70. package/modules/undertoneBidAdapter.js +9 -5
  71. package/modules/undertoneBidAdapter.md +5 -1
  72. package/modules/unicornBidAdapter.js +3 -3
  73. package/modules/userId/eids.js +18 -0
  74. package/modules/userId/eids.md +7 -0
  75. package/modules/userId/userId.md +12 -0
  76. package/modules/ventesBidAdapter.js +370 -0
  77. package/modules/ventesBidAdapter.md +94 -0
  78. package/modules/videobyteBidAdapter.js +13 -6
  79. package/modules/videobyteBidAdapter.md +49 -0
  80. package/modules/visxBidAdapter.js +15 -22
  81. package/modules/yahoosspBidAdapter.js +637 -0
  82. package/modules/yahoosspBidAdapter.md +795 -0
  83. package/modules/yieldlabBidAdapter.js +48 -3
  84. package/modules/yieldlabBidAdapter.md +16 -1
  85. package/modules/yieldmoSyntheticInventoryModule.js +46 -0
  86. package/modules/yieldmoSyntheticInventoryModule.md +68 -0
  87. package/package.json +1 -1
  88. package/src/adapterManager.js +5 -0
  89. package/src/adapters/bidderFactory.js +4 -3
  90. package/src/auction.js +11 -11
  91. package/src/constants.json +1 -0
  92. package/src/secureCreatives.js +6 -7
  93. package/src/targeting.js +11 -9
  94. package/test/spec/modules/adfBidAdapter_spec.js +83 -29
  95. package/test/spec/modules/adgenerationBidAdapter_spec.js +121 -50
  96. package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
  97. package/test/spec/modules/akamaiDapRtdProvider_spec.js +246 -0
  98. package/test/spec/modules/appnexusBidAdapter_spec.js +2 -1
  99. package/test/spec/modules/atsAnalyticsAdapter_spec.js +42 -9
  100. package/test/spec/modules/betweenBidAdapter_spec.js +41 -0
  101. package/test/spec/modules/bliinkBidAdapter_spec.js +87 -36
  102. package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
  103. package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
  104. package/test/spec/modules/codefuelBidAdapter_spec.js +316 -0
  105. package/test/spec/modules/connectIdSystem_spec.js +189 -0
  106. package/test/spec/modules/cwireBidAdapter_spec.js +246 -0
  107. package/test/spec/modules/deepintentBidAdapter_spec.js +153 -3
  108. package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
  109. package/test/spec/modules/engageyaBidAdapter_spec.js +286 -0
  110. package/test/spec/modules/gumgumBidAdapter_spec.js +5 -1
  111. package/test/spec/modules/ixBidAdapter_spec.js +13 -3
  112. package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
  113. package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
  114. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +155 -1
  115. package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +67 -12
  116. package/test/spec/modules/multibid_spec.js +31 -31
  117. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +13 -1
  118. package/test/spec/modules/oguryBidAdapter_spec.js +125 -37
  119. package/test/spec/modules/openxBidAdapter_spec.js +85 -13
  120. package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
  121. package/test/spec/modules/otmBidAdapter_spec.js +67 -0
  122. package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
  123. package/test/spec/modules/publinkIdSystem_spec.js +6 -6
  124. package/test/spec/modules/pubmaticBidAdapter_spec.js +39 -1
  125. package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
  126. package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
  127. package/test/spec/modules/talkadsBidAdapter_spec.js +231 -0
  128. package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
  129. package/test/spec/modules/tripleliftBidAdapter_spec.js +128 -0
  130. package/test/spec/modules/trustxBidAdapter_spec.js +3 -3
  131. package/test/spec/modules/undertoneBidAdapter_spec.js +52 -0
  132. package/test/spec/modules/unicornBidAdapter_spec.js +4 -4
  133. package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
  134. package/test/spec/modules/videobyteBidAdapter_spec.js +2 -2
  135. package/test/spec/modules/visxBidAdapter_spec.js +48 -4
  136. package/test/spec/modules/yahoosspBidAdapter_spec.js +1332 -0
  137. package/test/spec/modules/yieldlabBidAdapter_spec.js +65 -1
  138. package/test/spec/modules/yieldmoSyntheticInventoryModule_spec.js +89 -0
  139. package/test/spec/unit/core/adapterManager_spec.js +32 -0
  140. package/test/spec/unit/core/bidderFactory_spec.js +61 -1
  141. package/test/spec/unit/pbjs_api_spec.js +37 -2
  142. package/test/spec/unit/secureCreatives_spec.js +54 -25
  143. package/wdio.conf.js +1 -1
  144. package/modules/turktelekomBidAdapter.md +0 -49
  145. package/yarn.lock +0 -13122
@@ -0,0 +1,252 @@
1
+ import { registerBidder } from '../src/adapters/bidderFactory.js';
2
+ import { BANNER } from '../src/mediaTypes.js';
3
+ import {
4
+ _each, _map, isFn, isNumber, createTrackPixelHtml, deepAccess, parseUrl, logWarn, logError
5
+ } from '../src/utils.js';
6
+ import {config} from '../src/config.js';
7
+
8
+ export const BIDDER_CODE = 'deltaprojects';
9
+ export const BIDDER_ENDPOINT_URL = 'https://d5p.de17a.com/dogfight/prebid';
10
+ export const USERSYNC_URL = 'https://userservice.de17a.com/getuid/prebid';
11
+
12
+ /** -- isBidRequestValid --**/
13
+ function isBidRequestValid(bid) {
14
+ if (!bid) return false;
15
+
16
+ if (bid.bidder !== BIDDER_CODE) return false;
17
+
18
+ // publisher id is required
19
+ const publisherId = deepAccess(bid, 'params.publisherId')
20
+ if (!publisherId) {
21
+ logError('Invalid bid request, missing publisher id in params');
22
+ return false;
23
+ }
24
+
25
+ return true;
26
+ }
27
+
28
+ /** -- Build requests --**/
29
+ function buildRequests(validBidRequests, bidderRequest) {
30
+ /** == shared ==**/
31
+ // -- build id
32
+ const id = bidderRequest.auctionId;
33
+
34
+ // -- build site
35
+ const loc = parseUrl(bidderRequest.refererInfo.referer);
36
+ const publisherId = setOnAny(validBidRequests, 'params.publisherId');
37
+ const siteId = setOnAny(validBidRequests, 'params.siteId');
38
+ const site = {
39
+ id: siteId,
40
+ domain: loc.hostname,
41
+ page: loc.href,
42
+ ref: loc.href,
43
+ publisher: { id: publisherId },
44
+ };
45
+
46
+ // -- build device
47
+ const ua = navigator.userAgent;
48
+ const device = {
49
+ ua,
50
+ w: screen.width,
51
+ h: screen.height
52
+ }
53
+
54
+ // -- build user, reg
55
+ let user = { ext: {} };
56
+ const regs = { ext: {} };
57
+ const gdprConsent = bidderRequest && bidderRequest.gdprConsent;
58
+ if (gdprConsent) {
59
+ user.ext = { consent: gdprConsent.consentString };
60
+ if (typeof gdprConsent.gdprApplies == 'boolean') {
61
+ regs.ext.gdpr = gdprConsent.gdprApplies ? 1 : 0
62
+ }
63
+ }
64
+
65
+ // -- build tmax
66
+ let tmax = (bidderRequest && bidderRequest.timeout > 0) ? bidderRequest.timeout : undefined;
67
+
68
+ // build bid specific
69
+ return validBidRequests.map(validBidRequest => {
70
+ const openRTBRequest = buildOpenRTBRequest(validBidRequest, id, site, device, user, tmax, regs);
71
+ return {
72
+ method: 'POST',
73
+ url: BIDDER_ENDPOINT_URL,
74
+ data: openRTBRequest,
75
+ options: { contentType: 'application/json' },
76
+ bids: [validBidRequest],
77
+ };
78
+ });
79
+ }
80
+
81
+ function buildOpenRTBRequest(validBidRequest, id, site, device, user, tmax, regs) {
82
+ // build cur
83
+ const currency = config.getConfig('currency.adServerCurrency') || deepAccess(validBidRequest, 'params.currency');
84
+ const cur = currency && [currency];
85
+
86
+ // build impression
87
+ const impression = buildImpression(validBidRequest, currency);
88
+
89
+ // build test
90
+ const test = deepAccess(validBidRequest, 'params.test') ? 1 : 0
91
+
92
+ const at = 1
93
+
94
+ // build source
95
+ const source = {
96
+ tid: validBidRequest.transactionId,
97
+ fd: 1,
98
+ }
99
+
100
+ return {
101
+ id,
102
+ at,
103
+ imp: [impression],
104
+ site,
105
+ device,
106
+ user,
107
+ test,
108
+ tmax,
109
+ cur,
110
+ source,
111
+ regs,
112
+ ext: {},
113
+ };
114
+ }
115
+
116
+ function buildImpression(bid, currency) {
117
+ const impression = {
118
+ id: bid.bidId,
119
+ tagid: bid.params.tagId,
120
+ ext: {},
121
+ };
122
+
123
+ const bannerMediaType = deepAccess(bid, `mediaTypes.${BANNER}`);
124
+ impression.banner = buildImpressionBanner(bid, bannerMediaType);
125
+
126
+ // bid floor
127
+ const bidFloor = getBidFloor(bid, BANNER, '*', currency);
128
+ if (bidFloor) {
129
+ impression.bidfloor = bidFloor.floor;
130
+ impression.bidfloorcur = bidFloor.currency;
131
+ }
132
+
133
+ return impression;
134
+ }
135
+
136
+ function buildImpressionBanner(bid, bannerMediaType) {
137
+ const bannerSizes = (bannerMediaType && bannerMediaType.sizes) || bid.sizes;
138
+ return {
139
+ format: _map(bannerSizes, ([width, height]) => ({ w: width, h: height })),
140
+ };
141
+ }
142
+
143
+ /** -- Interpret response --**/
144
+ function interpretResponse(serverResponse) {
145
+ if (!serverResponse.body) {
146
+ logWarn('Response body is invalid, return !!');
147
+ return [];
148
+ }
149
+
150
+ const { body: { id, seatbid, cur } } = serverResponse;
151
+ if (!id || !seatbid) {
152
+ logWarn('Id / seatbid of response is invalid, return !!');
153
+ return [];
154
+ }
155
+
156
+ const bidResponses = [];
157
+
158
+ _each(seatbid, seatbid => {
159
+ _each(seatbid.bid, bid => {
160
+ const bidObj = {
161
+ requestId: bid.impid,
162
+ cpm: parseFloat(bid.price),
163
+ width: parseInt(bid.w),
164
+ height: parseInt(bid.h),
165
+ creativeId: bid.crid || bid.id,
166
+ dealId: bid.dealid || null,
167
+ currency: cur,
168
+ netRevenue: true,
169
+ ttl: 60,
170
+ };
171
+
172
+ bidObj.mediaType = BANNER;
173
+ bidObj.ad = bid.adm;
174
+ if (bid.nurl) {
175
+ bidObj.ad += createTrackPixelHtml(decodeURIComponent(bid.nurl));
176
+ }
177
+ if (bid.ext) {
178
+ bidObj[BIDDER_CODE] = bid.ext;
179
+ }
180
+ bidResponses.push(bidObj);
181
+ });
182
+ });
183
+ return bidResponses;
184
+ }
185
+
186
+ /** -- On Bid Won -- **/
187
+ function onBidWon(bid) {
188
+ let cpm = bid.cpm;
189
+ if (bid.currency && bid.currency !== bid.originalCurrency && typeof bid.getCpmInNewCurrency === 'function') {
190
+ cpm = bid.getCpmInNewCurrency(bid.originalCurrency);
191
+ }
192
+ const wonPrice = Math.round(cpm * 1000000);
193
+ const wonPriceMacroPatten = /\$\{AUCTION_PRICE:B64\}/g;
194
+ bid.ad = bid.ad.replace(wonPriceMacroPatten, wonPrice);
195
+ }
196
+
197
+ /** -- Get user syncs --**/
198
+ function getUserSyncs(syncOptions, serverResponses, gdprConsent) {
199
+ const syncs = []
200
+
201
+ if (syncOptions.pixelEnabled) {
202
+ let gdprParams;
203
+ if (gdprConsent) {
204
+ if (typeof gdprConsent.gdprApplies === 'boolean') {
205
+ gdprParams = `?gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
206
+ } else {
207
+ gdprParams = `?gdpr_consent=${gdprConsent.consentString}`;
208
+ }
209
+ } else {
210
+ gdprParams = '';
211
+ }
212
+ syncs.push({
213
+ type: 'image',
214
+ url: USERSYNC_URL + gdprParams
215
+ });
216
+ }
217
+ return syncs;
218
+ }
219
+
220
+ /** -- Get bid floor --**/
221
+ export function getBidFloor(bid, mediaType, size, currency) {
222
+ if (isFn(bid.getFloor)) {
223
+ const bidFloorCurrency = currency || 'USD';
224
+ const bidFloor = bid.getFloor({currency: bidFloorCurrency, mediaType: mediaType, size: size});
225
+ if (isNumber(bidFloor.floor)) {
226
+ return bidFloor;
227
+ }
228
+ }
229
+ }
230
+
231
+ /** -- Helper methods --**/
232
+ function setOnAny(collection, key) {
233
+ for (let i = 0, result; i < collection.length; i++) {
234
+ result = deepAccess(collection[i], key);
235
+ if (result) {
236
+ return result;
237
+ }
238
+ }
239
+ }
240
+
241
+ /** -- Register -- */
242
+ export const spec = {
243
+ code: BIDDER_CODE,
244
+ supportedMediaTypes: [BANNER],
245
+ isBidRequestValid,
246
+ buildRequests,
247
+ interpretResponse,
248
+ onBidWon,
249
+ getUserSyncs,
250
+ };
251
+
252
+ registerBidder(spec);
@@ -0,0 +1,32 @@
1
+ # Overview
2
+
3
+ ```
4
+ Module Name: Delta Projects Bid Adapter
5
+ Module Type: Bidder Adapter
6
+ Maintainer: dev@deltaprojects.com
7
+ ```
8
+
9
+ # Description
10
+
11
+ Connects to Delta Projects DSP for bids.
12
+
13
+ # Test Parameters
14
+ ```
15
+ // define banner unit
16
+ var bannerUnit = {
17
+ code: 'div-gpt-ad-1460505748561-0',
18
+ mediaTypes: {
19
+ banner: {
20
+ sizes: [[300, 250], [300,600]],
21
+ }
22
+ },
23
+ // Replace this object to test a new Adapter!
24
+ bids: [{
25
+ bidder: 'deltaprojects',
26
+ params: {
27
+ publisherId: '4' //required
28
+ }
29
+ }]
30
+ };
31
+ ```
32
+
@@ -78,7 +78,6 @@ export function getDgKeywordsAndSet(reqBidsConfigObj, callback, moduleConfig, us
78
78
  }
79
79
  }, null, {
80
80
  withCredentials: true,
81
- contentType: 'application/json',
82
81
  });
83
82
  setTimeout(function () {
84
83
  if (!isFinish) {
@@ -0,0 +1,157 @@
1
+ import {
2
+ BANNER,
3
+ NATIVE
4
+ } from '../src/mediaTypes.js';
5
+ import { createTrackPixelHtml } from '../src/utils.js';
6
+
7
+ const {
8
+ registerBidder
9
+ } = require('../src/adapters/bidderFactory.js');
10
+ const BIDDER_CODE = 'engageya';
11
+ const ENDPOINT_URL = 'https://recs.engageya.com/rec-api/getrecs.json';
12
+ const ENDPOINT_METHOD = 'GET';
13
+
14
+ function getPageUrl() {
15
+ var pUrl = window.location.href;
16
+ if (isInIframe()) {
17
+ pUrl = document.referrer ? document.referrer : pUrl;
18
+ }
19
+ pUrl = encodeURIComponent(pUrl);
20
+ return pUrl;
21
+ }
22
+
23
+ function isInIframe() {
24
+ try {
25
+ var isInIframe = (window.self !== window.top);
26
+ } catch (e) {
27
+ isInIframe = true;
28
+ }
29
+ return isInIframe;
30
+ }
31
+
32
+ function getImageSrc(rec) {
33
+ return rec.thumbnail_path.indexOf('http') === -1 ? 'https:' + rec.thumbnail_path : rec.thumbnail_path;
34
+ }
35
+
36
+ function getImpressionTrackers(rec) {
37
+ if (!rec.trackers) {
38
+ return [];
39
+ }
40
+ const impressionTrackers = rec.trackers.impressionPixels || [];
41
+ const viewTrackers = rec.trackers.viewPixels || [];
42
+ return [...impressionTrackers, ...viewTrackers];
43
+ }
44
+
45
+ function parseNativeResponse(rec, response) {
46
+ return {
47
+ title: rec.title,
48
+ body: '',
49
+ image: {
50
+ url: getImageSrc(rec),
51
+ width: response.imageWidth,
52
+ height: response.imageHeight
53
+ },
54
+ privacyLink: '',
55
+ clickUrl: rec.clickUrl,
56
+ displayUrl: rec.url,
57
+ cta: '',
58
+ sponsoredBy: rec.displayName,
59
+ impressionTrackers: getImpressionTrackers(rec),
60
+ };
61
+ }
62
+
63
+ function parseBannerResponse(rec, response) {
64
+ if (rec.tag) {
65
+ return rec.tag;
66
+ }
67
+ let style;
68
+ try {
69
+ let additionalData = JSON.parse(response.widget.additionalData);
70
+ const css = additionalData.css || '';
71
+ style = css ? `<style>${css}</style>` : '';
72
+ } catch (e) {
73
+ style = '';
74
+ }
75
+ const title = rec.title && rec.title.trim() ? `<div class="eng_tag_ttl" style="display: none">${rec.title}</div>` : '';
76
+ const displayName = rec.displayName && title ? `<div class="eng_tag_brnd" style="display: none">${rec.displayName}</div>` : '';
77
+ const trackers = getImpressionTrackers(rec)
78
+ .map(createTrackPixelHtml)
79
+ .join('');
80
+ return `<html><body>${style}<div id="ENG_TAG"><a href="${rec.clickUrl}" target=_blank><img class="eng_tag_img" src="${getImageSrc(rec)}" style="width:${response.imageWidth}px;height:${response.imageHeight}px;" alt="${rec.title}"/>${displayName}${title}</a>${trackers}</div></body></html>`;
81
+ }
82
+
83
+ export const spec = {
84
+ code: BIDDER_CODE,
85
+ supportedMediaTypes: [BANNER, NATIVE],
86
+ isBidRequestValid: function (bid) {
87
+ return bid && bid.params && bid.params.hasOwnProperty('widgetId') && bid.params.hasOwnProperty('websiteId') && !isNaN(bid.params.widgetId) && !isNaN(bid.params.websiteId);
88
+ },
89
+
90
+ buildRequests: function (validBidRequests, bidderRequest) {
91
+ var bidRequests = [];
92
+ if (validBidRequests && validBidRequests.length > 0) {
93
+ validBidRequests.forEach(function (bidRequest) {
94
+ if (bidRequest.params) {
95
+ var mediaType = bidRequest.hasOwnProperty('nativeParams') ? 1 : 2;
96
+ var imageWidth = -1;
97
+ var imageHeight = -1;
98
+ if (bidRequest.sizes && bidRequest.sizes.length > 0) {
99
+ imageWidth = bidRequest.sizes[0][0];
100
+ imageHeight = bidRequest.sizes[0][1];
101
+ } else if (bidRequest.nativeParams && bidRequest.nativeParams.image && bidRequest.nativeParams.image.sizes) {
102
+ imageWidth = bidRequest.nativeParams.image.sizes[0];
103
+ imageHeight = bidRequest.nativeParams.image.sizes[1];
104
+ }
105
+
106
+ var widgetId = bidRequest.params.widgetId;
107
+ var websiteId = bidRequest.params.websiteId;
108
+ var pageUrl = (bidRequest.params.pageUrl && bidRequest.params.pageUrl != '[PAGE_URL]') ? bidRequest.params.pageUrl : '';
109
+ if (!pageUrl) {
110
+ pageUrl = (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.referer) ? bidderRequest.refererInfo.referer : getPageUrl();
111
+ }
112
+ var bidId = bidRequest.bidId;
113
+ var finalUrl = ENDPOINT_URL + '?pubid=0&webid=' + websiteId + '&wid=' + widgetId + '&url=' + pageUrl + '&ireqid=' + bidId + '&pbtpid=' + mediaType + '&imw=' + imageWidth + '&imh=' + imageHeight;
114
+ if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprApplies && bidderRequest.consentString) {
115
+ finalUrl += '&is_gdpr=1&gdpr_consent=' + bidderRequest.consentString;
116
+ }
117
+ bidRequests.push({
118
+ url: finalUrl,
119
+ method: ENDPOINT_METHOD,
120
+ data: ''
121
+ });
122
+ }
123
+ });
124
+ }
125
+
126
+ return bidRequests;
127
+ },
128
+
129
+ interpretResponse: function (serverResponse, bidRequest) {
130
+ if (!serverResponse.body || !serverResponse.body.recs || !serverResponse.body.recs.length) {
131
+ return [];
132
+ }
133
+ var response = serverResponse.body;
134
+ var isNative = response.pbtypeId == 1;
135
+ return response.recs.map(rec => {
136
+ let bid = {
137
+ requestId: response.ireqId,
138
+ cpm: rec.ecpm,
139
+ width: response.imageWidth,
140
+ height: response.imageHeight,
141
+ creativeId: rec.postId,
142
+ currency: 'USD',
143
+ netRevenue: false,
144
+ ttl: 360,
145
+ meta: { advertiserDomains: rec.domain ? [rec.domain] : [] },
146
+ }
147
+ if (isNative) {
148
+ bid.native = parseNativeResponse(rec, response);
149
+ } else {
150
+ bid.ad = parseBannerResponse(rec, response);
151
+ }
152
+ return bid;
153
+ });
154
+ }
155
+ };
156
+
157
+ registerBidder(spec);
@@ -29,6 +29,7 @@ let hasSynced = false;
29
29
 
30
30
  export const spec = {
31
31
  code: BIDDER_CODE,
32
+ aliases: ['playwire'],
32
33
  supportedMediaTypes: [ BANNER, VIDEO ],
33
34
  /**
34
35
  * Determines whether or not the given bid request is valid.
@@ -294,6 +294,14 @@ function buildRequests(validBidRequests, bidderRequest) {
294
294
  let data = {};
295
295
  let gpid = '';
296
296
 
297
+ const date = new Date();
298
+ const lt = date && date.getTime();
299
+ const to = date && date.getTimezoneOffset();
300
+ if (to) {
301
+ lt && (data.lt = lt);
302
+ data.to = to;
303
+ }
304
+
297
305
  // ADTS-134 Retrieve ID envelopes
298
306
  for (const eid in eids) data[eid] = eids[eid];
299
307
 
@@ -55,7 +55,11 @@ export const spec = {
55
55
  parallel: true
56
56
  }, validBidRequests[0].params);
57
57
 
58
- if (data.publisherId) {
58
+ if (validBidRequests[0].schain) {
59
+ data.rtb = {
60
+ schain: validBidRequests[0].schain
61
+ };
62
+ } else if (data.publisherId) {
59
63
  data.rtb = {
60
64
  schain: {
61
65
  ext: {
@@ -63,10 +67,10 @@ export const spec = {
63
67
  }
64
68
  }
65
69
  };
66
-
67
- delete data.publisherId;
68
70
  }
69
71
 
72
+ delete data.publisherId;
73
+
70
74
  data.keywords = data.keywords || [];
71
75
  const restrictions = [];
72
76
 
@@ -490,6 +490,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {
490
490
  r.ext.ixdiag.msd = 0;
491
491
  r.ext.ixdiag.msi = 0;
492
492
  r.imp = [];
493
+ r.at = 1;
493
494
 
494
495
  // getting ixdiags for adunits of the video, outstream & multi format (MF) style
495
496
  let ixdiag = buildIXDiag(validBidRequests);
@@ -645,7 +646,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {
645
646
  }
646
647
 
647
648
  if (impressionObjects.length && BANNER in impressionObjects[0]) {
648
- const { id, banner: { topframe } } = impressionObjects[0];
649
+ const { id, banner: { topframe }, ext } = impressionObjects[0];
649
650
  const _bannerImpression = {
650
651
  id,
651
652
  banner: {
@@ -654,6 +655,12 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {
654
655
  },
655
656
  }
656
657
 
658
+ if (ext.dfp_ad_unit_code) {
659
+ _bannerImpression.ext = {
660
+ dfp_ad_unit_code: ext.dfp_ad_unit_code
661
+ }
662
+ }
663
+
657
664
  if ('bidfloor' in impressionObjects[0]) {
658
665
  _bannerImpression.bidfloor = impressionObjects[0].bidfloor;
659
666
  }
@@ -10,7 +10,7 @@ export const storage = getStorageManager();
10
10
 
11
11
  const BIDDER_CODE = 'jixie';
12
12
  const EVENTS_URL = 'https://hbtra.jixie.io/sync/hb?';
13
- const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.io/jxhboutstream.js';
13
+ const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.media/jxhbrenderer.1.1.min.js';
14
14
  const REQUESTS_URL = 'https://hb.jixie.io/v2/hbpost';
15
15
  const sidTTLMins_ = 30;
16
16
 
@@ -104,7 +104,8 @@ function getMiscDims_() {
104
104
  let ret = {
105
105
  pageurl: '',
106
106
  domain: '',
107
- device: 'unknown'
107
+ device: 'unknown',
108
+ mkeywords: ''
108
109
  }
109
110
  try {
110
111
  let refererInfo_ = getRefererInfo();
@@ -112,6 +113,10 @@ function getMiscDims_() {
112
113
  ret.pageurl = url_;
113
114
  ret.domain = parseUrl(url_).host;
114
115
  ret.device = getDevice_();
116
+ let keywords = document.getElementsByTagName('meta')['keywords'];
117
+ if (keywords && keywords.content) {
118
+ ret.mkeywords = keywords.content;
119
+ }
115
120
  } catch (error) {}
116
121
  return ret;
117
122
  }
@@ -167,6 +172,7 @@ export const spec = {
167
172
  device: miscDims.device,
168
173
  domain: miscDims.domain,
169
174
  pageurl: miscDims.pageurl,
175
+ mkeywords: miscDims.mkeywords,
170
176
  bids: bids,
171
177
  cfg: jixieCfgBlob
172
178
  }, ids);
@@ -4,7 +4,7 @@ import { deepAccess } from '../src/utils.js';
4
4
  const BIDDER_CODE = 'justpremium'
5
5
  const GVLID = 62
6
6
  const ENDPOINT_URL = 'https://pre.ads.justpremium.com/v/2.0/t/xhr'
7
- const JP_ADAPTER_VERSION = '1.8'
7
+ const JP_ADAPTER_VERSION = '1.8.1'
8
8
  const pixels = []
9
9
 
10
10
  export const spec = {
@@ -101,6 +101,11 @@ export const spec = {
101
101
  advertiserDomains: bid.adomain && bid.adomain.length > 0 ? bid.adomain : []
102
102
  }
103
103
  }
104
+ if (bid.ext && bid.ext.pg) {
105
+ bidResponse.adserverTargeting = {
106
+ 'hb_deal_justpremium': 'jp_pg'
107
+ }
108
+ }
104
109
  bidResponses.push(bidResponse)
105
110
  }
106
111
  })
@@ -1,4 +1,4 @@
1
- import { logMessage, groupBy, uniques } from '../src/utils.js';
1
+ import { logMessage, groupBy, uniques, flatten, deepAccess } from '../src/utils.js';
2
2
  import { registerBidder } from '../src/adapters/bidderFactory.js';
3
3
  import { BANNER, VIDEO } from '../src/mediaTypes.js';
4
4
  import {ajax} from '../src/ajax.js';
@@ -92,6 +92,26 @@ export const spec = {
92
92
  }
93
93
  return bidResponses;
94
94
  },
95
+
96
+ getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => {
97
+ const syncs = serverResponses.map(response => response.body).reduce(flatten, [])
98
+ .map(response => deepAccess(response, 'ext.sync')).filter(Boolean);
99
+ const iframeSyncUrls = !syncOptions.iframeEnabled ? [] : syncs.map(sync => sync.iframe).filter(Boolean)
100
+ .filter(uniques).map(url => {
101
+ return {
102
+ type: 'iframe',
103
+ url: url
104
+ }
105
+ });
106
+ const pixelSyncUrls = !syncOptions.pixelEnabled ? [] : syncs.map(sync => sync.pixel).filter(Boolean)
107
+ .filter(uniques).map(url => {
108
+ return {
109
+ type: 'image',
110
+ url: url
111
+ }
112
+ });
113
+ return [iframeSyncUrls, pixelSyncUrls].reduce(flatten, []);
114
+ }
95
115
  };
96
116
 
97
117
  registerBidder(spec);
@@ -125,7 +145,7 @@ function buildPlacement(bidRequest) {
125
145
  break;
126
146
  }
127
147
  }
128
- sizes = (sizes || []).concat(bidRequest.sizes || []).filter(uniques);
148
+ sizes = (sizes || []).concat(bidRequest.sizes || []);
129
149
  return {
130
150
  host: bidRequest.params.host,
131
151
  adUnit: {