prebid.js 6.1.0 → 6.2.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 (69) hide show
  1. package/README.md +1 -1
  2. package/browsers.json +13 -29
  3. package/karma.conf.maker.js +1 -1
  4. package/modules/admixerBidAdapter.js +2 -1
  5. package/modules/adnuntiusBidAdapter.js +2 -1
  6. package/modules/adplusBidAdapter.js +203 -0
  7. package/modules/adplusBidAdapter.md +39 -0
  8. package/modules/adyoulikeBidAdapter.js +7 -2
  9. package/modules/appnexusBidAdapter.js +19 -2
  10. package/modules/beachfrontBidAdapter.js +14 -17
  11. package/modules/craftBidAdapter.js +5 -3
  12. package/modules/dchain.js +149 -0
  13. package/modules/dchain.md +45 -0
  14. package/modules/emx_digitalBidAdapter.js +9 -1
  15. package/modules/freewheel-sspBidAdapter.js +6 -0
  16. package/modules/goldbachBidAdapter.js +1176 -0
  17. package/modules/goldbachBidAdapter.md +151 -0
  18. package/modules/gumgumBidAdapter.js +5 -1
  19. package/modules/intersectionRtdProvider.js +114 -0
  20. package/modules/invibesBidAdapter.js +15 -9
  21. package/modules/ipromBidAdapter.js +79 -0
  22. package/modules/limelightDigitalBidAdapter.js +2 -1
  23. package/modules/luponmediaBidAdapter.js +570 -0
  24. package/modules/missenaBidAdapter.js +89 -0
  25. package/modules/pubmaticBidAdapter.js +3 -3
  26. package/modules/relaidoBidAdapter.js +86 -65
  27. package/modules/richaudienceBidAdapter.js +1 -1
  28. package/modules/smaatoBidAdapter.js +4 -1
  29. package/modules/smartxBidAdapter.js +17 -1
  30. package/modules/tappxBidAdapter.js +3 -1
  31. package/modules/undertoneBidAdapter.js +8 -1
  32. package/modules/userId/index.js +27 -2
  33. package/modules/ventes.md +71 -0
  34. package/modules/ventesBidAdapter.js +104 -64
  35. package/modules/ventesBidAdapter.md +0 -1
  36. package/modules/visxBidAdapter.js +19 -2
  37. package/modules/visxBidAdapter.md +4 -6
  38. package/modules/yahoosspBidAdapter.md +1 -1
  39. package/modules/yieldoneBidAdapter.js +115 -11
  40. package/package.json +1 -1
  41. package/src/auction.js +3 -2
  42. package/src/targeting.js +2 -2
  43. package/src/utils.js +7 -0
  44. package/test/spec/integration/faker/googletag.js +6 -0
  45. package/test/spec/modules/adnuntiusBidAdapter_spec.js +18 -0
  46. package/test/spec/modules/adplusBidAdapter_spec.js +213 -0
  47. package/test/spec/modules/adyoulikeBidAdapter_spec.js +26 -0
  48. package/test/spec/modules/appnexusBidAdapter_spec.js +49 -1
  49. package/test/spec/modules/beachfrontBidAdapter_spec.js +65 -1
  50. package/test/spec/modules/dchain_spec.js +329 -0
  51. package/test/spec/modules/emx_digitalBidAdapter_spec.js +10 -0
  52. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
  53. package/test/spec/modules/goldbachBidAdapter_spec.js +1359 -0
  54. package/test/spec/modules/gumgumBidAdapter_spec.js +6 -0
  55. package/test/spec/modules/intersectionRtdProvider_spec.js +141 -0
  56. package/test/spec/modules/invibesBidAdapter_spec.js +29 -4
  57. package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
  58. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +10 -7
  59. package/test/spec/modules/luponmediaBidAdapter_spec.js +412 -0
  60. package/test/spec/modules/missenaBidAdapter_spec.js +134 -0
  61. package/test/spec/modules/pubmaticBidAdapter_spec.js +1 -1
  62. package/test/spec/modules/relaidoBidAdapter_spec.js +71 -63
  63. package/test/spec/modules/smaatoBidAdapter_spec.js +31 -0
  64. package/test/spec/modules/smartxBidAdapter_spec.js +9 -0
  65. package/test/spec/modules/tappxBidAdapter_spec.js +4 -0
  66. package/test/spec/modules/userId_spec.js +51 -0
  67. package/test/spec/modules/visxBidAdapter_spec.js +120 -4
  68. package/test/spec/modules/yieldoneBidAdapter_spec.js +299 -53
  69. package/test/spec/unit/core/targeting_spec.js +44 -0
package/README.md CHANGED
@@ -274,7 +274,7 @@ As you make code changes, the bundles will be rebuilt and the page reloaded auto
274
274
 
275
275
  ## Contribute
276
276
 
277
- Many SSPs, bidders, and publishers have contributed to this project. [Hundreds of bidders](https://github.com/prebid/Prebid.js/tree/master/src/adapters) are supported by Prebid.js.
277
+ Many SSPs, bidders, and publishers have contributed to this project. [Hundreds of bidders](https://github.com/prebid/Prebid.js/tree/master/modules) are supported by Prebid.js.
278
278
 
279
279
  For guidelines, see [Contributing](./CONTRIBUTING.md).
280
280
 
package/browsers.json CHANGED
@@ -1,65 +1,49 @@
1
1
  {
2
- "bs_edge_17_windows_10": {
2
+ "bs_edge_latest_windows_10": {
3
3
  "base": "BrowserStack",
4
4
  "os_version": "10",
5
5
  "browser": "edge",
6
- "browser_version": "17.0",
6
+ "browser_version": "latest",
7
7
  "device": null,
8
8
  "os": "Windows"
9
9
  },
10
- "bs_edge_90_windows_10": {
11
- "base": "BrowserStack",
12
- "os_version": "10",
13
- "browser": "edge",
14
- "browser_version": "90.0",
15
- "device": null,
16
- "os": "Windows"
17
- },
18
- "bs_chrome_90_windows_10": {
10
+ "bs_chrome_latest_windows_10": {
19
11
  "base": "BrowserStack",
20
12
  "os_version": "10",
21
13
  "browser": "chrome",
22
- "browser_version": "90.0",
14
+ "browser_version": "latest",
23
15
  "device": null,
24
16
  "os": "Windows"
25
17
  },
26
- "bs_chrome_79_windows_10": {
18
+ "bs_chrome_87_windows_10": {
27
19
  "base": "BrowserStack",
28
20
  "os_version": "10",
29
21
  "browser": "chrome",
30
- "browser_version": "79.0",
31
- "device": null,
32
- "os": "Windows"
33
- },
34
- "bs_firefox_88_windows_10": {
35
- "base": "BrowserStack",
36
- "os_version": "10",
37
- "browser": "firefox",
38
- "browser_version": "88.0",
22
+ "browser_version": "87.0",
39
23
  "device": null,
40
24
  "os": "Windows"
41
25
  },
42
- "bs_firefox_72_windows_10": {
26
+ "bs_firefox_latest_windows_10": {
43
27
  "base": "BrowserStack",
44
28
  "os_version": "10",
45
29
  "browser": "firefox",
46
- "browser_version": "72.0",
30
+ "browser_version": "latest",
47
31
  "device": null,
48
32
  "os": "Windows"
49
33
  },
50
- "bs_safari_14_mac_bigsur": {
34
+ "bs_safari_latest_mac_bigsur": {
51
35
  "base": "BrowserStack",
52
36
  "os_version": "Big Sur",
53
37
  "browser": "safari",
54
- "browser_version": "14.0",
38
+ "browser_version": "latest",
55
39
  "device": null,
56
40
  "os": "OS X"
57
41
  },
58
- "bs_safari_12_mac_mojave": {
42
+ "bs_safari_15_catalina": {
59
43
  "base": "BrowserStack",
60
- "os_version": "Mojave",
44
+ "os_version": "Catalina",
61
45
  "browser": "safari",
62
- "browser_version": "12.0",
46
+ "browser_version": "13.1",
63
47
  "device": null,
64
48
  "os": "OS X"
65
49
  }
@@ -166,7 +166,7 @@ module.exports = function(codeCoverage, browserstack, watchMode, file) {
166
166
  browserNoActivityTimeout: 3e5, // default 10000
167
167
  captureTimeout: 3e5, // default 60000,
168
168
  browserDisconnectTolerance: 3,
169
- concurrency: 5,
169
+ concurrency: 6,
170
170
 
171
171
  plugins: plugins
172
172
  }
@@ -1,6 +1,7 @@
1
1
  import { logError } from '../src/utils.js';
2
2
  import {registerBidder} from '../src/adapters/bidderFactory.js';
3
3
  import {config} from '../src/config.js';
4
+ import {BANNER, VIDEO, NATIVE} from '../src/mediaTypes.js';
4
5
 
5
6
  const BIDDER_CODE = 'admixer';
6
7
  const ALIASES = ['go2net', 'adblender', 'adsyield'];
@@ -8,7 +9,7 @@ const ENDPOINT_URL = 'https://inv-nets.admixer.net/prebid.1.2.aspx';
8
9
  export const spec = {
9
10
  code: BIDDER_CODE,
10
11
  aliases: ALIASES,
11
- supportedMediaTypes: ['banner', 'video'],
12
+ supportedMediaTypes: [BANNER, VIDEO, NATIVE],
12
13
  /**
13
14
  * Determines whether or not the given bid request is valid.
14
15
  */
@@ -37,7 +37,8 @@ const handleMeta = function () {
37
37
  }
38
38
 
39
39
  const getUsi = function (meta, ortb2, bidderRequest) {
40
- const usi = (meta !== null) ? meta.usi : false;
40
+ let usi = (meta !== null && meta.usi) ? meta.usi : false;
41
+ if (ortb2 && ortb2.user && ortb2.user.id) { usi = ortb2.user.id }
41
42
  return usi
42
43
  }
43
44
 
@@ -0,0 +1,203 @@
1
+ import { registerBidder } from '../src/adapters/bidderFactory.js';
2
+ import * as utils from '../src/utils.js';
3
+ import { BANNER } from '../src/mediaTypes.js';
4
+ import { getStorageManager } from '../src/storageManager.js';
5
+
6
+ // #region Constants
7
+ export const BIDDER_CODE = 'adplus';
8
+ export const ADPLUS_ENDPOINT = 'https://ssp.ad-plus.com.tr/server/headerBidding';
9
+ export const DGID_CODE = 'adplus_dg_id';
10
+ export const SESSION_CODE = 'adplus_s_id';
11
+ export const storage = getStorageManager(undefined, BIDDER_CODE);
12
+ const COOKIE_EXP = 1000 * 60 * 60 * 24; // 1 day
13
+ // #endregion
14
+
15
+ // #region Helpers
16
+ export function isValidUuid (uuid) {
17
+ return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(
18
+ uuid
19
+ );
20
+ }
21
+
22
+ function getSessionId() {
23
+ let sid = storage.cookiesAreEnabled() && storage.getCookie(SESSION_CODE);
24
+
25
+ if (
26
+ !sid || !isValidUuid(sid)
27
+ ) {
28
+ sid = utils.generateUUID();
29
+ setSessionId(sid);
30
+ }
31
+
32
+ return sid;
33
+ }
34
+
35
+ function setSessionId(sid) {
36
+ if (storage.cookiesAreEnabled()) {
37
+ const expires = new Date(Date.now() + COOKIE_EXP).toISOString();
38
+
39
+ storage.setCookie(SESSION_CODE, sid, expires);
40
+ }
41
+ }
42
+ // #endregion
43
+
44
+ // #region Bid request validation
45
+ function isBidRequestValid(bid) {
46
+ if (!bid) {
47
+ utils.logError(BIDDER_CODE, 'bid, can not be empty', bid);
48
+ return false;
49
+ }
50
+
51
+ if (!bid.params) {
52
+ utils.logError(BIDDER_CODE, 'bid.params is required.');
53
+ return false;
54
+ }
55
+
56
+ if (!bid.params.adUnitId || typeof bid.params.adUnitId !== 'string') {
57
+ utils.logError(
58
+ BIDDER_CODE,
59
+ 'bid.params.adUnitId is missing or has wrong type.'
60
+ );
61
+ return false;
62
+ }
63
+
64
+ if (!bid.params.inventoryId || typeof bid.params.inventoryId !== 'string') {
65
+ utils.logError(
66
+ BIDDER_CODE,
67
+ 'bid.params.inventoryId is missing or has wrong type.'
68
+ );
69
+ return false;
70
+ }
71
+
72
+ if (
73
+ !bid.mediaTypes ||
74
+ !bid.mediaTypes[BANNER] ||
75
+ !utils.isArray(bid.mediaTypes[BANNER].sizes) ||
76
+ bid.mediaTypes[BANNER].sizes.length <= 0 ||
77
+ !utils.isArrayOfNums(bid.mediaTypes[BANNER].sizes[0])
78
+ ) {
79
+ utils.logError(BIDDER_CODE, 'Wrong or missing size parameters.');
80
+ return false;
81
+ }
82
+
83
+ return true;
84
+ }
85
+ // #endregion
86
+
87
+ // #region Building the bid requests
88
+ /**
89
+ *
90
+ * @param {object} bid
91
+ * @returns
92
+ */
93
+ function createBidRequest(bid) {
94
+ // Developer Params
95
+ const {
96
+ inventoryId,
97
+ adUnitId,
98
+ extraData,
99
+ yearOfBirth,
100
+ gender,
101
+ categories,
102
+ latitude,
103
+ longitude,
104
+ sdkVersion,
105
+ } = bid.params;
106
+
107
+ return {
108
+ method: 'GET',
109
+ url: ADPLUS_ENDPOINT,
110
+ data: utils.cleanObj({
111
+ bidId: bid.bidId,
112
+ inventoryId,
113
+ adUnitId,
114
+ adUnitWidth: bid.mediaTypes[BANNER].sizes[0][0],
115
+ adUnitHeight: bid.mediaTypes[BANNER].sizes[0][1],
116
+ extraData,
117
+ yearOfBirth,
118
+ gender,
119
+ categories,
120
+ latitude,
121
+ longitude,
122
+ sdkVersion: sdkVersion || '1',
123
+ session: getSessionId(),
124
+ interstitial: 0,
125
+ token: typeof window.top === 'object' && window.top[DGID_CODE] ? window.top[DGID_CODE] : undefined,
126
+ secure: window.location.protocol === 'https:' ? 1 : 0,
127
+ screenWidth: screen.width,
128
+ screenHeight: screen.height,
129
+ language: window.navigator.language || 'en-US',
130
+ pageUrl: window.location.href,
131
+ domain: window.location.hostname,
132
+ referrer: window.location.referrer,
133
+ }),
134
+ };
135
+ }
136
+
137
+ function buildRequests(validBidRequests, bidderRequest) {
138
+ return validBidRequests.map((req) => createBidRequest(req));
139
+ }
140
+ // #endregion
141
+
142
+ // #region Interpreting Responses
143
+ /**
144
+ *
145
+ * @param {HeaderBiddingResponse} responseData
146
+ * @param { object } bidParams
147
+ * @returns
148
+ */
149
+ function createAdResponse(responseData, bidParams) {
150
+ return {
151
+ requestId: responseData.requestID,
152
+ cpm: responseData.cpm,
153
+ currency: responseData.currency,
154
+ width: responseData.width,
155
+ height: responseData.height,
156
+ creativeId: responseData.creativeID,
157
+ dealId: responseData.dealID,
158
+ netRevenue: responseData.netRevenue,
159
+ ttl: responseData.ttl,
160
+ ad: responseData.ad,
161
+ mediaType: responseData.mediaType,
162
+ meta: {
163
+ advertiserDomains: responseData.advertiserDomains,
164
+ primaryCatId: utils.isArray(responseData.categoryIDs) && responseData.categoryIDs.length > 0
165
+ ? responseData.categoryIDs[0] : undefined,
166
+ secondaryCatIds: responseData.categoryIDs,
167
+ },
168
+ };
169
+ }
170
+
171
+ function interpretResponse(response, request) {
172
+ // In case of empty response
173
+ if (
174
+ response.body == null ||
175
+ !utils.isArray(response.body) ||
176
+ response.body.length === 0
177
+ ) {
178
+ return [];
179
+ }
180
+ const bids = response.body.map((bid) => createAdResponse(bid));
181
+ return bids;
182
+ }
183
+ // #endregion
184
+
185
+ // #region Bidder
186
+ export const spec = {
187
+ code: BIDDER_CODE,
188
+ supportedMediaTypes: [BANNER],
189
+ isBidRequestValid,
190
+ buildRequests,
191
+ interpretResponse,
192
+ onTimeout(timeoutData) {
193
+ utils.logError('Adplus adapter timed out for the auction.', timeoutData);
194
+ },
195
+ onBidWon(bid) {
196
+ utils.logInfo(
197
+ `Adplus adapter won the auction. Bid id: ${bid.bidId}, Ad Unit Id: ${bid.adUnitId}, Inventory Id: ${bid.inventoryId}`
198
+ );
199
+ },
200
+ };
201
+
202
+ registerBidder(spec);
203
+ // #endregion
@@ -0,0 +1,39 @@
1
+ # Overview
2
+
3
+ Module Name: AdPlus Bidder Adapter
4
+
5
+ Module Type: Bidder Adapter
6
+
7
+ Maintainer: adplus.destek@yaani.com.tr
8
+
9
+ # Description
10
+
11
+ AdPlus Prebid.js Bidder Adapter. Only banner formats are supported.
12
+
13
+ About us : https://ssp.ad-plus.com.tr/
14
+
15
+ # Test Parameters
16
+
17
+ ```javascript
18
+ var adUnits = [
19
+ {
20
+ code: "div-adplus",
21
+ mediaTypes: {
22
+ banner: {
23
+ sizes: [
24
+ [300, 250],
25
+ ],
26
+ },
27
+ },
28
+ bids: [
29
+ {
30
+ bidder: "adplus",
31
+ params: {
32
+ inventoryId: "-1",
33
+ adUnitId: "-3",
34
+ },
35
+ },
36
+ ],
37
+ },
38
+ ];
39
+ ```
@@ -1,6 +1,7 @@
1
1
  import { deepAccess, buildUrl, parseSizesInput } from '../src/utils.js';
2
2
  import { registerBidder } from '../src/adapters/bidderFactory.js';
3
3
  import { config } from '../src/config.js';
4
+ import { createEidsArray } from './userId/eids.js';
4
5
  import find from 'core-js-pure/features/array/find.js';
5
6
  import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
6
7
 
@@ -97,17 +98,21 @@ export const spec = {
97
98
  PageRefreshed: getPageRefreshed()
98
99
  };
99
100
 
100
- if (bidderRequest && bidderRequest.gdprConsent) {
101
+ if (bidderRequest.gdprConsent) {
101
102
  payload.gdprConsent = {
102
103
  consentString: bidderRequest.gdprConsent.consentString,
103
104
  consentRequired: (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') ? bidderRequest.gdprConsent.gdprApplies : null
104
105
  };
105
106
  }
106
107
 
107
- if (bidderRequest && bidderRequest.uspConsent) {
108
+ if (bidderRequest.uspConsent) {
108
109
  payload.uspConsent = bidderRequest.uspConsent;
109
110
  }
110
111
 
112
+ if (deepAccess(bidderRequest, 'userId')) {
113
+ payload.userId = createEidsArray(bidderRequest.userId);
114
+ }
115
+
111
116
  const data = JSON.stringify(payload);
112
117
  const options = {
113
118
  withCredentials: true
@@ -1,4 +1,4 @@
1
- import { convertCamelToUnderscore, isArray, isNumber, isPlainObject, logError, logInfo, deepAccess, logMessage, convertTypes, isStr, getParameterByName, deepClone, chunk, logWarn, getBidRequest, createTrackPixelHtml, isEmpty, transformBidderParamKeywords, getMaxValueFromArray, fill, getMinValueFromArray, isArrayOfNums, isFn } from '../src/utils.js';
1
+ import { convertCamelToUnderscore, isArray, isNumber, isPlainObject, logError, logInfo, deepAccess, logMessage, convertTypes, isStr, getParameterByName, deepClone, chunk, logWarn, getBidRequest, createTrackPixelHtml, isEmpty, transformBidderParamKeywords, getMaxValueFromArray, fill, getMinValueFromArray, isArrayOfNums, isFn, isAllowZeroCpmBidsEnabled } from '../src/utils.js';
2
2
  import { Renderer } from '../src/Renderer.js';
3
3
  import { config } from '../src/config.js';
4
4
  import { registerBidder, getIabSubCategory } from '../src/adapters/bidderFactory.js';
@@ -293,7 +293,8 @@ export const spec = {
293
293
  serverResponse.tags.forEach(serverBid => {
294
294
  const rtbBid = getRtbBid(serverBid);
295
295
  if (rtbBid) {
296
- if (rtbBid.cpm !== 0 && includes(this.supportedMediaTypes, rtbBid.ad_type)) {
296
+ const cpmCheck = (isAllowZeroCpmBidsEnabled(bidderRequest.bidderCode)) ? rtbBid.cpm >= 0 : rtbBid.cpm > 0;
297
+ if (cpmCheck && includes(this.supportedMediaTypes, rtbBid.ad_type)) {
297
298
  const bid = newBid(serverBid, rtbBid, bidderRequest);
298
299
  bid.mediaType = parseMediaType(rtbBid);
299
300
  bids.push(bid);
@@ -598,6 +599,22 @@ function newBid(serverBid, rtbBid, bidderRequest) {
598
599
  bid.meta = Object.assign({}, bid.meta, { advertiserId: rtbBid.advertiser_id });
599
600
  }
600
601
 
602
+ // temporary function; may remove at later date if/when adserver fully supports dchain
603
+ function setupDChain(rtbBid) {
604
+ let dchain = {
605
+ ver: '1.0',
606
+ complete: 0,
607
+ nodes: [{
608
+ bsid: rtbBid.buyer_member_id.toString()
609
+ }],
610
+ };
611
+
612
+ return dchain;
613
+ }
614
+ if (rtbBid.buyer_member_id) {
615
+ bid.meta = Object.assign({}, bid.meta, {dchain: setupDChain(rtbBid)});
616
+ }
617
+
601
618
  if (rtbBid.brand_id) {
602
619
  bid.meta = Object.assign({}, bid.meta, { brandId: rtbBid.brand_id });
603
620
  }
@@ -1,4 +1,4 @@
1
- import { logWarn, deepAccess, isArray, parseSizesInput, isFn, parseUrl, getUniqueIdentifierStr } from '../src/utils.js';
1
+ import { logWarn, deepAccess, deepSetValue, deepClone, isArray, parseSizesInput, isFn, parseUrl, getUniqueIdentifierStr } from '../src/utils.js';
2
2
  import { config } from '../src/config.js';
3
3
  import { registerBidder } from '../src/adapters/bidderFactory.js';
4
4
  import { Renderer } from '../src/Renderer.js';
@@ -6,7 +6,7 @@ import { VIDEO, BANNER } from '../src/mediaTypes.js';
6
6
  import find from 'core-js-pure/features/array/find.js';
7
7
  import includes from 'core-js-pure/features/array/includes.js';
8
8
 
9
- const ADAPTER_VERSION = '1.18';
9
+ const ADAPTER_VERSION = '1.19';
10
10
  const ADAPTER_NAME = 'BFIO_PREBID';
11
11
  const OUTSTREAM = 'outstream';
12
12
  const CURRENCY = 'USD';
@@ -360,6 +360,7 @@ function createVideoRequestData(bid, bidderRequest) {
360
360
  let tagid = getVideoBidParam(bid, 'tagid');
361
361
  let topLocation = getTopWindowLocation(bidderRequest);
362
362
  let eids = getEids(bid);
363
+ let ortb2 = deepClone(config.getConfig('ortb2'));
363
364
  let payload = {
364
365
  isPrebid: true,
365
366
  appId: appId,
@@ -378,6 +379,7 @@ function createVideoRequestData(bid, bidderRequest) {
378
379
  displaymanagerver: ADAPTER_VERSION
379
380
  }],
380
381
  site: {
382
+ ...deepAccess(ortb2, 'site', {}),
381
383
  page: topLocation.href,
382
384
  domain: topLocation.hostname
383
385
  },
@@ -389,39 +391,32 @@ function createVideoRequestData(bid, bidderRequest) {
389
391
  js: 1,
390
392
  geo: {}
391
393
  },
392
- regs: {
393
- ext: {}
394
- },
395
- source: {
396
- ext: {}
397
- },
398
- user: {
399
- ext: {}
400
- },
394
+ app: deepAccess(ortb2, 'app'),
395
+ user: deepAccess(ortb2, 'user'),
401
396
  cur: [CURRENCY]
402
397
  };
403
398
 
404
399
  if (bidderRequest && bidderRequest.uspConsent) {
405
- payload.regs.ext.us_privacy = bidderRequest.uspConsent;
400
+ deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent);
406
401
  }
407
402
 
408
403
  if (bidderRequest && bidderRequest.gdprConsent) {
409
404
  let { gdprApplies, consentString } = bidderRequest.gdprConsent;
410
- payload.regs.ext.gdpr = gdprApplies ? 1 : 0;
411
- payload.user.ext.consent = consentString;
405
+ deepSetValue(payload, 'regs.ext.gdpr', gdprApplies ? 1 : 0);
406
+ deepSetValue(payload, 'user.ext.consent', consentString);
412
407
  }
413
408
 
414
409
  if (bid.schain) {
415
- payload.source.ext.schain = bid.schain;
410
+ deepSetValue(payload, 'source.ext.schain', bid.schain);
416
411
  }
417
412
 
418
413
  if (eids.length > 0) {
419
- payload.user.ext.eids = eids;
414
+ deepSetValue(payload, 'user.ext.eids', eids);
420
415
  }
421
416
 
422
417
  let connection = navigator.connection || navigator.webkitConnection;
423
418
  if (connection && connection.effectiveType) {
424
- payload.device.connectiontype = connection.effectiveType;
419
+ deepSetValue(payload, 'device.connectiontype', connection.effectiveType);
425
420
  }
426
421
 
427
422
  return payload;
@@ -439,8 +434,10 @@ function createBannerRequestData(bids, bidderRequest) {
439
434
  sizes: getBannerSizes(bid)
440
435
  };
441
436
  });
437
+ let ortb2 = deepClone(config.getConfig('ortb2'));
442
438
  let payload = {
443
439
  slots: slots,
440
+ ortb2: ortb2,
444
441
  page: topLocation.href,
445
442
  domain: topLocation.hostname,
446
443
  search: topLocation.search,
@@ -5,6 +5,7 @@ import { auctionManager } from '../src/auctionManager.js';
5
5
  import find from 'core-js-pure/features/array/find.js';
6
6
  import includes from 'core-js-pure/features/array/includes.js';
7
7
  import { getStorageManager } from '../src/storageManager.js';
8
+ import {ajax} from '../src/ajax.js';
8
9
 
9
10
  const BIDDER_CODE = 'craft';
10
11
  const URL_BASE = 'https://gacraft.jp/prebid-v3';
@@ -110,9 +111,10 @@ export const spec = {
110
111
  },
111
112
 
112
113
  onBidWon: function(bid) {
113
- var xhr = new XMLHttpRequest();
114
- xhr.open('POST', bid._prebidWon);
115
- xhr.send();
114
+ ajax(bid._prebidWon, null, null, {
115
+ method: 'POST',
116
+ contentType: 'application/json'
117
+ });
116
118
  }
117
119
  };
118
120