prebid.js 7.44.0 → 7.45.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 (254) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/acuityAdsBidAdapter.js +1 -1
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adtrgtmeBidAdapter.js +1 -1
  9. package/dist/adxcgBidAdapter.js +1 -1
  10. package/dist/adyoulikeBidAdapter.js +1 -1
  11. package/dist/ajaBidAdapter.js +1 -1
  12. package/dist/amxBidAdapter.js +1 -1
  13. package/dist/amxIdSystem.js +1 -1
  14. package/dist/appierAnalyticsAdapter.js +1 -1
  15. package/dist/appnexusBidAdapter.js +1 -1
  16. package/dist/appushBidAdapter.js +1 -1
  17. package/dist/asoBidAdapter.js +1 -1
  18. package/dist/axonixBidAdapter.js +1 -1
  19. package/dist/beyondmediaBidAdapter.js +1 -1
  20. package/dist/bidglassBidAdapter.js +1 -1
  21. package/dist/big-richmediaBidAdapter.js +1 -1
  22. package/dist/braveBidAdapter.js +1 -1
  23. package/dist/bridgewellBidAdapter.js +1 -1
  24. package/dist/brightMountainMediaBidAdapter.js +1 -1
  25. package/dist/brightcomBidAdapter.js +1 -1
  26. package/dist/brightcomSSPBidAdapter.js +1 -1
  27. package/dist/carodaBidAdapter.js +1 -1
  28. package/dist/chtnwBidAdapter.js +1 -1
  29. package/dist/coinzillaBidAdapter.js +1 -1
  30. package/dist/compassBidAdapter.js +1 -1
  31. package/dist/concertBidAdapter.js +1 -1
  32. package/dist/connectIdSystem.js +1 -1
  33. package/dist/connectadBidAdapter.js +1 -1
  34. package/dist/consumableBidAdapter.js +1 -1
  35. package/dist/contentexchangeBidAdapter.js +1 -1
  36. package/dist/conversantAnalyticsAdapter.js +1 -1
  37. package/dist/conversantBidAdapter.js +1 -1
  38. package/dist/craftBidAdapter.js +1 -1
  39. package/dist/criteoBidAdapter.js +1 -1
  40. package/dist/cwireBidAdapter.js +1 -1
  41. package/dist/dependencies.json +12 -0
  42. package/dist/domainOverrideToRootDomain.js +1 -0
  43. package/dist/dspxBidAdapter.js +1 -1
  44. package/dist/eplanningBidAdapter.js +1 -1
  45. package/dist/feedadBidAdapter.js +1 -1
  46. package/dist/finativeBidAdapter.js +1 -1
  47. package/dist/freewheel-sspBidAdapter.js +1 -1
  48. package/dist/glimpseBidAdapter.js +1 -1
  49. package/dist/globalsunBidAdapter.js +1 -1
  50. package/dist/gmosspBidAdapter.js +1 -1
  51. package/dist/goldbachBidAdapter.js +1 -1
  52. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  53. package/dist/gridBidAdapter.js +1 -1
  54. package/dist/gridNMBidAdapter.js +1 -1
  55. package/dist/growthCodeIdSystem.js +1 -1
  56. package/dist/gumgumBidAdapter.js +1 -1
  57. package/dist/h12mediaBidAdapter.js +1 -1
  58. package/dist/id5IdSystem.js +1 -1
  59. package/dist/improvedigitalBidAdapter.js +1 -1
  60. package/dist/inmarBidAdapter.js +1 -1
  61. package/dist/insticatorBidAdapter.js +1 -1
  62. package/dist/iqzoneBidAdapter.js +1 -1
  63. package/dist/ivsBidAdapter.js +1 -0
  64. package/dist/ixBidAdapter.js +1 -1
  65. package/dist/justpremiumBidAdapter.js +1 -1
  66. package/dist/jwplayerVideoProvider.js +1 -1
  67. package/dist/kargoBidAdapter.js +1 -1
  68. package/dist/koblerBidAdapter.js +1 -1
  69. package/dist/konduitAnalyticsAdapter.js +1 -1
  70. package/dist/kueezBidAdapter.js +1 -1
  71. package/dist/kueezRtbBidAdapter.js +1 -1
  72. package/dist/kulturemediaBidAdapter.js +1 -1
  73. package/dist/lassoBidAdapter.js +1 -1
  74. package/dist/lifestreetBidAdapter.js +1 -1
  75. package/dist/liveIntentIdSystem.js +1 -1
  76. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  77. package/dist/logicadBidAdapter.js +1 -1
  78. package/dist/loglyliftBidAdapter.js +1 -1
  79. package/dist/luponmediaBidAdapter.js +1 -1
  80. package/dist/magniteAnalyticsAdapter.js +1 -1
  81. package/dist/malltvAnalyticsAdapter.js +1 -1
  82. package/dist/marsmediaBidAdapter.js +1 -1
  83. package/dist/mathildeadsBidAdapter.js +1 -1
  84. package/dist/mediafuseBidAdapter.js +1 -1
  85. package/dist/medianetBidAdapter.js +1 -1
  86. package/dist/mediasquareBidAdapter.js +1 -1
  87. package/dist/mgidBidAdapter.js +1 -1
  88. package/dist/minutemediaBidAdapter.js +1 -1
  89. package/dist/minutemediaplusBidAdapter.js +1 -1
  90. package/dist/nexx360BidAdapter.js +1 -1
  91. package/dist/not-for-prod/prebid.js +158 -156
  92. package/dist/oguryBidAdapter.js +1 -1
  93. package/dist/onetagBidAdapter.js +1 -1
  94. package/dist/onomagicBidAdapter.js +1 -1
  95. package/dist/ooloAnalyticsAdapter.js +1 -1
  96. package/dist/openxBidAdapter.js +1 -1
  97. package/dist/openxOrtbBidAdapter.js +1 -1
  98. package/dist/operaadsBidAdapter.js +1 -1
  99. package/dist/optidigitalBidAdapter.js +1 -1
  100. package/dist/outbrainBidAdapter.js +1 -1
  101. package/dist/parrableIdSystem.js +1 -1
  102. package/dist/pixfutureBidAdapter.js +1 -1
  103. package/dist/prebid-core.js +1 -1
  104. package/dist/publinkIdSystem.js +1 -1
  105. package/dist/pubmaticBidAdapter.js +1 -1
  106. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  107. package/dist/pubxBidAdapter.js +1 -1
  108. package/dist/pxyzBidAdapter.js +1 -1
  109. package/dist/quantcastBidAdapter.js +1 -1
  110. package/dist/readpeakBidAdapter.js +1 -1
  111. package/dist/relaidoBidAdapter.js +1 -1
  112. package/dist/rhythmoneBidAdapter.js +1 -1
  113. package/dist/riseBidAdapter.js +1 -1
  114. package/dist/rubiconAnalyticsAdapter.js +1 -1
  115. package/dist/rubiconBidAdapter.js +1 -1
  116. package/dist/seedingAllianceBidAdapter.js +1 -1
  117. package/dist/seedtagBidAdapter.js +1 -1
  118. package/dist/sharedIdSystem.js +1 -1
  119. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  120. package/dist/sharethroughBidAdapter.js +1 -1
  121. package/dist/shinezBidAdapter.js +1 -1
  122. package/dist/smaatoBidAdapter.js +1 -1
  123. package/dist/smartadserverBidAdapter.js +1 -1
  124. package/dist/smarthubBidAdapter.js +1 -1
  125. package/dist/smartxBidAdapter.js +1 -1
  126. package/dist/smilewantedBidAdapter.js +1 -1
  127. package/dist/sonobiBidAdapter.js +1 -1
  128. package/dist/sovrnAnalyticsAdapter.js +1 -1
  129. package/dist/sovrnBidAdapter.js +1 -1
  130. package/dist/sspBCBidAdapter.js +1 -1
  131. package/dist/stvBidAdapter.js +1 -1
  132. package/dist/sublimeBidAdapter.js +1 -1
  133. package/dist/synacormediaBidAdapter.js +1 -1
  134. package/dist/targetVideoBidAdapter.js +1 -1
  135. package/dist/teadsBidAdapter.js +1 -1
  136. package/dist/trionBidAdapter.js +1 -1
  137. package/dist/tripleliftBidAdapter.js +1 -1
  138. package/dist/truereachBidAdapter.js +1 -1
  139. package/dist/ttdBidAdapter.js +1 -1
  140. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  141. package/dist/uid2IdSystem.js +1 -1
  142. package/dist/underdogmediaBidAdapter.js +1 -1
  143. package/dist/undertoneBidAdapter.js +1 -1
  144. package/dist/userId.js +1 -1
  145. package/dist/vidazooBidAdapter.js +1 -1
  146. package/dist/videobyteBidAdapter.js +1 -1
  147. package/dist/videoheroesBidAdapter.js +1 -1
  148. package/dist/vidoomyBidAdapter.js +1 -1
  149. package/dist/visiblemeasuresBidAdapter.js +1 -1
  150. package/dist/visxBidAdapter.js +1 -1
  151. package/dist/vrtcalBidAdapter.js +1 -1
  152. package/dist/vuukleBidAdapter.js +1 -1
  153. package/dist/widespaceBidAdapter.js +1 -1
  154. package/dist/winrBidAdapter.js +1 -1
  155. package/dist/yahoosspBidAdapter.js +1 -1
  156. package/dist/yieldmoBidAdapter.js +1 -1
  157. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  158. package/dist/yieldoneBidAdapter.js +1 -1
  159. package/libraries/domainOverrideToRootDomain/index.js +39 -0
  160. package/modules/acuityAdsBidAdapter.js +1 -1
  161. package/modules/amxBidAdapter.js +1 -1
  162. package/modules/amxIdSystem.js +23 -20
  163. package/modules/amxIdSystem.md +7 -7
  164. package/modules/appushBidAdapter.js +1 -1
  165. package/modules/beyondmediaBidAdapter.js +1 -1
  166. package/modules/braveBidAdapter.js +1 -1
  167. package/modules/brightcomBidAdapter.js +1 -1
  168. package/modules/brightcomSSPBidAdapter.js +1 -1
  169. package/modules/coinzillaBidAdapter.js +1 -2
  170. package/modules/compassBidAdapter.js +1 -1
  171. package/modules/connectIdSystem.js +96 -21
  172. package/modules/connectIdSystem.md +6 -5
  173. package/modules/contentexchangeBidAdapter.js +1 -1
  174. package/modules/freewheel-sspBidAdapter.js +8 -0
  175. package/modules/glimpseBidAdapter.js +1 -2
  176. package/modules/globalsunBidAdapter.js +1 -1
  177. package/modules/gridBidAdapter.js +1 -1
  178. package/modules/gridNMBidAdapter.js +1 -1
  179. package/modules/growthCodeIdSystem.js +18 -15
  180. package/modules/gumgumBidAdapter.js +1 -1
  181. package/modules/iqzoneBidAdapter.js +1 -1
  182. package/modules/ivsBidAdapter.js +85 -0
  183. package/modules/ivsBidAdapter.md +34 -0
  184. package/modules/ixBidAdapter.js +42 -105
  185. package/modules/jwplayerVideoProvider.js +25 -32
  186. package/modules/koblerBidAdapter.js +1 -2
  187. package/modules/kueezBidAdapter.js +1 -1
  188. package/modules/liveIntentIdSystem.js +8 -0
  189. package/modules/luponmediaBidAdapter.js +1 -1
  190. package/modules/magniteAnalyticsAdapter.js +76 -3
  191. package/modules/mathildeadsBidAdapter.js +1 -1
  192. package/modules/medianetBidAdapter.js +1 -1
  193. package/modules/mgidBidAdapter.js +178 -26
  194. package/modules/minutemediaBidAdapter.js +1 -1
  195. package/modules/oguryBidAdapter.js +3 -2
  196. package/modules/onomagicBidAdapter.js +1 -2
  197. package/modules/openxBidAdapter.js +192 -563
  198. package/modules/openxBidAdapter.md +22 -20
  199. package/modules/openxOrtbBidAdapter.js +13 -11
  200. package/modules/openxOrtbBidAdapter.md +5 -3
  201. package/modules/operaadsBidAdapter.js +1 -1
  202. package/modules/pubmaticBidAdapter.js +1 -1
  203. package/modules/pubxBidAdapter.js +5 -2
  204. package/modules/riseBidAdapter.js +1 -1
  205. package/modules/sharedIdSystem.js +4 -27
  206. package/modules/sharethroughBidAdapter.js +1 -1
  207. package/modules/shinezBidAdapter.js +1 -1
  208. package/modules/smarthubBidAdapter.js +1 -1
  209. package/modules/synacormediaBidAdapter.js +1 -3
  210. package/modules/truereachBidAdapter.js +1 -2
  211. package/modules/userId/eids.js +18 -0
  212. package/modules/userId/eids.md +16 -0
  213. package/modules/videoheroesBidAdapter.js +1 -1
  214. package/modules/vidoomyBidAdapter.js +22 -1
  215. package/modules/visiblemeasuresBidAdapter.js +1 -1
  216. package/modules/vrtcalBidAdapter.js +1 -1
  217. package/modules/yieldoneBidAdapter.js +1 -1
  218. package/package.json +1 -1
  219. package/src/Renderer.js +2 -1
  220. package/src/native.js +5 -1
  221. package/test/spec/auctionmanager_spec.js +2 -2
  222. package/test/spec/libraries/domainOverrideToRootDomain/index_spec.js +77 -0
  223. package/test/spec/modules/acuityAdsBidAdapter_spec.js +2 -1
  224. package/test/spec/modules/amxIdSystem_spec.js +13 -26
  225. package/test/spec/modules/appushBidAdapter_spec.js +2 -1
  226. package/test/spec/modules/beyondmediaBidAdapter_spec.js +2 -1
  227. package/test/spec/modules/compassBidAdapter_spec.js +2 -1
  228. package/test/spec/modules/connectIdSystem_spec.js +420 -242
  229. package/test/spec/modules/contentexchangeBidAdapter_spec.js +2 -1
  230. package/test/spec/modules/eids_spec.js +30 -0
  231. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +37 -0
  232. package/test/spec/modules/globalsunBidAdapter_spec.js +2 -1
  233. package/test/spec/modules/iqzoneBidAdapter_spec.js +2 -1
  234. package/test/spec/modules/ivsBidAdapter_spec.js +197 -0
  235. package/test/spec/modules/ixBidAdapter_spec.js +84 -71
  236. package/test/spec/modules/koblerBidAdapter_spec.js +0 -20
  237. package/test/spec/modules/liveIntentIdSystem_spec.js +10 -0
  238. package/test/spec/modules/luponmediaBidAdapter_spec.js +1 -1
  239. package/test/spec/modules/magniteAnalyticsAdapter_spec.js +129 -1
  240. package/test/spec/modules/mathildeadsBidAdapter_spec.js +2 -1
  241. package/test/spec/modules/mgidBidAdapter_spec.js +184 -36
  242. package/test/spec/modules/oguryBidAdapter_spec.js +19 -4
  243. package/test/spec/modules/openxBidAdapter_spec.js +1157 -1936
  244. package/test/spec/modules/openxOrtbBidAdapter_spec.js +12 -39
  245. package/test/spec/modules/pubxBidAdapter_spec.js +10 -2
  246. package/test/spec/modules/sharedIdSystem_spec.js +0 -46
  247. package/test/spec/modules/sharethroughBidAdapter_spec.js +2 -1
  248. package/test/spec/modules/smarthubBidAdapter_spec.js +2 -1
  249. package/test/spec/modules/synacormediaBidAdapter_spec.js +0 -26
  250. package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +17 -4
  251. package/test/spec/modules/vidoomyBidAdapter_spec.js +35 -0
  252. package/test/spec/modules/visiblemeasuresBidAdapter_spec.js +2 -1
  253. package/test/spec/modules/vrtcalBidAdapter_spec.js +3 -2
  254. package/test/spec/renderer_spec.js +1 -2
@@ -8,14 +8,86 @@
8
8
  import {ajax} from '../src/ajax.js';
9
9
  import {submodule} from '../src/hook.js';
10
10
  import {includes} from '../src/polyfill.js';
11
- import {formatQS, logError} from '../src/utils.js';
11
+ import {getRefererInfo} from '../src/refererDetection.js';
12
+ import {getStorageManager} from '../src/storageManager.js';
13
+ import {formatQS, isPlainObject, logError, parseUrl} from '../src/utils.js';
14
+ import {uspDataHandler} from '../src/adapterManager.js';
15
+ import {MODULE_TYPE_UID} from '../src/activities/modules.js';
12
16
 
13
17
  const MODULE_NAME = 'connectId';
18
+ const STORAGE_EXPIRY_DAYS = 14;
14
19
  const VENDOR_ID = 25;
15
20
  const PLACEHOLDER = '__PIXEL_ID__';
16
21
  const UPS_ENDPOINT = `https://ups.analytics.yahoo.com/ups/${PLACEHOLDER}/fed`;
17
22
  const OVERRIDE_OPT_OUT_KEY = 'connectIdOptOut';
18
23
  const INPUT_PARAM_KEYS = ['pixelId', 'he', 'puid'];
24
+ export const storage = getStorageManager({moduleType: MODULE_TYPE_UID, moduleName: MODULE_NAME});
25
+
26
+ /**
27
+ * @function
28
+ * @param {Object} obj
29
+ */
30
+ function storeObject(obj) {
31
+ const expires = Date.now() + (60 * 60 * 24 * 1000 * STORAGE_EXPIRY_DAYS);
32
+ if (storage.cookiesAreEnabled()) {
33
+ setEtldPlusOneCookie(MODULE_NAME, JSON.stringify(obj), new Date(expires), getSiteHostname());
34
+ } else if (storage.localStorageIsEnabled()) {
35
+ obj.__expires = expires;
36
+ storage.setDataInLocalStorage(MODULE_NAME, obj);
37
+ }
38
+ }
39
+
40
+ /**
41
+ * Attempts to store a cookie on eTLD + 1
42
+ *
43
+ * @function
44
+ * @param {String} key
45
+ * @param {String} value
46
+ * @param {Date} expirationDate
47
+ * @param {String} hostname
48
+ */
49
+ function setEtldPlusOneCookie(key, value, expirationDate, hostname) {
50
+ const subDomains = hostname.split('.');
51
+ for (let i = 0; i < subDomains.length; ++i) {
52
+ const domain = subDomains.slice(subDomains.length - i - 1, subDomains.length).join('.');
53
+ try {
54
+ storage.setCookie(key, value, expirationDate.toUTCString(), null, '.' + domain);
55
+ const storedCookie = storage.getCookie(key);
56
+ if (storedCookie && storedCookie === value) {
57
+ break;
58
+ }
59
+ } catch (error) {}
60
+ }
61
+ }
62
+
63
+ function getIdFromCookie() {
64
+ if (storage.cookiesAreEnabled()) {
65
+ try {
66
+ return JSON.parse(storage.getCookie(MODULE_NAME));
67
+ } catch {}
68
+ }
69
+ return null;
70
+ }
71
+
72
+ function getIdFromLocalStorage() {
73
+ if (storage.localStorageIsEnabled()) {
74
+ const storedIdData = storage.getDataFromLocalStorage(MODULE_NAME);
75
+ if (storedIdData) {
76
+ if (isPlainObject(storedIdData) && storedIdData.__expires &&
77
+ storedIdData.__expires <= Date.now()) {
78
+ storage.removeDataFromLocalStorage(MODULE_NAME);
79
+ return null;
80
+ }
81
+ return storedIdData;
82
+ }
83
+ }
84
+ return null;
85
+ }
86
+
87
+ function getSiteHostname() {
88
+ const pageInfo = parseUrl(getRefererInfo().page);
89
+ return pageInfo.hostname;
90
+ }
19
91
 
20
92
  /** @type {Submodule} */
21
93
  export const connectIdSubmodule = {
@@ -37,8 +109,8 @@ export const connectIdSubmodule = {
37
109
  if (connectIdSubmodule.userHasOptedOut()) {
38
110
  return undefined;
39
111
  }
40
- return (typeof value === 'object' && value.connectid)
41
- ? {connectId: value.connectid} : undefined;
112
+ return (isPlainObject(value) && (value.connectId || value.connectid))
113
+ ? {connectId: value.connectId || value.connectid} : undefined;
42
114
  },
43
115
  /**
44
116
  * Gets the Yahoo ConnectID
@@ -54,21 +126,28 @@ export const connectIdSubmodule = {
54
126
  const params = config.params || {};
55
127
  if (!params || (typeof params.he !== 'string' && typeof params.puid !== 'string') ||
56
128
  (typeof params.pixelId === 'undefined' && typeof params.endpoint === 'undefined')) {
57
- logError('The connectId submodule requires the \'pixelId\' and at least one of the \'he\' ' +
58
- 'or \'puid\' parameters to be defined.');
129
+ logError(`${MODULE_NAME} module: configurataion requires the 'pixelId' and at ` +
130
+ `least one of the 'he' or 'puid' parameters to be defined.`);
59
131
  return;
60
132
  }
61
133
 
134
+ const storedId = getIdFromCookie() || getIdFromLocalStorage();
135
+ if (storedId) {
136
+ return {id: storedId};
137
+ }
138
+
139
+ const uspString = uspDataHandler.getConsentData() || '';
62
140
  const data = {
141
+ v: '1',
63
142
  '1p': includes([1, '1', true], params['1p']) ? '1' : '0',
64
143
  gdpr: connectIdSubmodule.isEUConsentRequired(consentData) ? '1' : '0',
65
- gdpr_consent: connectIdSubmodule.isEUConsentRequired(consentData) ? consentData.gdpr.consentString : '',
66
- us_privacy: consentData && consentData.uspConsent ? consentData.uspConsent : ''
144
+ gdpr_consent: connectIdSubmodule.isEUConsentRequired(consentData) ? consentData.consentString : '',
145
+ us_privacy: uspString
67
146
  };
68
147
 
69
- if (connectIdSubmodule.isUnderGPPJurisdiction(consentData)) {
70
- data.gpp = consentData.gppConsent.gppString;
71
- data.gpp_sid = encodeURIComponent(consentData.gppConsent.applicableSections.join(','));
148
+ let topmostLocation = getRefererInfo().topmostLocation;
149
+ if (typeof topmostLocation === 'string') {
150
+ data.url = topmostLocation.split('?')[0];
72
151
  }
73
152
 
74
153
  INPUT_PARAM_KEYS.forEach(key => {
@@ -84,6 +163,11 @@ export const connectIdSubmodule = {
84
163
  if (response) {
85
164
  try {
86
165
  responseObj = JSON.parse(response);
166
+ if (isPlainObject(responseObj) && Object.keys(responseObj).length > 0) {
167
+ storeObject(responseObj);
168
+ } else {
169
+ logError(`${MODULE_NAME} module: UPS response returned an invalid payload ${response}`);
170
+ }
87
171
  } catch (error) {
88
172
  logError(error);
89
173
  }
@@ -91,7 +175,7 @@ export const connectIdSubmodule = {
91
175
  callback(responseObj);
92
176
  },
93
177
  error: error => {
94
- logError(`${MODULE_NAME}: ID fetch encountered an error`, error);
178
+ logError(`${MODULE_NAME} module: ID fetch encountered an error`, error);
95
179
  callback();
96
180
  }
97
181
  };
@@ -108,16 +192,7 @@ export const connectIdSubmodule = {
108
192
  * @returns {Boolean}
109
193
  */
110
194
  isEUConsentRequired(consentData) {
111
- return !!(consentData && consentData.gdpr && consentData.gdpr.gdprApplies);
112
- },
113
-
114
- /**
115
- * Utility function that returns a boolean flag indicating if the opportunity
116
- * is subject to GPP jurisdiction.
117
- * @returns {Boolean}
118
- */
119
- isUnderGPPJurisdiction(consentData) {
120
- return !!(consentData && consentData.gppConsent && consentData.gppConsent.gppString);
195
+ return !!(consentData?.gdprApplies);
121
196
  },
122
197
 
123
198
  /**
@@ -27,8 +27,9 @@ The below parameters apply only to the Yahoo ConnectID user ID Module.
27
27
 
28
28
  | Param under usersync.userIds[] | Scope | Type | Description | Example |
29
29
  | --- | --- | --- | --- | --- |
30
- | name | Required | String | ID value for the Yahoo ConnectID module - `"connectId"` | `"connectId"` |
31
- | params | Required | Object | Data for Yahoo ConnectID initialization. | |
32
- | params.pixelId | Required | Number | The Yahoo supplied publisher specific pixel Id. | `8976` |
33
- | params.he | Optional | String | The SHA-256 hashed user email address. One of either the `he` parameter or the `puid` parameter must be supplied. | `"529cb86de31e9547a712d9f380146e98bbd39beec"` |
34
- | params.puid | Optional | String | The publisher-supplied user identifier. One of either the `he` parameter or the `puid` parameter must be supplied. | `"P-975484817"` |
30
+ | name | Required | String | The name of this module. | `"connectId"` |
31
+ | params | Required | Object | Container of all module params. ||
32
+ | params.pixelId | Required | Number |
33
+ The Yahoo-supplied publisher-specific pixel ID. | `"0000"` |
34
+ | params.he | Optional | String | The SHA-256 hashed user email address which has been lowercased prior to hashing. Pass both `he` and `puid` params if present, otherwise pass either of the two that is available. |`"ed8ddbf5a171981db8ef938596ca297d5e3f84bcc280041c5880dba3baf9c1d4"`|
35
+ | params.puid | Optional | String | The publisher supplied user identifier such as a first-party cookie. Pass both `he` and `puid` params if present, otherwise pass either of the two that is available. | `"ab9iibf5a231ii1db8ef911596ca297d5e3f84biii00041c5880dba3baf9c1da"` |
@@ -157,7 +157,7 @@ export const spec = {
157
157
  coppa: config.getConfig('coppa') === true ? 1 : 0,
158
158
  ccpa: bidderRequest.uspConsent || undefined,
159
159
  gdpr: bidderRequest.gdprConsent || undefined,
160
- tmax: config.getConfig('bidderTimeout')
160
+ tmax: bidderRequest.timeout
161
161
  };
162
162
 
163
163
  const len = validBidRequests.length;
@@ -424,6 +424,14 @@ export const spec = {
424
424
  requestParams.playerSize = playerSize[0] + 'x' + playerSize[1];
425
425
  }
426
426
 
427
+ // Add video context and placement in requestParams
428
+ if (currentBidRequest.mediaTypes.video) {
429
+ var videoContext = currentBidRequest.mediaTypes.video.context ? currentBidRequest.mediaTypes.video.context : 'instream';
430
+ var videoPlacement = currentBidRequest.mediaTypes.video.placement ? currentBidRequest.mediaTypes.video.placement : 1;
431
+ requestParams.video_context = videoContext;
432
+ requestParams.video_placement = videoPlacement;
433
+ }
434
+
427
435
  return {
428
436
  method: 'GET',
429
437
  url: FREEWHEEL_ADSSETUP,
@@ -1,5 +1,4 @@
1
1
  import { registerBidder } from '../src/adapters/bidderFactory.js';
2
- import { config } from '../src/config.js';
3
2
  import { BANNER } from '../src/mediaTypes.js';
4
3
  import { getStorageManager } from '../src/storageManager.js';
5
4
  import {
@@ -99,7 +98,7 @@ function getReferer(bidderRequest) {
99
98
  function buildQuery(bidderRequest) {
100
99
  let url = appendQueryParam(ENDPOINT, 'ver', '$prebid.version$');
101
100
 
102
- const timeout = config.getConfig('bidderTimeout');
101
+ const timeout = bidderRequest.timeout;
103
102
  url = appendQueryParam(url, 'tmax', timeout);
104
103
 
105
104
  if (gdprApplies(bidderRequest)) {
@@ -155,7 +155,7 @@ export const spec = {
155
155
  coppa: config.getConfig('coppa') === true ? 1 : 0,
156
156
  ccpa: bidderRequest.uspConsent || undefined,
157
157
  gdpr: bidderRequest.gdprConsent || undefined,
158
- tmax: config.getConfig('bidderTimeout')
158
+ tmax: bidderRequest.timeout
159
159
  };
160
160
 
161
161
  const len = validBidRequests.length;
@@ -93,7 +93,7 @@ export const spec = {
93
93
  let {bidderRequestId, auctionId, gdprConsent, uspConsent, timeout, refererInfo, gppConsent} = bidderRequest || {};
94
94
 
95
95
  const referer = refererInfo ? encodeURIComponent(refererInfo.page) : '';
96
- const tmax = timeout || config.getConfig('bidderTimeout');
96
+ const tmax = timeout;
97
97
  const imp = [];
98
98
  const bidsMap = {};
99
99
  const requests = [];
@@ -135,7 +135,7 @@ export const spec = {
135
135
  reqSource.ext.schain = schain;
136
136
  }
137
137
 
138
- const bidderTimeout = config.getConfig('bidderTimeout') || timeout;
138
+ const bidderTimeout = timeout;
139
139
  const tmax = timeout ? Math.min(bidderTimeout, timeout) : bidderTimeout;
140
140
 
141
141
  const request = {
@@ -11,9 +11,9 @@ import { submodule } from '../src/hook.js'
11
11
  import {getStorageManager} from '../src/storageManager.js';
12
12
  import {MODULE_TYPE_UID} from '../src/activities/modules.js';
13
13
 
14
- const GCID_EXPIRY = 7;
15
14
  const MODULE_NAME = 'growthCodeId';
16
15
  const GC_DATA_KEY = '_gc_data';
16
+ const GCID_KEY = 'gcid';
17
17
  const ENDPOINT_URL = 'https://p2.gcprivacy.com/v1/pb?'
18
18
 
19
19
  export const storage = getStorageManager({ moduleType: MODULE_TYPE_UID, moduleName: MODULE_NAME });
@@ -26,14 +26,16 @@ export const storage = getStorageManager({ moduleType: MODULE_TYPE_UID, moduleNa
26
26
  export function readData(key) {
27
27
  try {
28
28
  let payload
29
- if (storage.cookiesAreEnabled()) {
30
- payload = tryParse(storage.getCookie(key))
29
+ if (storage.cookiesAreEnabled(null)) {
30
+ payload = tryParse(storage.getCookie(key, null))
31
31
  }
32
32
  if (storage.hasLocalStorage()) {
33
- payload = tryParse(storage.getDataFromLocalStorage(key))
33
+ payload = tryParse(storage.getDataFromLocalStorage(key, null))
34
34
  }
35
- if ((payload.expire_at !== undefined) && (payload.expire_at > (Date.now() / 1000))) {
36
- return payload
35
+ if (payload !== undefined) {
36
+ if (payload.expire_at > (Date.now() / 1000)) {
37
+ return payload
38
+ }
37
39
  }
38
40
  } catch (error) {
39
41
  logError(error);
@@ -51,12 +53,8 @@ function storeData(key, value) {
51
53
  logInfo(MODULE_NAME + ': storing data: key=' + key + ' value=' + value);
52
54
 
53
55
  if (value) {
54
- if (storage.hasLocalStorage()) {
55
- storage.setDataInLocalStorage(key, value);
56
- }
57
- const expiresStr = (new Date(Date.now() + (GCID_EXPIRY * (60 * 60 * 24 * 1000)))).toUTCString();
58
- if (storage.cookiesAreEnabled()) {
59
- storage.setCookie(key, value, expiresStr, 'LAX');
56
+ if (storage.hasLocalStorage(null)) {
57
+ storage.setDataInLocalStorage(key, value, null);
60
58
  }
61
59
  }
62
60
  } catch (error) {
@@ -70,11 +68,15 @@ function storeData(key, value) {
70
68
  * @param {object|null}
71
69
  */
72
70
  function tryParse(data) {
71
+ let payload;
73
72
  try {
74
- return JSON.parse(data);
73
+ payload = JSON.parse(data);
74
+ if (payload == null) {
75
+ return undefined
76
+ }
77
+ return payload
75
78
  } catch (err) {
76
- logError(err);
77
- return null;
79
+ return undefined;
78
80
  }
79
81
  }
80
82
 
@@ -150,6 +152,7 @@ export const growthCodeIdSubmodule = {
150
152
  // If response is a valid json and should save is true
151
153
  if (respJson) {
152
154
  storeData(GC_DATA_KEY, JSON.stringify(respJson))
155
+ storeData(GCID_KEY, respJson.gc_id);
153
156
  callback(respJson);
154
157
  } else {
155
158
  callback();
@@ -284,7 +284,7 @@ function buildRequests(validBidRequests, bidderRequest) {
284
284
  const gdprConsent = bidderRequest && bidderRequest.gdprConsent;
285
285
  const uspConsent = bidderRequest && bidderRequest.uspConsent;
286
286
  const gppConsent = bidderRequest && bidderRequest.gppConsent;
287
- const timeout = config.getConfig('bidderTimeout');
287
+ const timeout = bidderRequest && bidderRequest.timeout
288
288
  const coppa = config.getConfig('coppa') === true ? 1 : 0;
289
289
  const topWindowUrl = bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.page;
290
290
  _each(validBidRequests, bidRequest => {
@@ -154,7 +154,7 @@ export const spec = {
154
154
  coppa: config.getConfig('coppa') === true ? 1 : 0,
155
155
  ccpa: bidderRequest.uspConsent || undefined,
156
156
  gdpr: bidderRequest.gdprConsent || undefined,
157
- tmax: config.getConfig('bidderTimeout')
157
+ tmax: bidderRequest.timeout
158
158
  };
159
159
 
160
160
  const len = validBidRequests.length;
@@ -0,0 +1,85 @@
1
+ import { ortbConverter } from '../libraries/ortbConverter/converter.js';
2
+ import { deepAccess, deepSetValue, getBidIdParameter, logError } from '../src/utils.js';
3
+ import { registerBidder } from '../src/adapters/bidderFactory.js';
4
+ import { VIDEO } from '../src/mediaTypes.js';
5
+ import { INSTREAM } from '../src/video.js';
6
+
7
+ const BIDDER_CODE = 'ivs';
8
+ const ENDPOINT_URL = 'https://a.ivstracker.net/prod/openrtb/2.5';
9
+
10
+ export const converter = ortbConverter({
11
+ context: {
12
+ mediaType: VIDEO,
13
+ ttl: 360,
14
+ netRevenue: true
15
+ }
16
+ });
17
+
18
+ export const spec = {
19
+ code: BIDDER_CODE,
20
+ supportedMediaTypes: [VIDEO],
21
+
22
+ /**
23
+ * Determines whether or not the given bid request is valid.
24
+ *
25
+ * @param {BidRequest} bid The bid params to validate.
26
+ * @return boolean True if this is a valid bid, and false otherwise.
27
+ */
28
+ isBidRequestValid: function(bid) {
29
+ if (bid && typeof bid.params !== 'object') {
30
+ logError(BIDDER_CODE + ': params is not defined or is incorrect in the bidder settings.');
31
+ return false;
32
+ }
33
+
34
+ if (!deepAccess(bid, 'mediaTypes.video')) {
35
+ logError(BIDDER_CODE + ': mediaTypes.video is not present in the bidder settings.');
36
+ return false;
37
+ }
38
+
39
+ if (deepAccess(bid, 'mediaTypes.video.context') !== INSTREAM) {
40
+ logError(BIDDER_CODE + ': only instream video context is allowed.');
41
+ return false;
42
+ }
43
+
44
+ if (!getBidIdParameter('publisherId', bid.params)) {
45
+ logError(BIDDER_CODE + ': publisherId is not present in bidder params.');
46
+ return false;
47
+ }
48
+
49
+ return true;
50
+ },
51
+
52
+ /**
53
+ * Make a server request from the list of BidRequests.
54
+ *
55
+ * @param {validBidRequests[]} - an array of bids
56
+ * @param {bidderRequest} - master bidRequest object
57
+ * @return ServerRequest Info describing the request to the server.
58
+ */
59
+ buildRequests: function(validBidRequests, bidderRequest) {
60
+ const data = converter.toORTB({ bidderRequest, validBidRequests, context: {mediaType: 'video'} });
61
+ deepSetValue(data.site, 'publisher.id', validBidRequests[0].params.publisherId);
62
+
63
+ return {
64
+ method: 'POST',
65
+ url: ENDPOINT_URL,
66
+ data: data,
67
+ options: {
68
+ contentType: 'application/json'
69
+ },
70
+ };
71
+ },
72
+
73
+ /**
74
+ * Unpack the response from the server into a list of bids.
75
+ *
76
+ * @param {ServerResponse} serverResponse A successful response from the server.
77
+ * @return {Bid[]} An array of bids which were nested inside the server.
78
+ */
79
+ interpretResponse: function(serverResponse, bidRequest) {
80
+ if (!serverResponse.body) return;
81
+ return converter.fromORTB({ response: serverResponse.body, request: bidRequest.data }).bids;
82
+ },
83
+ }
84
+
85
+ registerBidder(spec);
@@ -0,0 +1,34 @@
1
+ # Overview
2
+
3
+ ```
4
+ Module Name: IVS Bidder Adapter
5
+ Module Type: Bidder Adapter
6
+ Maintainer: prebid@ivs.tv
7
+ ```
8
+
9
+ # Description
10
+
11
+ Module that connects to IVS's demand sources
12
+
13
+ # Test Parameters
14
+ ```
15
+ var adUnits = [
16
+ {
17
+ code: 'test-div',
18
+ mediaTypes: {
19
+ video: {
20
+ playerSize: [640, 480],
21
+ context: 'instream'
22
+ }
23
+ },
24
+ bids: [
25
+ {
26
+ bidder: 'ivs',
27
+ params: {
28
+ publisherId: '3001234' // required
29
+ }
30
+ }
31
+ ]
32
+ }
33
+ ];
34
+ ```