prebid.js 9.7.0 → 9.9.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 (255) hide show
  1. package/.github/codeql/codeql-config.yml +3 -0
  2. package/.github/codeql/queries/deviceMemory.ql +14 -0
  3. package/.github/codeql/queries/hardwareConcurrency.ql +14 -0
  4. package/.github/codeql/queries/prebid.qll +36 -0
  5. package/.github/codeql/queries/qlpack.yml +8 -0
  6. package/.github/workflows/jscpd.yml +1 -1
  7. package/dist/33acrossAnalyticsAdapter.js +1 -1
  8. package/dist/33acrossBidAdapter.js +1 -1
  9. package/dist/33acrossIdSystem.js +1 -1
  10. package/dist/BTBidAdapter.js +1 -1
  11. package/dist/adagioAnalyticsAdapter.js +1 -1
  12. package/dist/adagioBidAdapter.js +1 -1
  13. package/dist/adagioUtils.js +1 -1
  14. package/dist/addefendBidAdapter.js +1 -1
  15. package/dist/adgenerationBidAdapter.js +1 -1
  16. package/dist/adlooxRtdProvider.js +1 -1
  17. package/dist/admixerBidAdapter.js +1 -1
  18. package/dist/adqueryBidAdapter.js +1 -1
  19. package/dist/adrelevantisBidAdapter.js +1 -1
  20. package/dist/adstirBidAdapter.js +1 -1
  21. package/dist/adtrgtmeBidAdapter.js +1 -1
  22. package/dist/adxcgAnalyticsAdapter.js +1 -1
  23. package/dist/adxcgBidAdapter.js +1 -1
  24. package/dist/adyoulikeBidAdapter.js +1 -1
  25. package/dist/agmaAnalyticsAdapter.js +1 -1
  26. package/dist/ajaBidAdapter.js +1 -1
  27. package/dist/amxBidAdapter.js +1 -1
  28. package/dist/amxIdSystem.js +1 -1
  29. package/dist/appierAnalyticsAdapter.js +1 -1
  30. package/dist/appnexusBidAdapter.js +1 -1
  31. package/dist/asoBidAdapter.js +1 -1
  32. package/dist/axonixBidAdapter.js +1 -1
  33. package/dist/bidglassBidAdapter.js +1 -1
  34. package/dist/big-richmediaBidAdapter.js +1 -1
  35. package/dist/bridBidAdapter.js +1 -1
  36. package/dist/bridgewellBidAdapter.js +1 -1
  37. package/dist/brightMountainMediaBidAdapter.js +1 -1
  38. package/dist/carodaBidAdapter.js +1 -1
  39. package/dist/ccxBidAdapter.js +1 -1
  40. package/dist/chtnwBidAdapter.js +1 -1
  41. package/dist/chunk-core.js +1 -1
  42. package/dist/concertBidAdapter.js +1 -1
  43. package/dist/connectadBidAdapter.js +1 -1
  44. package/dist/consumableBidAdapter.js +1 -1
  45. package/dist/contxtfulRtdProvider.js +1 -1
  46. package/dist/conversantAnalyticsAdapter.js +1 -1
  47. package/dist/conversantBidAdapter.js +1 -1
  48. package/dist/craftBidAdapter.js +1 -1
  49. package/dist/criteoBidAdapter.js +1 -1
  50. package/dist/cwireBidAdapter.js +1 -1
  51. package/dist/dailymotionBidAdapter.js +1 -1
  52. package/dist/dependencies.json +19 -4
  53. package/dist/discoveryBidAdapter.js +1 -1
  54. package/dist/docereeAdManagerBidAdapter.js +1 -1
  55. package/dist/dspxBidAdapter.js +1 -1
  56. package/dist/dxkultureBidAdapter.js +1 -1
  57. package/dist/eclickadsBidAdapter.js +1 -0
  58. package/dist/eightPodAnalyticsAdapter.js +1 -1
  59. package/dist/eplanningBidAdapter.js +1 -1
  60. package/dist/euidIdSystem.js +1 -1
  61. package/dist/exadsBidAdapter.js +1 -1
  62. package/dist/feedadBidAdapter.js +1 -1
  63. package/dist/finativeBidAdapter.js +1 -1
  64. package/dist/freewheel-sspBidAdapter.js +1 -1
  65. package/dist/gmosspBidAdapter.js +1 -1
  66. package/dist/goldbachBidAdapter.js +1 -1
  67. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  68. package/dist/greenbidsRtdProvider.js +1 -1
  69. package/dist/gridBidAdapter.js +1 -1
  70. package/dist/gumgumBidAdapter.js +1 -1
  71. package/dist/h12mediaBidAdapter.js +1 -1
  72. package/dist/hypelabBidAdapter.js +1 -1
  73. package/dist/id5AnalyticsAdapter.js +1 -1
  74. package/dist/id5IdSystem.js +1 -1
  75. package/dist/imdsBidAdapter.js +1 -1
  76. package/dist/improvedigitalBidAdapter.js +1 -1
  77. package/dist/insticatorBidAdapter.js +1 -1
  78. package/dist/intentIqAnalyticsAdapter.js +1 -1
  79. package/dist/ixBidAdapter.js +1 -1
  80. package/dist/jixieBidAdapter.js +1 -1
  81. package/dist/justpremiumBidAdapter.js +1 -1
  82. package/dist/kargoBidAdapter.js +1 -1
  83. package/dist/kimberliteBidAdapter.js +1 -1
  84. package/dist/konduitAnalyticsAdapter.js +1 -1
  85. package/dist/kueezBidAdapter.js +1 -1
  86. package/dist/lassoBidAdapter.js +1 -1
  87. package/dist/lifestreetBidAdapter.js +1 -1
  88. package/dist/limelightDigitalBidAdapter.js +1 -1
  89. package/dist/liveIntentIdSystem.js +1 -1
  90. package/dist/logicadBidAdapter.js +1 -1
  91. package/dist/loglyliftBidAdapter.js +1 -1
  92. package/dist/luceadBidAdapter.js +1 -1
  93. package/dist/mabidderBidAdapter.js +1 -1
  94. package/dist/magniteAnalyticsAdapter.js +1 -1
  95. package/dist/malltvAnalyticsAdapter.js +1 -1
  96. package/dist/marsmediaBidAdapter.js +1 -1
  97. package/dist/mediafuseBidAdapter.js +1 -1
  98. package/dist/mediagoBidAdapter.js +1 -1
  99. package/dist/medianetAnalyticsAdapter.js +1 -1
  100. package/dist/medianetBidAdapter.js +1 -1
  101. package/dist/mediasquareBidAdapter.js +1 -1
  102. package/dist/mgidBidAdapter.js +1 -1
  103. package/dist/mgidUtils.js +1 -0
  104. package/dist/mgidXBidAdapter.js +1 -1
  105. package/dist/missenaBidAdapter.js +1 -1
  106. package/dist/mobianRtdProvider.js +1 -1
  107. package/dist/naveggIdSystem.js +1 -1
  108. package/dist/navigatorData.js +1 -0
  109. package/dist/nexx360BidAdapter.js +1 -1
  110. package/dist/nobidAnalyticsAdapter.js +1 -1
  111. package/dist/nobidBidAdapter.js +1 -1
  112. package/dist/not-for-prod/prebid.js +174 -169
  113. package/dist/oguryBidAdapter.js +1 -1
  114. package/dist/omsBidAdapter.js +1 -1
  115. package/dist/onetagBidAdapter.js +1 -1
  116. package/dist/ooloAnalyticsAdapter.js +1 -1
  117. package/dist/openxBidAdapter.js +1 -1
  118. package/dist/optidigitalBidAdapter.js +1 -1
  119. package/dist/orbidderBidAdapter.js +1 -1
  120. package/dist/outbrainBidAdapter.js +1 -1
  121. package/dist/pixfutureBidAdapter.js +1 -1
  122. package/dist/pstudioBidAdapter.js +1 -1
  123. package/dist/publinkIdSystem.js +1 -1
  124. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  125. package/dist/pubmaticBidAdapter.js +1 -1
  126. package/dist/pubriseBidAdapter.js +1 -0
  127. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  128. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  129. package/dist/pubxaiRtdProvider.js +1 -1
  130. package/dist/pxyzBidAdapter.js +1 -1
  131. package/dist/quantcastBidAdapter.js +1 -1
  132. package/dist/readpeakBidAdapter.js +1 -1
  133. package/dist/redtramBidAdapter.js +1 -1
  134. package/dist/relaidoBidAdapter.js +1 -1
  135. package/dist/retailspotBidAdapter.js +1 -1
  136. package/dist/rhythmoneBidAdapter.js +1 -1
  137. package/dist/richaudienceBidAdapter.js +1 -1
  138. package/dist/riseUtils.js +1 -1
  139. package/dist/rubiconBidAdapter.js +1 -1
  140. package/dist/seedingAllianceBidAdapter.js +1 -1
  141. package/dist/seedtagBidAdapter.js +1 -1
  142. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  143. package/dist/sharethroughBidAdapter.js +1 -1
  144. package/dist/smaatoBidAdapter.js +1 -1
  145. package/dist/smartadserverBidAdapter.js +1 -1
  146. package/dist/smarthubBidAdapter.js +1 -1
  147. package/dist/smartxBidAdapter.js +1 -1
  148. package/dist/smilewantedBidAdapter.js +1 -1
  149. package/dist/snigelBidAdapter.js +1 -1
  150. package/dist/sonobiBidAdapter.js +1 -1
  151. package/dist/sovrnBidAdapter.js +1 -1
  152. package/dist/sspBCBidAdapter.js +1 -1
  153. package/dist/stvBidAdapter.js +1 -1
  154. package/dist/sublimeBidAdapter.js +1 -1
  155. package/dist/taboolaBidAdapter.js +1 -1
  156. package/dist/tappxBidAdapter.js +1 -1
  157. package/dist/targetVideoAdServerVideo.js +1 -0
  158. package/dist/targetVideoBidAdapter.js +1 -1
  159. package/dist/teadsBidAdapter.js +1 -1
  160. package/dist/teqblazeUtils.js +1 -1
  161. package/dist/terceptAnalyticsAdapter.js +1 -1
  162. package/dist/themoneytizerBidAdapter.js +1 -1
  163. package/dist/trionBidAdapter.js +1 -1
  164. package/dist/tripleliftBidAdapter.js +1 -1
  165. package/dist/ttdBidAdapter.js +1 -1
  166. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  167. package/dist/uid2IdSystem.js +1 -1
  168. package/dist/underdogmediaBidAdapter.js +1 -1
  169. package/dist/undertoneBidAdapter.js +1 -1
  170. package/dist/unrulyBidAdapter.js +1 -1
  171. package/dist/userId.js +1 -1
  172. package/dist/vidazooUtils.js +1 -1
  173. package/dist/videobyteBidAdapter.js +1 -1
  174. package/dist/visxBidAdapter.js +1 -1
  175. package/dist/vuukleBidAdapter.js +1 -1
  176. package/dist/widespaceBidAdapter.js +1 -1
  177. package/dist/winrBidAdapter.js +1 -1
  178. package/dist/yahooAdsBidAdapter.js +1 -1
  179. package/dist/yieldmoBidAdapter.js +1 -1
  180. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  181. package/libraries/mgidUtils/mgidUtils.js +73 -0
  182. package/{src/fpd/navigator.js → libraries/navigatorData/navigatorData.js} +1 -1
  183. package/libraries/riseUtils/index.js +1 -1
  184. package/libraries/teqblazeUtils/bidderUtils.js +1 -1
  185. package/modules/admixerBidAdapter.js +12 -5
  186. package/modules/appnexusBidAdapter.js +1 -1
  187. package/modules/ccxBidAdapter.js +6 -2
  188. package/modules/contxtfulRtdProvider.js +15 -12
  189. package/modules/cwireBidAdapter.js +13 -9
  190. package/modules/cwireBidAdapter.md +29 -10
  191. package/modules/dailymotionBidAdapter.js +1 -1
  192. package/modules/dailymotionBidAdapter.md +11 -7
  193. package/modules/discoveryBidAdapter.js +1 -3
  194. package/modules/docereeAdManagerBidAdapter.js +14 -8
  195. package/modules/eclickadsBidAdapter.js +80 -0
  196. package/modules/eclickadsBidAdapter.md +55 -0
  197. package/modules/eightPodAnalyticsAdapter.js +13 -1
  198. package/modules/gumgumBidAdapter.js +6 -2
  199. package/modules/ixBidAdapter.js +0 -1
  200. package/modules/limelightDigitalBidAdapter.js +1 -1
  201. package/modules/mediagoBidAdapter.js +2 -4
  202. package/modules/mgidBidAdapter.js +30 -109
  203. package/modules/mgidXBidAdapter.js +2 -66
  204. package/modules/mobianRtdProvider.js +12 -8
  205. package/modules/naveggIdSystem.js +62 -58
  206. package/modules/naveggIdSystem.md +8 -0
  207. package/modules/oguryBidAdapter.js +5 -2
  208. package/modules/omsBidAdapter.js +1 -1
  209. package/modules/openxBidAdapter.js +1 -6
  210. package/modules/pstudioBidAdapter.js +5 -8
  211. package/modules/pstudioBidAdapter.md +6 -4
  212. package/modules/pubriseBidAdapter.js +19 -0
  213. package/modules/pubriseBidAdapter.md +79 -0
  214. package/modules/pubxaiAnalyticsAdapter.js +9 -4
  215. package/modules/pubxaiRtdProvider.js +38 -18
  216. package/modules/pubxaiRtdProvider.md +2 -2
  217. package/modules/redtramBidAdapter.js +2 -6
  218. package/modules/richaudienceBidAdapter.js +8 -1
  219. package/modules/rubiconBidAdapter.js +3 -3
  220. package/modules/smarthubBidAdapter.js +2 -0
  221. package/modules/targetVideoAdServerVideo.js +96 -0
  222. package/modules/targetVideoAdServerVideo.md +26 -0
  223. package/modules/teadsBidAdapter.js +4 -3
  224. package/modules/undertoneBidAdapter.js +1 -19
  225. package/modules/userId/index.js +1 -1
  226. package/package.json +1 -1
  227. package/src/adRendering.js +3 -0
  228. package/src/adapterManager.js +4 -0
  229. package/src/utils/focusTimeout.js +17 -6
  230. package/src/utils/ttlCollection.js +1 -1
  231. package/src/utils.js +28 -0
  232. package/test/spec/modules/admixerBidAdapter_spec.js +2 -2
  233. package/test/spec/modules/ccxBidAdapter_spec.js +81 -0
  234. package/test/spec/modules/contxtfulRtdProvider_spec.js +19 -19
  235. package/test/spec/modules/dailymotionBidAdapter_spec.js +12 -12
  236. package/test/spec/modules/discoveryBidAdapter_spec.js +1 -47
  237. package/test/spec/modules/docereeAdManagerBidAdapter_spec.js +87 -9
  238. package/test/spec/modules/eclickadsBidAdapter_spec.js +214 -0
  239. package/test/spec/modules/ixBidAdapter_spec.js +8 -1
  240. package/test/spec/modules/mobianRtdProvider_spec.js +32 -15
  241. package/test/spec/modules/naveggIdSystem_spec.js +141 -31
  242. package/test/spec/modules/oguryBidAdapter_spec.js +50 -4
  243. package/test/spec/modules/openxBidAdapter_spec.js +16 -49
  244. package/test/spec/modules/pstudioBidAdapter_spec.js +5 -5
  245. package/test/spec/modules/pubriseBidAdapter_spec.js +514 -0
  246. package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +9 -4
  247. package/test/spec/modules/pubxaiRtdProvider_spec.js +37 -5
  248. package/test/spec/modules/richaudienceBidAdapter_spec.js +62 -0
  249. package/test/spec/modules/rubiconBidAdapter_spec.js +10 -0
  250. package/test/spec/modules/targetVideoAdServerVideo_spec.js +179 -0
  251. package/test/spec/modules/trafficgateBidAdapter_spec.js +1 -1
  252. package/test/spec/ortbConverter/userId_spec.js +23 -2
  253. package/test/spec/unit/adRendering_spec.js +27 -1
  254. package/test/spec/unit/core/adapterManager_spec.js +10 -0
  255. package/test/spec/unit/utils/focusTimeout_spec.js +33 -6
@@ -6,9 +6,9 @@
6
6
  */
7
7
  import { isStr, isPlainObject, logError } from '../src/utils.js';
8
8
  import { submodule } from '../src/hook.js';
9
- import { ajax } from '../src/ajax.js';
10
- import {getStorageManager} from '../src/storageManager.js';
11
- import {MODULE_TYPE_UID} from '../src/activities/modules.js';
9
+ import { ajaxBuilder } from '../src/ajax.js';
10
+ import { getStorageManager } from '../src/storageManager.js';
11
+ import { MODULE_TYPE_UID } from '../src/activities/modules.js';
12
12
 
13
13
  /**
14
14
  * @typedef {import('../modules/userId/index.js').Submodule} Submodule
@@ -19,61 +19,72 @@ const MODULE_NAME = 'naveggId';
19
19
  const OLD_NAVEGG_ID = 'nid';
20
20
  const NAVEGG_ID = 'nvggid';
21
21
  const BASE_URL = 'https://id.navegg.com/uid/';
22
- const DEFAULT_EXPIRE = 8 * 24 * 3600 * 1000;
23
- const INVALID_EXPIRE = 3600 * 1000;
24
22
 
25
23
  export const storage = getStorageManager({moduleType: MODULE_TYPE_UID, moduleName: MODULE_NAME});
26
24
 
27
- function getNaveggIdFromApi() {
28
- const callbacks = {
29
- success: response => {
30
- if (response) {
31
- try {
32
- const responseObj = JSON.parse(response);
33
- writeCookie(NAVEGG_ID, responseObj[NAVEGG_ID]);
34
- } catch (error) {
35
- logError(error);
25
+ function getIdFromAPI() {
26
+ const resp = function (callback) {
27
+ ajaxBuilder()(
28
+ BASE_URL,
29
+ response => {
30
+ if (response) {
31
+ let responseObj;
32
+ try {
33
+ responseObj = JSON.parse(response);
34
+ } catch (error) {
35
+ logError(error);
36
+ const fallbackValue = getNaveggIdFromLocalStorage() || getOldCookie();
37
+ callback(fallbackValue);
38
+ }
39
+
40
+ if (responseObj && responseObj[NAVEGG_ID]) {
41
+ callback(responseObj[NAVEGG_ID]);
42
+ } else {
43
+ const fallbackValue = getNaveggIdFromLocalStorage() || getOldCookie();
44
+ callback(fallbackValue);
45
+ }
36
46
  }
37
- }
38
- },
39
- error: error => {
40
- logError('Navegg ID fetch encountered an error', error);
41
- }
47
+ },
48
+ error => {
49
+ logError('Navegg ID fetch encountered an error', error);
50
+ const fallbackValue = getNaveggIdFromLocalStorage() || getOldCookie();
51
+ callback(fallbackValue);
52
+ },
53
+ {method: 'GET', withCredentials: false});
42
54
  };
43
- ajax(BASE_URL, callbacks, undefined, { method: 'GET', withCredentials: false });
44
- }
45
-
46
- function writeCookie(key, value) {
47
- try {
48
- if (storage.cookiesAreEnabled) {
49
- let expTime = new Date();
50
- const expires = value ? DEFAULT_EXPIRE : INVALID_EXPIRE;
51
- expTime.setTime(expTime.getTime() + expires);
52
- storage.setCookie(key, value, expTime.toUTCString(), 'none');
53
- }
54
- } catch (e) {
55
- logError(e);
56
- }
55
+ return resp;
57
56
  }
58
57
 
59
- function readnaveggIdFromLocalStorage() {
60
- return storage.localStorageIsEnabled ? storage.getDataFromLocalStorage(NAVEGG_ID) : null;
58
+ /**
59
+ * @returns {string | null}
60
+ */
61
+ function readNvgIdFromCookie() {
62
+ return storage.cookiesAreEnabled ? (storage.findSimilarCookies('nvg') ? storage.findSimilarCookies('nvg')[0] : null) : null;
61
63
  }
62
-
63
- function readnaveggIDFromCookie() {
64
- return storage.cookiesAreEnabled ? storage.getCookie(NAVEGG_ID) : null;
64
+ /**
65
+ * @returns {string | null}
66
+ */
67
+ function readNavIdFromCookie() {
68
+ return storage.cookiesAreEnabled() ? (storage.findSimilarCookies('nav') ? storage.findSimilarCookies('nav')[0] : null) : null;
65
69
  }
66
-
67
- function readoldnaveggIDFromCookie() {
68
- return storage.cookiesAreEnabled ? storage.getCookie(OLD_NAVEGG_ID) : null;
70
+ /**
71
+ * @returns {string | null}
72
+ */
73
+ function readOldNaveggIdFromCookie() {
74
+ return storage.cookiesAreEnabled() ? storage.getCookie(OLD_NAVEGG_ID) : null;
69
75
  }
70
-
71
- function readnvgIDFromCookie() {
72
- return storage.cookiesAreEnabled ? (storage.findSimilarCookies('nvg') ? storage.findSimilarCookies('nvg')[0] : null) : null;
76
+ /**
77
+ * @returns {string | null}
78
+ */
79
+ function getOldCookie() {
80
+ const oldCookie = readOldNaveggIdFromCookie() || readNvgIdFromCookie() || readNavIdFromCookie();
81
+ return oldCookie;
73
82
  }
74
-
75
- function readnavIDFromCookie() {
76
- return storage.cookiesAreEnabled ? (storage.findSimilarCookies('nav') ? storage.findSimilarCookies('nav')[0] : null) : null;
83
+ /**
84
+ * @returns {string | null}
85
+ */
86
+ function getNaveggIdFromLocalStorage() {
87
+ return storage.localStorageIsEnabled() ? storage.getDataFromLocalStorage(NAVEGG_ID) : null;
77
88
  }
78
89
 
79
90
  /** @type {Submodule} */
@@ -95,23 +106,16 @@ export const naveggIdSubmodule = {
95
106
  'naveggId': naveggIdVal.split('|')[0]
96
107
  } : undefined;
97
108
  },
109
+
98
110
  /**
99
111
  * performs action to obtain id and return a value in the callback's response argument
100
112
  * @function
101
113
  * @param {SubmoduleConfig} config
102
114
  * @return {{id: string | undefined } | undefined}
103
115
  */
104
- getId() {
105
- const naveggIdString = readnaveggIdFromLocalStorage() || readnaveggIDFromCookie() || getNaveggIdFromApi() || readoldnaveggIDFromCookie() || readnvgIDFromCookie() || readnavIDFromCookie();
106
-
107
- if (typeof naveggIdString == 'string' && naveggIdString) {
108
- try {
109
- return { id: naveggIdString };
110
- } catch (error) {
111
- logError(error);
112
- }
113
- }
114
- return undefined;
116
+ getId(config, consentData) {
117
+ const resp = getIdFromAPI()
118
+ return {callback: resp}
115
119
  },
116
120
  eids: {
117
121
  'naveggId': {
@@ -10,6 +10,11 @@ pbjs.setConfig({
10
10
  userSync: {
11
11
  userIds: [{
12
12
  name: 'naveggId',
13
+ storage: {
14
+ name : 'nvggid',
15
+ type : 'cookie&html5',
16
+ expires: 8
17
+ }
13
18
  }]
14
19
  }
15
20
  });
@@ -20,3 +25,6 @@ The below parameters apply only to the naveggID integration.
20
25
  | Param under usersync.userIds[] | Scope | Type | Description | Example |
21
26
  | --- | --- | --- | --- | --- |
22
27
  | name | Required | String | ID of the module - `"naveggId"` | `"naveggId"` |
28
+ | storage.name | Required | String | The name of the cookie or html5 local storage where the user ID will be stored. | `"nvggid"` |
29
+ | storage.type | Required | String | Must be "`cookie`", "`html5`" or "`cookie&html5`". This is where the results of the user ID will be stored. | `"cookie&html5"` |
30
+ | storage.expires | Required | Integer | How long (in days) the user ID information will be stored. | `8` |
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  import {BANNER} from '../src/mediaTypes.js';
4
- import {getWindowSelf, getWindowTop, isFn, logWarn} from '../src/utils.js';
4
+ import {getWindowSelf, getWindowTop, isFn, logWarn, deepAccess} from '../src/utils.js';
5
5
  import {registerBidder} from '../src/adapters/bidderFactory.js';
6
6
  import {ajax} from '../src/ajax.js';
7
7
  import {getAdUnitSizes} from '../libraries/sizeUtils/sizeUtils.js';
@@ -12,7 +12,7 @@ const DEFAULT_TIMEOUT = 1000;
12
12
  const BID_HOST = 'https://mweb-hb.presage.io/api/header-bidding-request';
13
13
  const TIMEOUT_MONITORING_HOST = 'https://ms-ads-monitoring-events.presage.io';
14
14
  const MS_COOKIE_SYNC_DOMAIN = 'https://ms-cookie-sync.presage.io';
15
- const ADAPTER_VERSION = '1.6.0';
15
+ const ADAPTER_VERSION = '1.6.1';
16
16
 
17
17
  function getClientWidth() {
18
18
  const documentElementClientWidth = window.top.document.documentElement.clientWidth
@@ -129,6 +129,8 @@ function buildRequests(validBidRequests, bidderRequest) {
129
129
  openRtbBidRequestBanner.user.ext.eids = bidRequest.userIdAsEids
130
130
  }
131
131
 
132
+ const gpid = deepAccess(bidRequest, 'ortb2Imp.ext.gpid');
133
+
132
134
  openRtbBidRequestBanner.imp.push({
133
135
  id: bidRequest.bidId,
134
136
  tagid: bidRequest.params.adUnitId,
@@ -138,6 +140,7 @@ function buildRequests(validBidRequests, bidderRequest) {
138
140
  },
139
141
  ext: {
140
142
  ...bidRequest.params,
143
+ ...(gpid && {gpid}),
141
144
  timeSpentOnPage: document.timeline && document.timeline.currentTime ? document.timeline.currentTime : 0
142
145
  }
143
146
  });
@@ -136,7 +136,7 @@ function buildRequests(bidReqs, bidderRequest) {
136
136
  }
137
137
 
138
138
  function isBidRequestValid(bid) {
139
- if (bid.bidder !== BIDDER_CODE || !bid.params || !bid.params.publisherId) {
139
+ if (!bid.params || !bid.params.publisherId) {
140
140
  return false;
141
141
  }
142
142
 
@@ -80,11 +80,6 @@ const converter = ortbConverter({
80
80
  bidResponse.meta.advertiserId = bid.ext.buyer_id;
81
81
  bidResponse.meta.brandId = bid.ext.brand_id;
82
82
  }
83
- const {ortbResponse} = context;
84
- if (ortbResponse.ext && ortbResponse.ext.paf) {
85
- bidResponse.meta.paf = Object.assign({}, ortbResponse.ext.paf);
86
- bidResponse.meta.paf.content_id = utils.deepAccess(bid, 'ext.paf.content_id');
87
- }
88
83
  return bidResponse;
89
84
  },
90
85
  response(buildResponse, bidResponses, ortbResponse, context) {
@@ -117,7 +112,7 @@ const converter = ortbConverter({
117
112
  paapi: fledgeAuctionConfigs,
118
113
  }
119
114
  } else {
120
- return response.bids
115
+ return response
121
116
  }
122
117
  },
123
118
  overrides: {
@@ -6,8 +6,6 @@ import {
6
6
  isNumber,
7
7
  generateUUID,
8
8
  isEmpty,
9
- isFn,
10
- isPlainObject,
11
9
  } from '../src/utils.js';
12
10
  import { getStorageManager } from '../src/storageManager.js';
13
11
 
@@ -59,7 +57,7 @@ export const spec = {
59
57
 
60
58
  isBidRequestValid: function (bid) {
61
59
  const params = bid.params || {};
62
- return !!params.pubid && !!params.floorPrice && isVideoRequestValid(bid);
60
+ return !!params.pubid && !!params.adtagid && isVideoRequestValid(bid);
63
61
  },
64
62
 
65
63
  buildRequests: function (validBidRequests, bidderRequest) {
@@ -145,7 +143,7 @@ function buildRequestData(bid, bidderRequest) {
145
143
 
146
144
  function buildBaseObject(bid, bidderRequest) {
147
145
  const firstPartyData = prepareFirstPartyData(bidderRequest.ortb2);
148
- const { pubid, bcat, badv, bapp } = bid.params;
146
+ const { pubid, adtagid, bcat, badv, bapp } = bid.params;
149
147
  const { userId } = bid;
150
148
  const uid2Token = userId?.uid2?.id;
151
149
 
@@ -168,8 +166,7 @@ function buildBaseObject(bid, bidderRequest) {
168
166
  return {
169
167
  id: bid.bidId,
170
168
  pubid,
171
- floor_price: getBidFloor(bid),
172
- adtagid: bid.adUnitCode,
169
+ adtagid: adtagid,
173
170
  ...(bcat && { bcat }),
174
171
  ...(badv && { badv }),
175
172
  ...(bapp && { bapp }),
@@ -417,7 +414,7 @@ function validateSizes(sizes) {
417
414
  );
418
415
  }
419
416
 
420
- function getBidFloor(bid) {
417
+ /* function getBidFloor(bid) {
421
418
  if (!isFn(bid.getFloor)) {
422
419
  return bid.params.floorPrice ? bid.params.floorPrice : null;
423
420
  }
@@ -431,6 +428,6 @@ function getBidFloor(bid) {
431
428
  return floor.floor;
432
429
  }
433
430
  return null;
434
- }
431
+ } */
435
432
 
436
433
  registerBidder(spec);
@@ -31,7 +31,8 @@ var adUnits = [
31
31
  params: {
32
32
  // id of test publisher
33
33
  pubid: '22430f9d-9610-432c-aabe-6134256f11af',
34
- floorPrice: 1.25,
34
+ // id of test adtag id
35
+ adtagid: '6f3173b9-5623-4a4f-8c62-2b1d24ceb4e6',
35
36
  },
36
37
  },
37
38
  ],
@@ -53,7 +54,8 @@ var adUnits = [
53
54
  params: {
54
55
  // id of test publisher
55
56
  pubid: '22430f9d-9610-432c-aabe-6134256f11af',
56
- floorPrice: 1.25,
57
+ // id of test adtag id
58
+ adtagid: '097c601f-ad09-495b-b70b-d9cf6f1edbc1',
57
59
  },
58
60
  },
59
61
  ],
@@ -79,7 +81,7 @@ var adUnits = [
79
81
  bidder: 'pstudio',
80
82
  params: {
81
83
  pubid: '22430f9d-9610-432c-aabe-6134256f11af', // required
82
- floorPrice: 1.15, // required
84
+ adtagid: 'b9be4c35-3c12-4fa9-96ba-34b90276208c', // required
83
85
  bcat: ['IAB1-1', 'IAB1-3'], // optional
84
86
  badv: ['nike.com'], // optional
85
87
  bapp: ['com.foo.mygame'], // optional
@@ -121,7 +123,7 @@ var videoAdUnits = [
121
123
  bidder: 'pstudio',
122
124
  params: {
123
125
  pubid: '22430f9d-9610-432c-aabe-6134256f11af',
124
- floorPrice: 1.25,
126
+ adtagid: '46e348cf-b79d-43e5-81bc-5954cdf15d7e',
125
127
  badv: ['adidas.com'],
126
128
  },
127
129
  },
@@ -0,0 +1,19 @@
1
+ import { registerBidder } from '../src/adapters/bidderFactory.js';
2
+ import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
3
+ import { isBidRequestValid, buildRequests, interpretResponse, getUserSyncs } from '../libraries/teqblazeUtils/bidderUtils.js';
4
+
5
+ const BIDDER_CODE = 'pubrise';
6
+ const AD_URL = 'https://backend.pubrise.ai/pbjs';
7
+ const SYNC_URL = 'https://sync.pubrise.ai';
8
+
9
+ export const spec = {
10
+ code: BIDDER_CODE,
11
+ supportedMediaTypes: [BANNER, VIDEO, NATIVE],
12
+
13
+ isBidRequestValid: isBidRequestValid(),
14
+ buildRequests: buildRequests(AD_URL),
15
+ interpretResponse,
16
+ getUserSyncs: getUserSyncs(SYNC_URL)
17
+ };
18
+
19
+ registerBidder(spec);
@@ -0,0 +1,79 @@
1
+ # Overview
2
+
3
+ ```
4
+ Module Name: Pubrise Bidder Adapter
5
+ Module Type: Pubrise Bidder Adapter
6
+ Maintainer: prebid@pubrise.ai
7
+ ```
8
+
9
+ # Description
10
+
11
+ Connects to Pubrise exchange for bids.
12
+ Pubrise bid adapter supports Banner, Video (instream and outstream) and Native.
13
+
14
+ # Test Parameters
15
+ ```
16
+ var adUnits = [
17
+ // Will return static test banner
18
+ {
19
+ code: 'adunit1',
20
+ mediaTypes: {
21
+ banner: {
22
+ sizes: [ [300, 250], [320, 50] ],
23
+ }
24
+ },
25
+ bids: [
26
+ {
27
+ bidder: 'pubrise',
28
+ params: {
29
+ placementId: 'testBanner',
30
+ }
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ code: 'addunit2',
36
+ mediaTypes: {
37
+ video: {
38
+ playerSize: [ [640, 480] ],
39
+ context: 'instream',
40
+ minduration: 5,
41
+ maxduration: 60,
42
+ }
43
+ },
44
+ bids: [
45
+ {
46
+ bidder: 'pubrise',
47
+ params: {
48
+ placementId: 'testVideo',
49
+ }
50
+ }
51
+ ]
52
+ },
53
+ {
54
+ code: 'addunit3',
55
+ mediaTypes: {
56
+ native: {
57
+ title: {
58
+ required: true
59
+ },
60
+ body: {
61
+ required: true
62
+ },
63
+ icon: {
64
+ required: true,
65
+ size: [64, 64]
66
+ }
67
+ }
68
+ },
69
+ bids: [
70
+ {
71
+ bidder: 'pubrise',
72
+ params: {
73
+ placementId: 'testNative',
74
+ }
75
+ }
76
+ ]
77
+ }
78
+ ];
79
+ ```
@@ -157,15 +157,19 @@ const track = ({ eventType, args }) => {
157
157
  // handle invalid bids, and remove them from the adUnit cache
158
158
  case EVENTS.BID_TIMEOUT:
159
159
  args.map(extractBid).forEach((bid) => {
160
- bid.renderStatus = 3;
160
+ bid.bidType = 3;
161
161
  auctionCache[bid.auctionId].bids.push(bid);
162
162
  });
163
163
  break;
164
164
  // handle valid bid responses and record them as part of an auction
165
165
  case EVENTS.BID_RESPONSE:
166
- const bid = Object.assign(extractBid(args), { renderStatus: 2 });
166
+ const bid = Object.assign(extractBid(args), { bidType: 2 });
167
167
  auctionCache[bid.auctionId].bids.push(bid);
168
168
  break;
169
+ case EVENTS.BID_REJECTED:
170
+ const rejectedBid = Object.assign(extractBid(args), { bidType: 1 });
171
+ auctionCache[rejectedBid.auctionId].bids.push(rejectedBid);
172
+ break;
169
173
  // capture extra information from the auction, and if there were no bids
170
174
  // (and so no chance of a win) send the auction
171
175
  case EVENTS.AUCTION_END:
@@ -183,7 +187,7 @@ const track = ({ eventType, args }) => {
183
187
  timestamp: args.timestamp,
184
188
  });
185
189
  if (
186
- auctionCache[args.auctionId].bids.every((bid) => bid.renderStatus === 3)
190
+ auctionCache[args.auctionId].bids.every((bid) => bid.bidType === 3)
187
191
  ) {
188
192
  prepareSend(args.auctionId);
189
193
  }
@@ -201,7 +205,7 @@ const track = ({ eventType, args }) => {
201
205
  isFloorSkipped: floorDetail?.skipped || false,
202
206
  isWinningBid: true,
203
207
  renderedSize: args.size,
204
- renderStatus: 4,
208
+ bidType: 4,
205
209
  });
206
210
  winningBid.adServerData = getAdServerDataForBid(winningBid);
207
211
  auctionCache[winningBid.auctionId].winningBid = winningBid;
@@ -283,6 +287,7 @@ const prepareSend = (auctionId) => {
283
287
  auctionTimestamp: auctionData.auctionDetail.timestamp,
284
288
  pubxaiAnalyticsVersion: pubxaiAnalyticsVersion,
285
289
  prebidVersion: '$prebid.version$',
290
+ pubxId: initOptions.pubxId,
286
291
  },
287
292
  });
288
293
  sendCache[pubxaiAnalyticsRequestUrl].push(data);
@@ -2,6 +2,8 @@ import { ajax } from '../src/ajax.js';
2
2
  import { config } from '../src/config.js';
3
3
  import { submodule } from '../src/hook.js';
4
4
  import { deepAccess } from '../src/utils.js';
5
+ import { MODULE_TYPE_RTD } from '../src/activities/modules.js';
6
+ import { getStorageManager } from '../src/storageManager.js';
5
7
  /**
6
8
  * This RTD module has a dependency on the priceFloors module.
7
9
  * We utilize the createFloorsDataForAuction function from the priceFloors module to incorporate price floors data into the current auction.
@@ -16,6 +18,7 @@ export const FloorsApiStatus = Object.freeze({
16
18
  SUCCESS: 'SUCCESS',
17
19
  ERROR: 'ERROR',
18
20
  });
21
+ export const storage = getStorageManager({ moduleType: MODULE_TYPE_RTD, moduleName: SUBMODULE_NAME });
19
22
  export const FLOORS_EVENT_HANDLE = 'floorsApi';
20
23
  export const FLOORS_END_POINT = 'https://floor.pbxai.com/';
21
24
  export const FLOOR_PROVIDER = 'PubxFloorProvider';
@@ -80,31 +83,48 @@ export const setFloorsApiStatus = (status) => {
80
83
 
81
84
  export const getUrl = (provider) => {
82
85
  const { pubxId, endpoint } = deepAccess(provider, 'params');
83
- return `${endpoint || FLOORS_END_POINT}?pubxId=${pubxId}&page=${
84
- window.location.href
85
- }`;
86
+ if (!endpoint) {
87
+ return null; // Indicate that no endpoint is provided
88
+ }
89
+ return `${endpoint || FLOORS_END_POINT}?pubxId=${pubxId}&page=${window.location.href}`;
86
90
  };
87
91
 
88
92
  export const fetchFloorRules = async (provider) => {
89
93
  return new Promise((resolve, reject) => {
90
94
  setFloorsApiStatus(FloorsApiStatus.IN_PROGRESS);
91
- ajax(getUrl(provider), {
92
- success: (responseText, response) => {
93
- try {
94
- if (response && response.response) {
95
- const floorsResponse = JSON.parse(response.response);
96
- resolve(floorsResponse);
97
- } else {
98
- resolve(null);
95
+ const url = getUrl(provider);
96
+ if (url) {
97
+ // Fetch from remote endpoint
98
+ ajax(url, {
99
+ success: (responseText, response) => {
100
+ try {
101
+ if (response && response.response) {
102
+ const floorsResponse = JSON.parse(response.response);
103
+ resolve(floorsResponse);
104
+ } else {
105
+ resolve(null);
106
+ }
107
+ } catch (error) {
108
+ reject(error);
99
109
  }
100
- } catch (error) {
101
- reject(error);
110
+ },
111
+ error: (responseText, response) => {
112
+ reject(response);
113
+ },
114
+ });
115
+ } else {
116
+ // Fetch from local storage
117
+ try {
118
+ const localData = storage.getDataFromSessionStorage('pubx:dynamicFloors') || window.__pubxDynamicFloors__;
119
+ if (localData) {
120
+ resolve(JSON.parse(localData));
121
+ } else {
122
+ resolve(null);
102
123
  }
103
- },
104
- error: (responseText, response) => {
105
- reject(response);
106
- },
107
- });
124
+ } catch (error) {
125
+ reject(error);
126
+ }
127
+ }
108
128
  });
109
129
  };
110
130
 
@@ -32,7 +32,7 @@ pbjs.setConfig({
32
32
  ...,
33
33
  realTimeData: {
34
34
  auctionDelay: AUCTION_DELAY,
35
- dataProviders: {
35
+ dataProviders: [{
36
36
  name: "pubxai",
37
37
  waitForIt: true,
38
38
  params: {
@@ -42,7 +42,7 @@ pbjs.setConfig({
42
42
  enforcement: `<enforcement>`, // (optional)
43
43
  data: `<defaultConfig>` // (optional)
44
44
  }
45
- }
45
+ }]
46
46
  }
47
47
  // rest of the config
48
48
  ...,
@@ -1,9 +1,8 @@
1
1
  import {
2
2
  isFn,
3
- isStr,
4
3
  deepAccess,
5
4
  getWindowTop,
6
- triggerPixel
5
+ triggerNurlWithCpm
7
6
  } from '../src/utils.js';
8
7
  import { registerBidder } from '../src/adapters/bidderFactory.js';
9
8
  import { BANNER } from '../src/mediaTypes.js';
@@ -145,10 +144,7 @@ export const spec = {
145
144
 
146
145
  onBidWon: (bid) => {
147
146
  const cpm = deepAccess(bid, 'adserverTargeting.hb_pb') || '';
148
- if (isStr(bid.nurl) && bid.nurl !== '') {
149
- bid.nurl = bid.nurl.replace(/\${AUCTION_PRICE}/, cpm);
150
- triggerPixel(bid.nurl);
151
- }
147
+ triggerNurlWithCpm(bid, cpm)
152
148
  }
153
149
  };
154
150
 
@@ -55,7 +55,9 @@ export const spec = {
55
55
  cpuc: (typeof window.navigator != 'undefined' ? window.navigator.hardwareConcurrency : null),
56
56
  kws: getAllOrtbKeywords(bidderRequest.ortb2, bid.params.keywords).join(','),
57
57
  schain: bid.schain,
58
- gpid: raiSetPbAdSlot(bid)
58
+ gpid: raiSetPbAdSlot(bid),
59
+ dsa: setDSA(bid),
60
+ userData: deepAccess(bid, 'ortb2.user.data')
59
61
  };
60
62
 
61
63
  REFERER = (typeof bidderRequest.refererInfo.page != 'undefined' ? encodeURIComponent(bidderRequest.refererInfo.page) : null)
@@ -373,3 +375,8 @@ function raiGetTimeoutURL(data) {
373
375
  }
374
376
  return url
375
377
  }
378
+
379
+ function setDSA(bid) {
380
+ let dsa = bid?.ortb2?.regs?.ext?.dsa ? bid?.ortb2?.regs?.ext?.dsa : null;
381
+ return dsa;
382
+ }
@@ -219,9 +219,9 @@ export const converter = ortbConverter({
219
219
  const {bidRequest} = context;
220
220
 
221
221
  let [parseSizeWidth, parseSizeHeight] = bidRequest.mediaTypes.video?.context === 'outstream' ? parseSizes(bidRequest, VIDEO) : [undefined, undefined];
222
-
223
- bidResponse.width = bid.w || parseSizeWidth || bidResponse.playerWidth;
224
- bidResponse.height = bid.h || parseSizeHeight || bidResponse.playerHeight;
222
+ // 0 by default to avoid undefined size
223
+ bidResponse.width = bid.w || parseSizeWidth || bidResponse.playerWidth || 0;
224
+ bidResponse.height = bid.h || parseSizeHeight || bidResponse.playerHeight || 0;
225
225
 
226
226
  if (bidResponse.mediaType === VIDEO && bidRequest.mediaTypes.video.context === 'outstream') {
227
227
  bidResponse.renderer = outstreamRenderer(bidResponse);
@@ -12,6 +12,7 @@ const ALIASES = [
12
12
  {code: 'markapp', skipPbsAliasing: true},
13
13
  {code: 'jdpmedia', skipPbsAliasing: true},
14
14
  {code: 'tredio', skipPbsAliasing: true},
15
+ {code: 'felixads', skipPbsAliasing: true},
15
16
  {code: 'vimayx', skipPbsAliasing: true},
16
17
  ];
17
18
  const BASE_URLS = {
@@ -19,6 +20,7 @@ const BASE_URLS = {
19
20
  markapp: 'https://markapp-prebid.smart-hub.io/pbjs',
20
21
  jdpmedia: 'https://jdpmedia-prebid.smart-hub.io/pbjs',
21
22
  tredio: 'https://tredio-prebid.smart-hub.io/pbjs',
23
+ felixads: 'https://felixads-prebid.smart-hub.io/pbjs',
22
24
  vimayx: 'https://vimayx-prebid.smart-hub.io/pbjs',
23
25
  };
24
26