prebid.js 7.33.0 → 7.35.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 (219) hide show
  1. package/.devcontainer/devcontainer.json +2 -1
  2. package/.github/workflows/issue_tracker.yml +27 -16
  3. package/dist/33acrossBidAdapter.js +1 -1
  4. package/dist/33acrossIdSystem.js +1 -1
  5. package/dist/adagioBidAdapter.js +1 -1
  6. package/dist/adbookpspBidAdapter.js +1 -1
  7. package/dist/adgenerationBidAdapter.js +1 -1
  8. package/dist/admaticBidAdapter.js +1 -1
  9. package/dist/admixerBidAdapter.js +1 -1
  10. package/dist/adnuntiusBidAdapter.js +1 -1
  11. package/dist/adrelevantisBidAdapter.js +1 -1
  12. package/dist/adtrgtmeBidAdapter.js +1 -1
  13. package/dist/adxcgBidAdapter.js +1 -1
  14. package/dist/adyoulikeBidAdapter.js +1 -1
  15. package/dist/ajaBidAdapter.js +1 -1
  16. package/dist/amxBidAdapter.js +1 -1
  17. package/dist/amxIdSystem.js +1 -1
  18. package/dist/appierAnalyticsAdapter.js +1 -1
  19. package/dist/appnexusBidAdapter.js +1 -1
  20. package/dist/arcspanRtdProvider.js +1 -0
  21. package/dist/asoBidAdapter.js +1 -1
  22. package/dist/axonixBidAdapter.js +1 -1
  23. package/dist/bidglassBidAdapter.js +1 -1
  24. package/dist/big-richmediaBidAdapter.js +1 -1
  25. package/dist/bliinkBidAdapter.js +1 -1
  26. package/dist/bridgewellBidAdapter.js +1 -1
  27. package/dist/brightMountainMediaBidAdapter.js +1 -1
  28. package/dist/carodaBidAdapter.js +1 -1
  29. package/dist/chtnwBidAdapter.js +1 -1
  30. package/dist/concertBidAdapter.js +1 -1
  31. package/dist/connectadBidAdapter.js +1 -1
  32. package/dist/consentManagement.js +1 -1
  33. package/dist/consumableBidAdapter.js +1 -1
  34. package/dist/conversantBidAdapter.js +1 -1
  35. package/dist/craftBidAdapter.js +1 -1
  36. package/dist/criteoBidAdapter.js +1 -1
  37. package/dist/cwireBidAdapter.js +1 -1
  38. package/dist/dspxBidAdapter.js +1 -1
  39. package/dist/emx_digitalBidAdapter.js +1 -1
  40. package/dist/eplanningBidAdapter.js +1 -1
  41. package/dist/feedadBidAdapter.js +1 -1
  42. package/dist/finativeBidAdapter.js +1 -1
  43. package/dist/glimpseBidAdapter.js +1 -1
  44. package/dist/gmosspBidAdapter.js +1 -1
  45. package/dist/goldbachBidAdapter.js +1 -1
  46. package/dist/gridBidAdapter.js +1 -1
  47. package/dist/gridNMBidAdapter.js +1 -1
  48. package/dist/gumgumBidAdapter.js +1 -1
  49. package/dist/h12mediaBidAdapter.js +1 -1
  50. package/dist/hadronIdSystem.js +1 -1
  51. package/dist/holidBidAdapter.js +1 -1
  52. package/dist/id5IdSystem.js +1 -1
  53. package/dist/improvedigitalBidAdapter.js +1 -1
  54. package/dist/inmarBidAdapter.js +1 -1
  55. package/dist/insticatorBidAdapter.js +1 -1
  56. package/dist/ixBidAdapter.js +1 -1
  57. package/dist/justpremiumBidAdapter.js +1 -1
  58. package/dist/kargoBidAdapter.js +1 -1
  59. package/dist/konduitAnalyticsAdapter.js +1 -1
  60. package/dist/kueezBidAdapter.js +1 -1
  61. package/dist/kueezRtbBidAdapter.js +1 -1
  62. package/dist/lassoBidAdapter.js +1 -1
  63. package/dist/lifestreetBidAdapter.js +1 -1
  64. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  65. package/dist/logicadBidAdapter.js +1 -1
  66. package/dist/loglyliftBidAdapter.js +1 -1
  67. package/dist/lotamePanoramaIdSystem.js +1 -1
  68. package/dist/magniteAnalyticsAdapter.js +1 -1
  69. package/dist/malltvAnalyticsAdapter.js +1 -1
  70. package/dist/marsmediaBidAdapter.js +1 -1
  71. package/dist/mediafuseBidAdapter.js +1 -1
  72. package/dist/mediasquareBidAdapter.js +1 -1
  73. package/dist/mgidBidAdapter.js +1 -1
  74. package/dist/minutemediaBidAdapter.js +1 -1
  75. package/dist/nextMillenniumBidAdapter.js +1 -1
  76. package/dist/nexx360BidAdapter.js +1 -1
  77. package/dist/not-for-prod/prebid.js +140 -149
  78. package/dist/oguryBidAdapter.js +1 -1
  79. package/dist/onetagBidAdapter.js +1 -1
  80. package/dist/ooloAnalyticsAdapter.js +1 -1
  81. package/dist/openxBidAdapter.js +1 -1
  82. package/dist/ortbConverter.js +1 -1
  83. package/dist/outbrainBidAdapter.js +1 -1
  84. package/dist/parrableIdSystem.js +1 -1
  85. package/dist/permutiveRtdProvider.js +1 -1
  86. package/dist/pixfutureBidAdapter.js +1 -1
  87. package/dist/prebid-core.js +1 -1
  88. package/dist/prebidServerBidAdapter.js +1 -1
  89. package/dist/priceFloors.js +1 -1
  90. package/dist/publinkIdSystem.js +1 -1
  91. package/dist/pubmaticBidAdapter.js +1 -1
  92. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  93. package/dist/pulsepointBidAdapter.js +1 -1
  94. package/dist/pxyzBidAdapter.js +1 -1
  95. package/dist/quantcastBidAdapter.js +1 -1
  96. package/dist/readpeakBidAdapter.js +1 -1
  97. package/dist/relaidoBidAdapter.js +1 -1
  98. package/dist/rhythmoneBidAdapter.js +1 -1
  99. package/dist/riseBidAdapter.js +1 -1
  100. package/dist/rubiconAnalyticsAdapter.js +1 -1
  101. package/dist/rubiconBidAdapter.js +1 -1
  102. package/dist/seedingAllianceBidAdapter.js +1 -1
  103. package/dist/seedtagBidAdapter.js +1 -1
  104. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  105. package/dist/sharethroughBidAdapter.js +1 -1
  106. package/dist/shinezBidAdapter.js +1 -1
  107. package/dist/smaatoBidAdapter.js +1 -1
  108. package/dist/smartadserverBidAdapter.js +1 -1
  109. package/dist/smartxBidAdapter.js +1 -1
  110. package/dist/smartytechBidAdapter.js +1 -1
  111. package/dist/smilewantedBidAdapter.js +1 -1
  112. package/dist/sonobiBidAdapter.js +1 -1
  113. package/dist/sovrnAnalyticsAdapter.js +1 -1
  114. package/dist/sovrnBidAdapter.js +1 -1
  115. package/dist/sspBCBidAdapter.js +1 -1
  116. package/dist/sublimeBidAdapter.js +1 -1
  117. package/dist/synacormediaBidAdapter.js +1 -1
  118. package/dist/taboolaBidAdapter.js +1 -1
  119. package/dist/targetVideoBidAdapter.js +1 -1
  120. package/dist/teadsBidAdapter.js +1 -1
  121. package/dist/trionBidAdapter.js +1 -1
  122. package/dist/tripleliftBidAdapter.js +1 -1
  123. package/dist/ttdBidAdapter.js +1 -1
  124. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  125. package/dist/uid2IdSystem.js +1 -1
  126. package/dist/underdogmediaBidAdapter.js +1 -1
  127. package/dist/undertoneBidAdapter.js +1 -1
  128. package/dist/vidazooBidAdapter.js +1 -1
  129. package/dist/videobyteBidAdapter.js +1 -1
  130. package/dist/visxBidAdapter.js +1 -1
  131. package/dist/vuukleBidAdapter.js +1 -1
  132. package/dist/widespaceBidAdapter.js +1 -1
  133. package/dist/winrBidAdapter.js +1 -1
  134. package/dist/yahoosspBidAdapter.js +1 -1
  135. package/dist/yieldmoBidAdapter.js +1 -1
  136. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  137. package/dist/zeta_global_sspBidAdapter.js +1 -1
  138. package/dist/zeusPrimeRtdProvider.js +4 -14
  139. package/integrationExamples/gpt/hello_world.html +0 -0
  140. package/libraries/ortbConverter/processors/default.js +19 -1
  141. package/modules/.submodules.json +1 -0
  142. package/modules/admaticBidAdapter.js +2 -1
  143. package/modules/admixerBidAdapter.js +26 -4
  144. package/modules/adnuntiusBidAdapter.js +36 -38
  145. package/modules/adyoulikeBidAdapter.js +2 -0
  146. package/modules/arcspanRtdProvider.js +73 -0
  147. package/modules/arcspanRtdProvider.md +11 -0
  148. package/modules/bliinkBidAdapter.js +1 -1
  149. package/modules/consentManagement.js +33 -5
  150. package/modules/consumableBidAdapter.js +20 -2
  151. package/modules/criteoBidAdapter.js +1 -1
  152. package/modules/cwireBidAdapter.js +169 -242
  153. package/modules/cwireBidAdapter.md +15 -14
  154. package/modules/emx_digitalBidAdapter.js +9 -2
  155. package/modules/hadronIdSystem.js +37 -32
  156. package/modules/holidBidAdapter.js +9 -4
  157. package/modules/kargoBidAdapter.js +5 -1
  158. package/modules/lotamePanoramaIdSystem.js +9 -1
  159. package/modules/nextMillenniumBidAdapter.js +19 -9
  160. package/modules/nexx360BidAdapter.js +1 -2
  161. package/modules/onetagBidAdapter.js +12 -1
  162. package/modules/openxBidAdapter.js +5 -0
  163. package/modules/outbrainBidAdapter.js +103 -6
  164. package/modules/permutiveRtdProvider.js +17 -12
  165. package/modules/prebidServerBidAdapter/index.js +14 -1
  166. package/modules/prebidServerBidAdapter/ortbConverter.js +1 -1
  167. package/modules/priceFloors.js +7 -8
  168. package/modules/pulsepointBidAdapter.js +2 -0
  169. package/modules/seedingAllianceBidAdapter.js +129 -116
  170. package/modules/smartadserverBidAdapter.js +39 -28
  171. package/modules/smartyadsBidAdapter.md +9 -0
  172. package/modules/smartytechBidAdapter.js +67 -10
  173. package/modules/smartytechBidAdapter.md +44 -33
  174. package/modules/sonobiBidAdapter.js +17 -10
  175. package/modules/taboolaBidAdapter.js +2 -1
  176. package/modules/tripleliftBidAdapter.js +4 -0
  177. package/modules/vidazooBidAdapter.js +56 -22
  178. package/modules/zeta_global_sspBidAdapter.js +15 -0
  179. package/modules/zeusPrimeRtdProvider.js +3 -323
  180. package/modules/zeusPrimeRtdProvider.md +3 -0
  181. package/package.json +1 -1
  182. package/src/adloader.js +2 -1
  183. package/src/auction.js +2 -11
  184. package/src/prebid.js +8 -0
  185. package/src/utils/cpm.js +17 -0
  186. package/test/spec/modules/admixerBidAdapter_spec.js +140 -60
  187. package/test/spec/modules/adnuntiusBidAdapter_spec.js +120 -120
  188. package/test/spec/modules/adyoulikeBidAdapter_spec.js +3 -0
  189. package/test/spec/modules/arcspanRtdProvider_spec.js +187 -0
  190. package/test/spec/modules/bliinkBidAdapter_spec.js +7 -7
  191. package/test/spec/modules/consentManagement_spec.js +49 -1
  192. package/test/spec/modules/consumableBidAdapter_spec.js +46 -0
  193. package/test/spec/modules/cwireBidAdapter_spec.js +249 -335
  194. package/test/spec/modules/emx_digitalBidAdapter_spec.js +30 -1
  195. package/test/spec/modules/hadronIdSystem_spec.js +4 -6
  196. package/test/spec/modules/holidBidAdapter_spec.js +29 -0
  197. package/test/spec/modules/kargoBidAdapter_spec.js +32 -0
  198. package/test/spec/modules/lotamePanoramaIdSystem_spec.js +16 -10
  199. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +14 -2
  200. package/test/spec/modules/nexx360BidAdapter_spec.js +0 -4
  201. package/test/spec/modules/onetagBidAdapter_spec.js +43 -0
  202. package/test/spec/modules/openxBidAdapter_spec.js +41 -0
  203. package/test/spec/modules/openxOrtbBidAdapter_spec.js +41 -0
  204. package/test/spec/modules/outbrainBidAdapter_spec.js +182 -18
  205. package/test/spec/modules/prebidServerBidAdapter_spec.js +138 -0
  206. package/test/spec/modules/pulsepointBidAdapter_spec.js +11 -1
  207. package/test/spec/modules/seedingAllianceAdapter_spec.js +66 -23
  208. package/test/spec/modules/smartadserverBidAdapter_spec.js +116 -5
  209. package/test/spec/modules/smartytechBidAdapter_spec.js +172 -14
  210. package/test/spec/modules/sonobiBidAdapter_spec.js +2 -1
  211. package/test/spec/modules/taboolaBidAdapter_spec.js +12 -3
  212. package/test/spec/modules/tripleliftBidAdapter_spec.js +13 -0
  213. package/test/spec/modules/userId_spec.js +19 -14
  214. package/test/spec/modules/vidazooBidAdapter_spec.js +61 -22
  215. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +8 -0
  216. package/test/spec/ortbConverter/default_processors_spec.js +23 -0
  217. package/test/spec/unit/pbjs_api_spec.js +14 -0
  218. package/test/spec/unit/utils/cpm_spec.js +64 -0
  219. package/test/spec/modules/zeusPrimeRtdProvider_spec.js +0 -410
@@ -1,6 +1,6 @@
1
1
  import { registerBidder } from '../src/adapters/bidderFactory.js';
2
- import { BANNER, VIDEO, NATIVE } from '../src/mediaTypes.js';
3
- import { isStr, deepAccess, logInfo } from '../src/utils.js';
2
+ import { BANNER, VIDEO } from '../src/mediaTypes.js';
3
+ import { isStr, deepAccess } from '../src/utils.js';
4
4
  import { config } from '../src/config.js';
5
5
  import { getStorageManager } from '../src/storageManager.js';
6
6
 
@@ -8,7 +8,7 @@ const BIDDER_CODE = 'adnuntius';
8
8
  const ENDPOINT_URL = 'https://ads.adnuntius.delivery/i';
9
9
  const GVLID = 855;
10
10
  const DEFAULT_VAST_VERSION = 'vast4'
11
- const DEFAULT_NATIVE = 'native'
11
+ // const DEFAULT_NATIVE = 'native'
12
12
 
13
13
  const checkSegment = function (segment) {
14
14
  if (isStr(segment)) return segment;
@@ -28,31 +28,31 @@ const getSegmentsFromOrtb = function (ortb2) {
28
28
  return segments
29
29
  }
30
30
 
31
- function createNative(ad) {
32
- const native = {};
33
- const assets = ad.assets
34
- native.title = ad.text.title.content;
35
- native.image = {
36
- url: assets.image.cdnId,
37
- height: assets.image.height,
38
- width: assets.image.width,
39
- };
40
- if (assets.icon) {
41
- native.icon = {
42
- url: assets.icon.cdnId,
43
- height: assets.icon.height,
44
- width: assets.icon.width,
45
- };
46
- }
47
-
48
- native.sponsoredBy = ad.text.sponsoredBy?.content || '';
49
- native.body = ad.text.body?.content || '';
50
- native.cta = ad.text.cta?.content || '';
51
- native.clickUrl = ad.destinationUrls.destination || '';
52
- native.impressionTrackers = ad.impressionTrackingUrls || [ad.renderedPixel];
53
-
54
- return native;
55
- }
31
+ // function createNative(ad) {
32
+ // const native = {};
33
+ // const assets = ad.assets
34
+ // native.title = ad.text.title.content;
35
+ // native.image = {
36
+ // url: assets.image.cdnId,
37
+ // height: assets.image.height,
38
+ // width: assets.image.width,
39
+ // };
40
+ // if (assets.icon) {
41
+ // native.icon = {
42
+ // url: assets.icon.cdnId,
43
+ // height: assets.icon.height,
44
+ // width: assets.icon.width,
45
+ // };
46
+ // }
47
+
48
+ // native.sponsoredBy = ad.text.sponsoredBy?.content || '';
49
+ // native.body = ad.text.body?.content || '';
50
+ // native.cta = ad.text.cta?.content || '';
51
+ // native.clickUrl = ad.destinationUrls.destination || '';
52
+ // native.impressionTrackers = ad.impressionTrackingUrls || [ad.renderedPixel];
53
+
54
+ // return native;
55
+ // }
56
56
 
57
57
  const handleMeta = function () {
58
58
  const storage = getStorageManager({ gvlid: GVLID, bidderCode: BIDDER_CODE })
@@ -73,7 +73,7 @@ const getUsi = function (meta, ortb2, bidderRequest) {
73
73
  export const spec = {
74
74
  code: BIDDER_CODE,
75
75
  gvlid: GVLID,
76
- supportedMediaTypes: [BANNER, VIDEO, NATIVE],
76
+ supportedMediaTypes: [BANNER, VIDEO],
77
77
  isBidRequestValid: function (bid) {
78
78
  return !!(bid.bidId || (bid.params.member && bid.params.invCode));
79
79
  },
@@ -109,9 +109,9 @@ export const spec = {
109
109
  network += '_video'
110
110
  }
111
111
 
112
- if (bid.mediaTypes && bid.mediaTypes.native) {
113
- network += '_native'
114
- }
112
+ // if (bid.mediaTypes && bid.mediaTypes.native) {
113
+ // network += '_native'
114
+ // }
115
115
 
116
116
  bidRequests[network] = bidRequests[network] || [];
117
117
  bidRequests[network].push(bid);
@@ -130,7 +130,7 @@ export const spec = {
130
130
  const network = networkKeys[j];
131
131
  const networkRequest = [...request]
132
132
  if (network.indexOf('_video') > -1) { networkRequest.push('tt=' + DEFAULT_VAST_VERSION) }
133
- if (network.indexOf('_native') > -1) { networkRequest.push('tt=' + DEFAULT_NATIVE) }
133
+ // if (network.indexOf('_native') > -1) { networkRequest.push('tt=' + DEFAULT_NATIVE) }
134
134
  requests.push({
135
135
  method: 'POST',
136
136
  url: ENDPOINT_URL + '?' + networkRequest.join('&'),
@@ -170,15 +170,13 @@ export const spec = {
170
170
  if (adUnit.vastXml) {
171
171
  adResponse[adUnit.targetId].vastXml = adUnit.vastXml
172
172
  adResponse[adUnit.targetId].mediaType = VIDEO
173
- } else if (ad.assets && ad.assets.image && ad.text && ad.text.title && ad.text.body && ad.destinationUrls && ad.destinationUrls.destination) {
174
- adResponse[adUnit.targetId].native = createNative(ad);
175
- adResponse[adUnit.targetId].mediaType = NATIVE;
173
+ // } else if (ad.assets && ad.assets.image && ad.text && ad.text.title && ad.text.body && ad.destinationUrls && ad.destinationUrls.destination) {
174
+ // adResponse[adUnit.targetId].native = createNative(ad);
175
+ // adResponse[adUnit.targetId].mediaType = NATIVE;
176
176
  } else {
177
177
  adResponse[adUnit.targetId].ad = adUnit.html
178
178
  }
179
179
 
180
- logInfo('BID', adResponse)
181
-
182
180
  return adResponse
183
181
  } else return response
184
182
  }, {});
@@ -126,6 +126,8 @@ export const spec = {
126
126
  payload.userId = createEidsArray(bidderRequest.userId);
127
127
  }
128
128
 
129
+ payload.pbjs_version = '$prebid.version$';
130
+
129
131
  const data = JSON.stringify(payload);
130
132
  const options = {
131
133
  withCredentials: true
@@ -0,0 +1,73 @@
1
+ import { submodule } from '../src/hook.js';
2
+ import { mergeDeep } from '../src/utils.js';
3
+ import {loadExternalScript} from '../src/adloader.js';
4
+
5
+ /** @type {string} */
6
+ const MODULE_NAME = 'realTimeData';
7
+ const SUBMODULE_NAME = 'arcspan';
8
+
9
+ /** @type {RtdSubmodule} */
10
+ export const arcspanSubmodule = {
11
+ name: SUBMODULE_NAME,
12
+ init: init,
13
+ getBidRequestData: alterBidRequests,
14
+ };
15
+
16
+ function init(config, userConsent) {
17
+ if (typeof config.params.silo === 'undefined') {
18
+ return false;
19
+ }
20
+ if (typeof window.arcobj2 === 'undefined') {
21
+ var scriptUrl;
22
+ if (config.params.silo === 'test') {
23
+ scriptUrl = 'https://localhost:8080/as.js';
24
+ } else {
25
+ scriptUrl = 'https://silo' + config.params.silo + '.p7cloud.net/as.js';
26
+ }
27
+ loadExternalScript(scriptUrl, SUBMODULE_NAME);
28
+ }
29
+ return true;
30
+ }
31
+
32
+ function alterBidRequests(reqBidsConfigObj, callback, config, userConsent) {
33
+ var _v1 = [];
34
+ var _v1s = [];
35
+ var _v2 = [];
36
+ var arcobj1 = window.arcobj1;
37
+ if (typeof arcobj1 != 'undefined') {
38
+ if (typeof arcobj1.page_iab_codes.text != 'undefined') { _v1 = _v1.concat(arcobj1.page_iab_codes.text); }
39
+ if (typeof arcobj1.page_iab_codes.images != 'undefined') { _v1 = _v1.concat(arcobj1.page_iab_codes.images); }
40
+ if (typeof arcobj1.page_iab.text != 'undefined') { _v1s = _v1s.concat(arcobj1.page_iab.text); }
41
+ if (typeof arcobj1.page_iab.images != 'undefined') { _v1s = _v1s.concat(arcobj1.page_iab.images); }
42
+ if (typeof arcobj1.page_iab_newcodes.text != 'undefined') { _v2 = [...new Set([..._v2, ...arcobj1.page_iab_newcodes.text])]; }
43
+ if (typeof arcobj1.page_iab_newcodes.images != 'undefined') { _v2 = [...new Set([..._v2, ...arcobj1.page_iab_newcodes.images])]; }
44
+
45
+ var _content = {};
46
+ _content.data = [];
47
+ var p = {};
48
+ p.name = 'arcspan';
49
+ p.segment = [];
50
+ p.ext = { segtax: 6 };
51
+ _v2.forEach(function (e) {
52
+ p.segment = p.segment.concat({ id: e });
53
+ });
54
+ _content.data = _content.data.concat(p);
55
+ var _ortb2 = {
56
+ site: {
57
+ name: 'arcspan',
58
+ domain: new URL(location.href).hostname,
59
+ cat: _v1,
60
+ sectioncat: _v1,
61
+ pagecat: _v1,
62
+ page: location.href,
63
+ ref: document.referrer,
64
+ keywords: _v1s.toString(),
65
+ content: _content,
66
+ },
67
+ };
68
+ mergeDeep(reqBidsConfigObj.ortb2Fragments.global, _ortb2);
69
+ }
70
+ callback();
71
+ }
72
+
73
+ submodule(MODULE_NAME, arcspanSubmodule);
@@ -0,0 +1,11 @@
1
+ # Overview
2
+
3
+ Module Name: ArcSpan Rtd Provider
4
+
5
+ Module Type: Rtd Provider
6
+
7
+ Maintainer: engineering@arcspan.com
8
+
9
+ # Description
10
+
11
+ RTD provider for ArcSpan Technologies. Contact jcabalugaz@arcspan.com for more information.
@@ -125,7 +125,7 @@ export const buildBid = (bidResponse) => {
125
125
  requestId: deepAccess(bidResponse, 'extras.transaction_id'),
126
126
  width: deepAccess(bidResponse, `creative.${bid.mediaType}.width`) || 1,
127
127
  height: deepAccess(bidResponse, `creative.${bid.mediaType}.height`) || 1,
128
- ttl: 3600,
128
+ ttl: 300,
129
129
  netRevenue: true,
130
130
  });
131
131
  };
@@ -18,12 +18,16 @@ const CMP_VERSION = 2;
18
18
 
19
19
  export let userCMP;
20
20
  export let consentTimeout;
21
+ export let actionTimeout;
21
22
  export let gdprScope;
22
23
  export let staticConsentData;
23
24
 
24
25
  let consentData;
25
26
  let addedConsentHook = false;
26
27
  let provisionalConsent;
28
+ let onTimeout;
29
+ let timer = null;
30
+ let actionTimer = null;
27
31
 
28
32
  // add new CMPs here, with their dedicated lookup function
29
33
  const cmpCallMap = {
@@ -39,6 +43,12 @@ function lookupStaticConsentData({onSuccess, onError}) {
39
43
  processCmpData(staticConsentData, {onSuccess, onError})
40
44
  }
41
45
 
46
+ export function setActionTimeout(timeout = setTimeout) {
47
+ clearTimeout(timer);
48
+ timer = null;
49
+ actionTimer = timeout(onTimeout, actionTimeout);
50
+ }
51
+
42
52
  /**
43
53
  * This function handles interacting with an IAB compliant CMP to obtain the consent information of the user.
44
54
  * Given the async nature of the CMP's API, we pass in acting success/error callback functions to exit this function
@@ -84,6 +94,7 @@ function lookupIabConsent({onSuccess, onError}) {
84
94
  processCmpData(tcfData, {onSuccess, onError});
85
95
  } else {
86
96
  provisionalConsent = tcfData;
97
+ if (!isNaN(actionTimeout) && actionTimer === null && timer != null) setActionTimeout();
87
98
  }
88
99
  } else {
89
100
  onError('CMP unable to register callback function. Please check CMP setup.');
@@ -162,14 +173,20 @@ function lookupIabConsent({onSuccess, onError}) {
162
173
  * @param cb A callback that takes: a boolean that is true if the auction should be canceled; an error message and extra
163
174
  * error arguments that will be undefined if there's no error.
164
175
  */
165
- function loadConsentData(cb) {
176
+ export function loadConsentData(cb, callMap = cmpCallMap, timeout = setTimeout) {
166
177
  let isDone = false;
167
- let timer = null;
168
178
 
169
179
  function done(consentData, shouldCancelAuction, errMsg, ...extraArgs) {
170
180
  if (timer != null) {
171
181
  clearTimeout(timer);
182
+ timer = null;
183
+ }
184
+
185
+ if (actionTimer != null) {
186
+ clearTimeout(actionTimer);
187
+ actionTimer = null;
172
188
  }
189
+
173
190
  isDone = true;
174
191
  gdprDataHandler.setConsentData(consentData);
175
192
  if (typeof cb === 'function') {
@@ -188,10 +205,11 @@ function loadConsentData(cb) {
188
205
  done(null, true, msg, ...extraArgs);
189
206
  }
190
207
  }
191
- cmpCallMap[userCMP](callbacks);
208
+
209
+ callMap[userCMP](callbacks);
192
210
 
193
211
  if (!isDone) {
194
- const onTimeout = () => {
212
+ onTimeout = () => {
195
213
  const continueToAuction = (data) => {
196
214
  done(data, false, 'CMP did not load, continuing auction...');
197
215
  }
@@ -200,10 +218,16 @@ function loadConsentData(cb) {
200
218
  onError: () => continueToAuction(storeConsentData(undefined))
201
219
  })
202
220
  }
221
+
203
222
  if (consentTimeout === 0) {
204
223
  onTimeout();
205
224
  } else {
206
- timer = setTimeout(onTimeout, consentTimeout);
225
+ if (timer != null) {
226
+ clearTimeout(timer);
227
+ timer = null;
228
+ }
229
+
230
+ timer = timeout(onTimeout, consentTimeout);
207
231
  }
208
232
  }
209
233
  }
@@ -328,6 +352,10 @@ export function setConsentConfig(config) {
328
352
  logInfo(`consentManagement config did not specify cmp. Using system default setting (${DEFAULT_CMP}).`);
329
353
  }
330
354
 
355
+ if (isNumber(config.actionTimeout)) {
356
+ actionTimeout = config.actionTimeout;
357
+ }
358
+
331
359
  if (isNumber(config.timeout)) {
332
360
  consentTimeout = config.timeout;
333
361
  } else {
@@ -180,12 +180,26 @@ export const spec = {
180
180
  return bidResponses;
181
181
  },
182
182
 
183
- getUserSyncs: function(syncOptions, serverResponses) {
183
+ getUserSyncs: function(syncOptions, serverResponses, gdprConsent, uspConsent) {
184
+ let syncUrl = 'https://sync.serverbid.com/ss/' + siteId + '.html';
185
+
184
186
  if (syncOptions.iframeEnabled) {
187
+ if (gdprConsent && gdprConsent.consentString) {
188
+ if (typeof gdprConsent.gdprApplies === 'boolean') {
189
+ syncUrl = appendUrlParam(syncUrl, `gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`);
190
+ } else {
191
+ syncUrl = appendUrlParam(syncUrl, `gdpr=0&gdpr_consent=${gdprConsent.consentString}`);
192
+ }
193
+ }
194
+
195
+ if (uspConsent && uspConsent.consentString) {
196
+ syncUrl = appendUrlParam(syncUrl, `us_privacy=${uspConsent.consentString}`);
197
+ }
198
+
185
199
  if (!serverResponses || serverResponses.length === 0 || !serverResponses[0].body.bdr || serverResponses[0].body.bdr !== 'cx') {
186
200
  return [{
187
201
  type: 'iframe',
188
- url: 'https://sync.serverbid.com/ss/' + siteId + '.html'
202
+ url: syncUrl
189
203
  }];
190
204
  }
191
205
  }
@@ -294,4 +308,8 @@ function getBidFloor(bid, sizes) {
294
308
  return floor;
295
309
  }
296
310
 
311
+ function appendUrlParam(url, queryString) {
312
+ return `${url}${url.indexOf('?') > -1 ? '&' : '?'}${queryString}`;
313
+ }
314
+
297
315
  registerBidder(spec);
@@ -27,7 +27,7 @@ const LOG_PREFIX = 'Criteo: ';
27
27
  Unminified source code can be found in the privately shared repo: https://github.com/Prebid-org/prebid-js-external-js-criteo/blob/master/dist/prod.js
28
28
  */
29
29
  const FAST_BID_VERSION_PLACEHOLDER = '%FAST_BID_VERSION%';
30
- export const FAST_BID_VERSION_CURRENT = 133;
30
+ export const FAST_BID_VERSION_CURRENT = 134;
31
31
  const FAST_BID_VERSION_LATEST = 'latest';
32
32
  const FAST_BID_VERSION_NONE = 'none';
33
33
  const PUBLISHER_TAG_URL_TEMPLATE = 'https://static.criteo.net/js/ld/publishertag.prebid' + FAST_BID_VERSION_PLACEHOLDER + '.js';