prebid.js 6.22.0 → 6.23.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 (164) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -0
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adfBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adxcgBidAdapter.js +1 -1
  9. package/dist/adyoulikeBidAdapter.js +1 -1
  10. package/dist/ajaBidAdapter.js +1 -1
  11. package/dist/amxBidAdapter.js +1 -1
  12. package/dist/amxIdSystem.js +1 -1
  13. package/dist/appierAnalyticsAdapter.js +1 -1
  14. package/dist/appnexusBidAdapter.js +1 -1
  15. package/dist/asealBidAdapter.js +1 -1
  16. package/dist/asoBidAdapter.js +1 -1
  17. package/dist/audiencerunBidAdapter.js +1 -1
  18. package/dist/automatadBidAdapter.js +1 -1
  19. package/dist/axonixBidAdapter.js +1 -1
  20. package/dist/bidglassBidAdapter.js +1 -1
  21. package/dist/big-richmediaBidAdapter.js +1 -1
  22. package/dist/bizzclickBidAdapter.js +1 -1
  23. package/dist/bluebillywigBidAdapter.js +1 -1
  24. package/dist/bridgewellBidAdapter.js +1 -1
  25. package/dist/brightMountainMediaBidAdapter.js +1 -1
  26. package/dist/concertBidAdapter.js +1 -1
  27. package/dist/connectadBidAdapter.js +1 -1
  28. package/dist/consumableBidAdapter.js +1 -1
  29. package/dist/conversantBidAdapter.js +1 -1
  30. package/dist/craftBidAdapter.js +1 -1
  31. package/dist/criteoBidAdapter.js +1 -1
  32. package/dist/dspxBidAdapter.js +1 -1
  33. package/dist/eplanningBidAdapter.js +1 -1
  34. package/dist/glimpseBidAdapter.js +1 -1
  35. package/dist/gmosspBidAdapter.js +1 -1
  36. package/dist/goldbachBidAdapter.js +1 -1
  37. package/dist/gridBidAdapter.js +1 -1
  38. package/dist/gridNMBidAdapter.js +1 -1
  39. package/dist/gumgumBidAdapter.js +1 -1
  40. package/dist/h12mediaBidAdapter.js +1 -1
  41. package/dist/id5IdSystem.js +1 -1
  42. package/dist/impactifyBidAdapter.js +1 -1
  43. package/dist/improvedigitalBidAdapter.js +1 -1
  44. package/dist/inmarBidAdapter.js +1 -1
  45. package/dist/insticatorBidAdapter.js +1 -1
  46. package/dist/ixBidAdapter.js +1 -1
  47. package/dist/jixieBidAdapter.js +1 -1
  48. package/dist/justpremiumBidAdapter.js +1 -1
  49. package/dist/jwplayerRtdProvider.js +1 -1
  50. package/dist/konduitAnalyticsAdapter.js +1 -1
  51. package/dist/livewrappedBidAdapter.js +1 -1
  52. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  53. package/dist/logicadBidAdapter.js +1 -1
  54. package/dist/loglyliftBidAdapter.js +1 -1
  55. package/dist/malltvAnalyticsAdapter.js +1 -1
  56. package/dist/marsmediaBidAdapter.js +1 -1
  57. package/dist/mediafuseBidAdapter.js +1 -1
  58. package/dist/mediakeysBidAdapter.js +1 -1
  59. package/dist/mediasquareBidAdapter.js +1 -1
  60. package/dist/mgidBidAdapter.js +1 -1
  61. package/dist/minutemediaBidAdapter.js +1 -1
  62. package/dist/not-for-prod/prebid.js +117 -116
  63. package/dist/oguryBidAdapter.js +1 -1
  64. package/dist/oneVideoBidAdapter.js +1 -1
  65. package/dist/onetagBidAdapter.js +1 -1
  66. package/dist/ooloAnalyticsAdapter.js +1 -1
  67. package/dist/outbrainBidAdapter.js +1 -1
  68. package/dist/parrableIdSystem.js +1 -1
  69. package/dist/pixfutureBidAdapter.js +1 -1
  70. package/dist/prebid-core.js +3 -3
  71. package/dist/prebidServerBidAdapter.js +1 -1
  72. package/dist/publinkIdSystem.js +1 -1
  73. package/dist/pubmaticBidAdapter.js +1 -1
  74. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  75. package/dist/pxyzBidAdapter.js +1 -1
  76. package/dist/quantcastBidAdapter.js +1 -1
  77. package/dist/readpeakBidAdapter.js +1 -1
  78. package/dist/relaidoBidAdapter.js +1 -1
  79. package/dist/rhythmoneBidAdapter.js +1 -1
  80. package/dist/riseBidAdapter.js +1 -1
  81. package/dist/rubiconAnalyticsAdapter.js +1 -1
  82. package/dist/rubiconBidAdapter.js +1 -1
  83. package/dist/seedingAllianceBidAdapter.js +1 -1
  84. package/dist/seedtagBidAdapter.js +1 -1
  85. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  86. package/dist/sharethroughBidAdapter.js +1 -1
  87. package/dist/smaatoBidAdapter.js +1 -1
  88. package/dist/smartadserverBidAdapter.js +1 -1
  89. package/dist/smartxBidAdapter.js +1 -1
  90. package/dist/smilewantedBidAdapter.js +1 -1
  91. package/dist/sonobiBidAdapter.js +1 -1
  92. package/dist/sortableBidAdapter.js +1 -1
  93. package/dist/sovrnAnalyticsAdapter.js +1 -1
  94. package/dist/sovrnBidAdapter.js +1 -1
  95. package/dist/sspBCBidAdapter.js +1 -1
  96. package/dist/sublimeBidAdapter.js +1 -1
  97. package/dist/synacormediaBidAdapter.js +1 -1
  98. package/dist/targetVideoBidAdapter.js +1 -1
  99. package/dist/teadsBidAdapter.js +1 -1
  100. package/dist/trionBidAdapter.js +1 -1
  101. package/dist/tripleliftBidAdapter.js +1 -1
  102. package/dist/trustxBidAdapter.js +1 -1
  103. package/dist/ttdBidAdapter.js +1 -1
  104. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  105. package/dist/underdogmediaBidAdapter.js +1 -1
  106. package/dist/undertoneBidAdapter.js +1 -1
  107. package/dist/userId.js +1 -1
  108. package/dist/vidazooBidAdapter.js +1 -1
  109. package/dist/videobyteBidAdapter.js +1 -1
  110. package/dist/visxBidAdapter.js +1 -1
  111. package/dist/vuukleBidAdapter.js +1 -1
  112. package/dist/widespaceBidAdapter.js +1 -1
  113. package/dist/winrBidAdapter.js +1 -1
  114. package/dist/yahoosspBidAdapter.js +1 -1
  115. package/dist/yieldmoBidAdapter.js +1 -1
  116. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  117. package/integrationExamples/gpt/userId_example.html +12 -0
  118. package/modules/.submodules.json +1 -0
  119. package/modules/33acrossIdSystem.js +115 -0
  120. package/modules/33acrossIdSystem.md +53 -0
  121. package/modules/adagioBidAdapter.js +45 -5
  122. package/modules/adfBidAdapter.js +5 -0
  123. package/modules/adyoulikeBidAdapter.js +1 -9
  124. package/modules/asealBidAdapter.js +62 -14
  125. package/modules/automatadBidAdapter.js +24 -11
  126. package/modules/automatadBidAdapter.md +2 -2
  127. package/modules/big-richmediaBidAdapter.js +9 -1
  128. package/modules/bizzclickBidAdapter.js +5 -14
  129. package/modules/criteoBidAdapter.js +20 -20
  130. package/modules/improvedigitalBidAdapter.js +10 -6
  131. package/modules/insticatorBidAdapter.js +14 -4
  132. package/modules/jixieBidAdapter.js +29 -0
  133. package/modules/jixieBidAdapter.md +1 -0
  134. package/modules/jwplayerRtdProvider.js +27 -9
  135. package/modules/jwplayerRtdProvider.md +5 -3
  136. package/modules/livewrappedBidAdapter.js +1 -1
  137. package/modules/minutemediaBidAdapter.js +206 -135
  138. package/modules/minutemediaBidAdapter.md +42 -17
  139. package/modules/prebidServerBidAdapter/index.js +4 -1
  140. package/modules/sovrnBidAdapter.js +16 -3
  141. package/modules/tripleliftBidAdapter.js +13 -9
  142. package/modules/userId/eids.js +9 -0
  143. package/modules/userId/eids.md +7 -0
  144. package/modules/userId/index.js +5 -2
  145. package/modules/userId/userId.md +23 -2
  146. package/package.json +1 -1
  147. package/test/spec/modules/33acrossIdSystem_spec.js +413 -0
  148. package/test/spec/modules/adagioBidAdapter_spec.js +11 -2
  149. package/test/spec/modules/adfBidAdapter_spec.js +27 -0
  150. package/test/spec/modules/asealBidAdapter_spec.js +134 -65
  151. package/test/spec/modules/automatadBidAdapter_spec.js +28 -11
  152. package/test/spec/modules/criteoBidAdapter_spec.js +33 -33
  153. package/test/spec/modules/eids_spec.js +17 -0
  154. package/test/spec/modules/improvedigitalBidAdapter_spec.js +27 -5
  155. package/test/spec/modules/insticatorBidAdapter_spec.js +24 -15
  156. package/test/spec/modules/jixieBidAdapter_spec.js +96 -0
  157. package/test/spec/modules/jwplayerRtdProvider_spec.js +50 -14
  158. package/test/spec/modules/livewrappedBidAdapter_spec.js +3 -1
  159. package/test/spec/modules/minutemediaBidAdapter_spec.js +196 -122
  160. package/test/spec/modules/prebidServerBidAdapter_spec.js +4 -0
  161. package/test/spec/modules/sovrnBidAdapter_spec.js +12 -0
  162. package/test/spec/modules/tripleliftBidAdapter_spec.js +12 -2
  163. package/test/spec/modules/userId_spec.js +8 -0
  164. package/modules/pubnxBidAdapter.md +0 -31
@@ -31,6 +31,7 @@ import {createEidsArray} from './userId/eids.js';
31
31
  import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
32
32
  import {Renderer} from '../src/Renderer.js';
33
33
  import {OUTSTREAM} from '../src/video.js';
34
+ import { getGlobal } from '../src/prebidGlobal.js';
34
35
 
35
36
  const BIDDER_CODE = 'adagio';
36
37
  const LOG_PREFIX = 'Adagio:';
@@ -46,7 +47,6 @@ const MAX_SESS_DURATION = 30 * 60 * 1000;
46
47
  const ADAGIO_PUBKEY = 'AL16XT44Sfp+8SHVF1UdC7hydPSMVLMhsYknKDdwqq+0ToDSJrP0+Qh0ki9JJI2uYm/6VEYo8TJED9WfMkiJ4vf02CW3RvSWwc35bif2SK1L8Nn/GfFYr/2/GG/Rm0vUsv+vBHky6nuuYls20Og0HDhMgaOlXoQ/cxMuiy5QSktp';
47
48
  const ADAGIO_PUBKEY_E = 65537;
48
49
  const CURRENCY = 'USD';
49
- const DEFAULT_FLOOR = 0.1;
50
50
 
51
51
  // This provide a whitelist and a basic validation
52
52
  // of OpenRTB 2.5 options used by the Adagio SSP.
@@ -589,13 +589,13 @@ function _getFloors(bidRequest) {
589
589
  const info = bidRequest.getFloor({
590
590
  currency: CURRENCY,
591
591
  mediaType,
592
- size: []
592
+ size
593
593
  });
594
594
 
595
595
  floors.push(cleanObj({
596
596
  mt: mediaType,
597
597
  s: isArray(size) ? `${size[0]}x${size[1]}` : undefined,
598
- f: (!isNaN(info.floor) && info.currency === CURRENCY) ? info.floor : DEFAULT_FLOOR
598
+ f: (!isNaN(info.floor) && info.currency === CURRENCY) ? info.floor : undefined
599
599
  }));
600
600
  }
601
601
 
@@ -869,7 +869,9 @@ function storeRequestInAdagioNS(bidRequest) {
869
869
  }],
870
870
  auctionId: bidRequest.auctionId,
871
871
  pageviewId: internal.getPageviewId(),
872
- printNumber
872
+ printNumber,
873
+ localPbjs: '$$PREBID_GLOBAL$$',
874
+ localPbjsRef: getGlobal()
873
875
  });
874
876
 
875
877
  // (legacy) Store internal adUnit information
@@ -937,7 +939,45 @@ export const spec = {
937
939
  });
938
940
 
939
941
  // Handle priceFloors module
940
- bidRequest.floors = _getFloors(bidRequest);
942
+ const computedFloors = _getFloors(bidRequest);
943
+ if (isArray(computedFloors) && computedFloors.length) {
944
+ bidRequest.floors = computedFloors
945
+
946
+ if (deepAccess(bidRequest, 'mediaTypes.banner')) {
947
+ const bannerObj = bidRequest.mediaTypes.banner
948
+
949
+ const computeNewSizeArray = (sizeArr = []) => {
950
+ const size = { size: sizeArr, floor: null }
951
+ const bannerFloors = bidRequest.floors.filter(floor => floor.mt === BANNER)
952
+ const BannerSizeFloor = bannerFloors.find(floor => floor.s === sizeArr.join('x'))
953
+ size.floor = (bannerFloors) ? (BannerSizeFloor) ? BannerSizeFloor.f : bannerFloors[0].f : null
954
+ return size
955
+ }
956
+
957
+ // `bannerSizes`, internal property name
958
+ bidRequest.mediaTypes.banner.bannerSizes = (isArray(bannerObj.sizes[0]))
959
+ ? bannerObj.sizes.map(sizeArr => {
960
+ return computeNewSizeArray(sizeArr)
961
+ })
962
+ : computeNewSizeArray(bannerObj.sizes)
963
+ }
964
+
965
+ if (deepAccess(bidRequest, 'mediaTypes.video')) {
966
+ const videoObj = bidRequest.mediaTypes.video
967
+ const videoFloors = bidRequest.floors.filter(floor => floor.mt === VIDEO);
968
+ const playerSize = (videoObj.playerSize && isArray(videoObj.playerSize[0])) ? videoObj.playerSize[0] : videoObj.playerSize
969
+ const videoSizeFloor = (playerSize) ? videoFloors.find(floor => floor.s === playerSize.join('x')) : undefined
970
+
971
+ bidRequest.mediaTypes.video.floor = (videoFloors) ? videoSizeFloor ? videoSizeFloor.f : videoFloors[0].f : null
972
+ }
973
+
974
+ if (deepAccess(bidRequest, 'mediaTypes.native')) {
975
+ const nativeFloors = bidRequest.floors.filter(floor => floor.mt === NATIVE);
976
+ if (nativeFloors.length) {
977
+ bidRequest.mediaTypes.native.floor = nativeFloors[0].f
978
+ }
979
+ }
980
+ }
941
981
 
942
982
  if (deepAccess(bidRequest, 'mediaTypes.video')) {
943
983
  _buildVideoBidRequest(bidRequest);
@@ -206,6 +206,11 @@ export const spec = {
206
206
  request.is_debug = !!test;
207
207
  request.test = 1;
208
208
  }
209
+
210
+ if (config.getConfig('coppa')) {
211
+ deepSetValue(request, 'regs.coppa', 1);
212
+ }
213
+
209
214
  if (deepAccess(bidderRequest, 'gdprConsent.gdprApplies') !== undefined) {
210
215
  deepSetValue(request, 'user.ext.consent', bidderRequest.gdprConsent.consentString);
211
216
  deepSetValue(request, 'regs.ext.gdpr', bidderRequest.gdprConsent.gdprApplies & 1);
@@ -350,14 +350,6 @@ function getTrackers(eventsArray, jsTrackers) {
350
350
  return result;
351
351
  }
352
352
 
353
- function getVideoAd(response) {
354
- var adJson = {};
355
- if (typeof response.Ad === 'string' && response.Ad.indexOf('\/\*PREBID\*\/') > 0) {
356
- adJson = JSON.parse(response.Ad.match(/\/\*PREBID\*\/(.*)\/\*PREBID\*\//)[1]);
357
- return deepAccess(adJson, 'Content.MainVideo.Vast');
358
- }
359
- }
360
-
361
353
  function getNativeAssets(response, nativeConfig) {
362
354
  if (typeof response.Native === 'object') {
363
355
  return response.Native;
@@ -486,7 +478,7 @@ function createBid(response, bidRequests) {
486
478
  };
487
479
 
488
480
  // retreive video response if present
489
- const vast64 = response.Vast || getVideoAd(response);
481
+ const vast64 = response.Vast;
490
482
  if (vast64) {
491
483
  bid.width = response.Width;
492
484
  bid.height = response.Height;
@@ -1,30 +1,77 @@
1
1
  import { registerBidder } from '../src/adapters/bidderFactory.js';
2
2
  import { BANNER } from '../src/mediaTypes.js';
3
3
  import { config } from '../src/config.js';
4
+ import { generateUUID, getWindowTop, getWindowSelf } from '../src/utils.js';
5
+ import { getStorageManager } from '../src/storageManager.js';
4
6
 
5
7
  export const BIDDER_CODE = 'aseal';
6
- const SUPPORTED_AD_TYPES = [BANNER];
8
+ export const SUPPORTED_AD_TYPES = [BANNER];
7
9
  export const API_ENDPOINT = 'https://tkprebid.aotter.net/prebid/adapter';
8
- export const HEADER_AOTTER_VERSION = 'prebid_0.0.1';
10
+ export const WEB_SESSION_ID_KEY = '__tkwsid';
11
+ export const HEADER_AOTTER_VERSION = 'prebid_0.0.2';
12
+
13
+ export const storage = getStorageManager({ bidderCode: BIDDER_CODE });
14
+
15
+ const getTrekWebSessionId = () => {
16
+ let wsid =
17
+ storage.localStorageIsEnabled() &&
18
+ storage.getDataFromLocalStorage(WEB_SESSION_ID_KEY);
19
+
20
+ if (!wsid) {
21
+ wsid = generateUUID();
22
+ setTrekWebSessionId(wsid);
23
+ }
24
+
25
+ return wsid;
26
+ };
27
+
28
+ const setTrekWebSessionId = (wsid) => {
29
+ if (storage.localStorageIsEnabled()) {
30
+ storage.setDataInLocalStorage(WEB_SESSION_ID_KEY, wsid);
31
+ }
32
+ };
33
+
34
+ const canAccessTopWindow = () => {
35
+ try {
36
+ return !!getWindowTop().location.href;
37
+ } catch (errro) {
38
+ return false;
39
+ }
40
+ };
9
41
 
10
42
  export const spec = {
11
43
  code: BIDDER_CODE,
12
44
  aliases: ['aotter', 'trek'],
13
45
  supportedMediaTypes: SUPPORTED_AD_TYPES,
14
-
15
- isBidRequestValid: (bid) => !!bid.params.placeUid && typeof bid.params.placeUid === 'string',
16
-
46
+ isBidRequestValid: (bid) =>
47
+ !!bid.params.placeUid && typeof bid.params.placeUid === 'string',
17
48
  buildRequests: (validBidRequests, bidderRequest) => {
18
49
  if (validBidRequests.length === 0) {
19
50
  return [];
20
51
  }
21
52
 
22
- const clientId =
23
- config.getConfig('aseal.clientId') || '';
53
+ const clientId = config.getConfig('aseal.clientId') || '';
54
+
55
+ const windowTop = getWindowTop();
56
+ const windowSelf = getWindowSelf();
57
+
58
+ const w = canAccessTopWindow() ? windowTop : windowSelf;
24
59
 
25
60
  const data = {
26
61
  bids: validBidRequests,
27
62
  refererInfo: bidderRequest.refererInfo,
63
+ device: {
64
+ webSessionId: getTrekWebSessionId(),
65
+ },
66
+ payload: {
67
+ meta: {
68
+ dr: w.document.referrer,
69
+ drs: windowSelf.document.referrer,
70
+ drt: (canAccessTopWindow() && windowTop.document.referrer) || '',
71
+ dt: w.document.title,
72
+ dl: w.location.href,
73
+ },
74
+ },
28
75
  };
29
76
 
30
77
  const options = {
@@ -36,14 +83,15 @@ export const spec = {
36
83
  },
37
84
  };
38
85
 
39
- return [{
40
- method: 'POST',
41
- url: API_ENDPOINT,
42
- data,
43
- options,
44
- }];
86
+ return [
87
+ {
88
+ method: 'POST',
89
+ url: API_ENDPOINT,
90
+ data,
91
+ options,
92
+ },
93
+ ];
45
94
  },
46
-
47
95
  interpretResponse: (serverResponse, bidRequest) => {
48
96
  if (!Array.isArray(serverResponse.body)) {
49
97
  return [];
@@ -18,7 +18,7 @@ export const spec = {
18
18
 
19
19
  isBidRequestValid: function (bid) {
20
20
  // will receive request bid. check if have necessary params for bidding
21
- return (bid && bid.hasOwnProperty('params') && bid.params.hasOwnProperty('siteId') && bid.params.hasOwnProperty('placementId') && bid.hasOwnProperty('mediaTypes') && bid.mediaTypes.hasOwnProperty('banner'))
21
+ return (bid && bid.hasOwnProperty('params') && bid.params.hasOwnProperty('siteId') && bid.params.siteId != null && bid.hasOwnProperty('mediaTypes') && bid.mediaTypes.hasOwnProperty('banner') && typeof bid.mediaTypes.banner == 'object')
22
22
  },
23
23
 
24
24
  buildRequests: function (validBidRequests, bidderRequest) {
@@ -29,16 +29,29 @@ export const spec = {
29
29
  const siteId = validBidRequests[0].params.siteId
30
30
 
31
31
  const impressions = validBidRequests.map(bidRequest => {
32
- return {
33
- id: bidRequest.bidId,
34
- adUnitCode: bidRequest.adUnitCode,
35
- placement: bidRequest.params.placementId,
36
- banner: {
37
- format: bidRequest.sizes.map(sizeArr => ({
38
- w: sizeArr[0],
39
- h: sizeArr[1],
40
- }))
41
- },
32
+ if (bidRequest.params.hasOwnProperty('placementId')) {
33
+ return {
34
+ id: bidRequest.bidId,
35
+ adUnitCode: bidRequest.adUnitCode,
36
+ placement: bidRequest.params.placementId,
37
+ banner: {
38
+ format: bidRequest.sizes.map(sizeArr => ({
39
+ w: sizeArr[0],
40
+ h: sizeArr[1],
41
+ }))
42
+ },
43
+ }
44
+ } else {
45
+ return {
46
+ id: bidRequest.bidId,
47
+ adUnitCode: bidRequest.adUnitCode,
48
+ banner: {
49
+ format: bidRequest.sizes.map(sizeArr => ({
50
+ w: sizeArr[0],
51
+ h: sizeArr[1],
52
+ }))
53
+ },
54
+ }
42
55
  }
43
56
  })
44
57
 
@@ -25,8 +25,8 @@ var adUnits = [
25
25
  bids: [{
26
26
  bidder: 'automatad',
27
27
  params: {
28
- siteId: 'someValue',
29
- placementId: 'someValue'
28
+ siteId: 'someValue', // required
29
+ placementId: 'someValue' // optional
30
30
  }
31
31
  }]
32
32
  }
@@ -8,7 +8,7 @@ const BIDDER_CODE = 'big-richmedia';
8
8
  const metadataByRequestId = {};
9
9
 
10
10
  export const spec = {
11
- version: '1.4.0',
11
+ version: '1.5.0',
12
12
  code: BIDDER_CODE,
13
13
  gvlid: baseAdapter.GVLID, // use base adapter gvlid
14
14
  supportedMediaTypes: [ BANNER, VIDEO ],
@@ -78,6 +78,14 @@ export const spec = {
78
78
  customSelector,
79
79
  isReplayable
80
80
  };
81
+
82
+ // This is a workaround needed for the rendering step (so that the adserver iframe does not get resized to 1800x1000
83
+ // when there is skin demand
84
+ if (format === 'skin') {
85
+ renderParams.width = 1
86
+ renderParams.height = 1
87
+ }
88
+
81
89
  const encoded = window.btoa(JSON.stringify(renderParams));
82
90
  bid.ad = `<script src="//cdn.hubvisor.io/wrapper/${publisherId}/richmedia-renderer.js" async="true"></script>
83
91
  <script>var hbvrm = hbvrm || {}; hbvrm.cmd = hbvrm.cmd || []; hbvrm.cmd.push(function() { hbvrm.render('${encoded}'); });</script>`;
@@ -95,6 +95,7 @@ export const spec = {
95
95
  },
96
96
  regs: {
97
97
  coppa: config.getConfig('coppa') === true ? 1 : 0,
98
+ ext: {}
98
99
  },
99
100
  user: {
100
101
  ext: {}
@@ -106,25 +107,15 @@ export const spec = {
106
107
  imp: [impObject],
107
108
  };
108
109
 
109
- if (bidderRequest && bidderRequest.uspConsent) {
110
- data.regs.ext.us_privacy = bidderRequest.uspConsent;
111
- }
112
-
113
- if (bidderRequest && bidderRequest.gdprConsent) {
114
- let { gdprApplies, consentString } = bidderRequest.gdprConsent;
115
- data.regs.ext.gdpr = gdprApplies ? 1 : 0;
116
- data.user.ext.consent = consentString;
117
- }
118
-
119
- if (bidRequest.schain) {
120
- deepSetValue(data, 'source.ext.schain', bidRequest.schain);
121
- }
122
-
123
110
  let connection = navigator.connection || navigator.webkitConnection;
124
111
  if (connection && connection.effectiveType) {
125
112
  data.device.connectiontype = connection.effectiveType;
126
113
  }
127
114
  if (bidRequest) {
115
+ if (bidRequest.schain) {
116
+ deepSetValue(data, 'source.ext.schain', bidRequest.schain);
117
+ }
118
+
128
119
  if (bidRequest.gdprConsent && bidRequest.gdprConsent.gdprApplies) {
129
120
  deepSetValue(data, 'regs.ext.gdpr', bidRequest.gdprConsent.gdprApplies ? 1 : 0);
130
121
  deepSetValue(data, 'user.ext.consent', bidRequest.gdprConsent.consentString);
@@ -1,11 +1,11 @@
1
- import {deepAccess, getUniqueIdentifierStr, isArray, logError, logInfo, logWarn, parseUrl} from '../src/utils.js';
2
- import {loadExternalScript} from '../src/adloader.js';
3
- import {registerBidder} from '../src/adapters/bidderFactory.js';
4
- import {config} from '../src/config.js';
5
- import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
6
- import {find} from '../src/polyfill.js';
7
- import {verify} from 'criteo-direct-rsa-validate/build/verify.js'; // ref#2
8
- import {getStorageManager} from '../src/storageManager.js';
1
+ import { deepAccess, getUniqueIdentifierStr, isArray, logError, logInfo, logWarn, parseUrl } from '../src/utils.js';
2
+ import { loadExternalScript } from '../src/adloader.js';
3
+ import { registerBidder } from '../src/adapters/bidderFactory.js';
4
+ import { config } from '../src/config.js';
5
+ import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
6
+ import { find } from '../src/polyfill.js';
7
+ import { verify } from 'criteo-direct-rsa-validate/build/verify.js'; // ref#2
8
+ import { getStorageManager } from '../src/storageManager.js';
9
9
 
10
10
  const GVLID = 91;
11
11
  export const ADAPTER_VERSION = 34;
@@ -13,7 +13,7 @@ const BIDDER_CODE = 'criteo';
13
13
  const CDB_ENDPOINT = 'https://bidder.criteo.com/cdb';
14
14
  const PROFILE_ID_INLINE = 207;
15
15
  export const PROFILE_ID_PUBLISHERTAG = 185;
16
- const storage = getStorageManager({gvlid: GVLID, bidderCode: BIDDER_CODE});
16
+ const storage = getStorageManager({ gvlid: GVLID, bidderCode: BIDDER_CODE });
17
17
  const LOG_PREFIX = 'Criteo: ';
18
18
 
19
19
  /*
@@ -35,7 +35,7 @@ const FAST_BID_PUBKEY_N = 'ztQYwCE5BU7T9CDM5he6rKoabstXRmkzx54zFPZkWbK530dwtLBDe
35
35
  export const spec = {
36
36
  code: BIDDER_CODE,
37
37
  gvlid: GVLID,
38
- supportedMediaTypes: [ BANNER, VIDEO, NATIVE ],
38
+ supportedMediaTypes: [BANNER, VIDEO, NATIVE],
39
39
 
40
40
  /** f
41
41
  * @param {object} bid
@@ -65,11 +65,11 @@ export const spec = {
65
65
  buildRequests: (bidRequests, bidderRequest) => {
66
66
  let url;
67
67
  let data;
68
- let fpd = config.getLegacyFpd(config.getConfig('ortb2')) || {};
68
+ let fpd = config.getConfig('ortb2') || {};
69
69
 
70
70
  Object.assign(bidderRequest, {
71
- publisherExt: fpd.context,
72
- userExt: fpd.user,
71
+ publisherExt: fpd.site?.ext,
72
+ userExt: fpd.user?.ext,
73
73
  ceh: config.getConfig('criteo.ceh')
74
74
  });
75
75
 
@@ -265,11 +265,11 @@ function checkNativeSendId(bidRequest) {
265
265
  return !(bidRequest.nativeParams &&
266
266
  (
267
267
  (bidRequest.nativeParams.image && ((bidRequest.nativeParams.image.sendId !== true || bidRequest.nativeParams.image.sendTargetingKeys === true))) ||
268
- (bidRequest.nativeParams.icon && ((bidRequest.nativeParams.icon.sendId !== true || bidRequest.nativeParams.icon.sendTargetingKeys === true))) ||
269
- (bidRequest.nativeParams.clickUrl && ((bidRequest.nativeParams.clickUrl.sendId !== true || bidRequest.nativeParams.clickUrl.sendTargetingKeys === true))) ||
270
- (bidRequest.nativeParams.displayUrl && ((bidRequest.nativeParams.displayUrl.sendId !== true || bidRequest.nativeParams.displayUrl.sendTargetingKeys === true))) ||
271
- (bidRequest.nativeParams.privacyLink && ((bidRequest.nativeParams.privacyLink.sendId !== true || bidRequest.nativeParams.privacyLink.sendTargetingKeys === true))) ||
272
- (bidRequest.nativeParams.privacyIcon && ((bidRequest.nativeParams.privacyIcon.sendId !== true || bidRequest.nativeParams.privacyIcon.sendTargetingKeys === true)))
268
+ (bidRequest.nativeParams.icon && ((bidRequest.nativeParams.icon.sendId !== true || bidRequest.nativeParams.icon.sendTargetingKeys === true))) ||
269
+ (bidRequest.nativeParams.clickUrl && ((bidRequest.nativeParams.clickUrl.sendId !== true || bidRequest.nativeParams.clickUrl.sendTargetingKeys === true))) ||
270
+ (bidRequest.nativeParams.displayUrl && ((bidRequest.nativeParams.displayUrl.sendId !== true || bidRequest.nativeParams.displayUrl.sendTargetingKeys === true))) ||
271
+ (bidRequest.nativeParams.privacyLink && ((bidRequest.nativeParams.privacyLink.sendId !== true || bidRequest.nativeParams.privacyLink.sendTargetingKeys === true))) ||
272
+ (bidRequest.nativeParams.privacyIcon && ((bidRequest.nativeParams.privacyIcon.sendId !== true || bidRequest.nativeParams.privacyIcon.sendTargetingKeys === true)))
273
273
  ));
274
274
  }
275
275
 
@@ -285,7 +285,7 @@ function buildCdbRequest(context, bidRequests, bidderRequest) {
285
285
  const request = {
286
286
  publisher: {
287
287
  url: context.url,
288
- ext: bidderRequest.publisherExt
288
+ ext: bidderRequest.publisherExt,
289
289
  },
290
290
  slots: bidRequests.map(bidRequest => {
291
291
  networkId = bidRequest.params.networkId || networkId;
@@ -405,7 +405,7 @@ function hasValidVideoMediaType(bidRequest) {
405
405
 
406
406
  var requiredMediaTypesParams = ['mimes', 'playerSize', 'maxduration', 'protocols', 'api', 'skip', 'placement', 'playbackmethod'];
407
407
 
408
- requiredMediaTypesParams.forEach(function(param) {
408
+ requiredMediaTypesParams.forEach(function (param) {
409
409
  if (deepAccess(bidRequest, 'mediaTypes.video.' + param) === undefined && deepAccess(bidRequest, 'params.video.' + param) === undefined) {
410
410
  isValid = false;
411
411
  logError('Criteo Bid Adapter: mediaTypes.video.' + param + ' is required');
@@ -117,16 +117,20 @@ export const spec = {
117
117
  if (additionalConsent && additionalConsent.indexOf('~') !== -1) {
118
118
  // Google Ad Tech Provider IDs
119
119
  const atpIds = additionalConsent.substring(additionalConsent.indexOf('~') + 1);
120
- deepSetValue(
121
- request,
122
- 'user.ext.consented_providers_settings.consented_providers',
123
- atpIds.split('.').map(id => parseInt(id, 10))
124
- );
120
+ if (atpIds) {
121
+ deepSetValue(
122
+ request,
123
+ 'user.ext.consented_providers_settings.consented_providers',
124
+ atpIds.split('.').map(id => parseInt(id, 10))
125
+ );
126
+ }
125
127
  }
126
128
  }
127
129
 
128
130
  // Timeout
129
- deepSetValue(request, 'tmax', bidderRequest.timeout);
131
+ if (bidderRequest.timeout) {
132
+ request.tmax = parseInt(bidderRequest.timeout);
133
+ }
130
134
  // US Privacy
131
135
  if (typeof bidderRequest.uspConsent !== typeof undefined) {
132
136
  deepSetValue(request, 'regs.ext.us_privacy', bidderRequest.uspConsent);
@@ -72,17 +72,25 @@ function buildImpression(bidRequest) {
72
72
  ext.gpid = gpid;
73
73
  }
74
74
 
75
+ const instl = deepAccess(bidRequest, 'ortb2Imp.instl')
76
+ const secure = location.protocol === 'https:' ? 1 : 0;
77
+ const pos = deepAccess(bidRequest, 'mediaTypes.banner.pos');
78
+
75
79
  return {
76
80
  id: bidRequest.bidId,
77
81
  tagid: bidRequest.adUnitCode,
82
+ instl,
83
+ secure,
78
84
  banner: {
79
85
  format,
86
+ pos,
80
87
  },
81
88
  ext,
82
89
  };
83
90
  }
84
91
 
85
92
  function buildDevice() {
93
+ const deviceConfig = config.getConfig('device');
86
94
  const device = {
87
95
  w: window.innerWidth,
88
96
  h: window.innerHeight,
@@ -93,8 +101,6 @@ function buildDevice() {
93
101
  },
94
102
  };
95
103
 
96
- const deviceConfig = config.getConfig('device');
97
-
98
104
  if (typeof deviceConfig === 'object') {
99
105
  Object.assign(device, deviceConfig);
100
106
  }
@@ -115,13 +121,17 @@ function buildRegs(bidderRequest) {
115
121
  return {};
116
122
  }
117
123
 
118
- function buildUser() {
124
+ function buildUser(bid) {
119
125
  const userId = getUserId() || generateUUID();
126
+ const yob = deepAccess(bid, 'params.user.yob')
127
+ const gender = deepAccess(bid, 'params.user.gender')
120
128
 
121
129
  setUserId(userId);
122
130
 
123
131
  return {
124
132
  id: userId,
133
+ yob,
134
+ gender,
125
135
  };
126
136
  }
127
137
 
@@ -158,7 +168,7 @@ function buildRequest(validBidRequests, bidderRequest) {
158
168
  },
159
169
  device: buildDevice(),
160
170
  regs: buildRegs(bidderRequest),
161
- user: buildUser(),
171
+ user: buildUser(validBidRequests[0]),
162
172
  imp: validBidRequests.map((bidRequest) => buildImpression(bidRequest)),
163
173
  ext: {
164
174
  insticator: {
@@ -6,6 +6,7 @@ import { BANNER, VIDEO } from '../src/mediaTypes.js';
6
6
  import { ajax } from '../src/ajax.js';
7
7
  import { getRefererInfo } from '../src/refererDetection.js';
8
8
  import { Renderer } from '../src/Renderer.js';
9
+ import {createEidsArray} from './userId/eids.js';
9
10
 
10
11
  const BIDDER_CODE = 'jixie';
11
12
  export const storage = getStorageManager({bidderCode: BIDDER_CODE});
@@ -121,6 +122,17 @@ function getMiscDims_() {
121
122
  return ret;
122
123
  }
123
124
 
125
+ /* function addUserId(eids, id, source, rti) {
126
+ if (id) {
127
+ if (rti) {
128
+ eids.push({ source, id, rti_partner: rti });
129
+ } else {
130
+ eids.push({ source, id });
131
+ }
132
+ }
133
+ return eids;
134
+ } */
135
+
124
136
  // easier for replacement in the unit test
125
137
  export const internal = {
126
138
  getDevice: getDevice_,
@@ -163,7 +175,22 @@ export const spec = {
163
175
  }
164
176
 
165
177
  let ids = fetchIds_();
178
+ let eids = [];
166
179
  let miscDims = internal.getMiscDims();
180
+
181
+ // all available user ids are sent to our backend in the standard array layout:
182
+ if (validBidRequests[0].userId) {
183
+ let eids1 = createEidsArray(validBidRequests[0].userId);
184
+ if (eids1.length) {
185
+ eids = eids1;
186
+ }
187
+ }
188
+ // we want to send this blob of info to our backend:
189
+ let pg = config.getConfig('priceGranularity');
190
+ if (!pg) {
191
+ pg = {};
192
+ }
193
+
167
194
  let transformedParams = Object.assign({}, {
168
195
  auctionid: bidderRequest.auctionId,
169
196
  timeout: bidderRequest.timeout,
@@ -174,6 +201,8 @@ export const spec = {
174
201
  pageurl: miscDims.pageurl,
175
202
  mkeywords: miscDims.mkeywords,
176
203
  bids: bids,
204
+ eids: eids,
205
+ pricegranularity: pg,
177
206
  cfg: jixieCfgBlob
178
207
  }, ids);
179
208
  return Object.assign({}, {
@@ -7,6 +7,7 @@ Maintainer: contact@jixie.io
7
7
  # Description
8
8
 
9
9
  Module that connects to Jixie demand source to fetch bids.
10
+ All prebid-supported user ids are sent to Jixie endpoint, if available.
10
11
 
11
12
  # Test Parameters
12
13
  ```
@@ -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
+ const mediaId = vat.mediaID;
159
+ const contentId = getContentId(mediaId);
160
+ const contentSegments = getContentSegments(vat.segments);
161
+ const contentData = getContentData(mediaId, contentSegments);
160
162
  const targeting = formatTargetingResponse(vat);
161
163
  enrichBids(adUnit.bids, targeting, contentId, contentData);
162
164
  };
@@ -263,7 +265,7 @@ export function getContentId(mediaID) {
263
265
  return 'jw_' + mediaID;
264
266
  }
265
267
 
266
- export function getContentData(segments) {
268
+ export function getContentSegments(segments) {
267
269
  if (!segments || !segments.length) {
268
270
  return;
269
271
  }
@@ -276,13 +278,29 @@ export function getContentData(segments) {
276
278
  return convertedSegments;
277
279
  }, []);
278
280
 
279
- return {
280
- name: 'jwplayer',
281
- ext: {
282
- segtax: 502
283
- },
284
- segment: formattedSegments
281
+ return formattedSegments;
282
+ }
283
+
284
+ export function getContentData(mediaId, segments) {
285
+ if (!mediaId && !segments) {
286
+ return;
287
+ }
288
+
289
+ const contentData = {
290
+ name: 'jwplayer.com',
291
+ ext: {}
285
292
  };
293
+
294
+ if (mediaId) {
295
+ contentData.ext.cids = [mediaId];
296
+ }
297
+
298
+ if (segments) {
299
+ contentData.segment = segments;
300
+ contentData.ext.segtax = 502;
301
+ }
302
+
303
+ return contentData;
286
304
  }
287
305
 
288
306
  export function addOrtbSiteContent(bid, contentId, contentData) {