prebid.js 8.7.0 → 8.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 (350) hide show
  1. package/dist/1plusXRtdProvider.js +1 -1
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/a1MediaRtdProvider.js +1 -1
  5. package/dist/adWMGAnalyticsAdapter.js +1 -1
  6. package/dist/adagioBidAdapter.js +1 -1
  7. package/dist/adbookpspBidAdapter.js +1 -1
  8. package/dist/adgenerationBidAdapter.js +1 -1
  9. package/dist/adkernelAdnAnalyticsAdapter.js +1 -1
  10. package/dist/adlooxAdServerVideo.js +1 -1
  11. package/dist/adlooxRtdProvider.js +1 -1
  12. package/dist/admaticBidAdapter.js +1 -1
  13. package/dist/admixerIdSystem.js +1 -1
  14. package/dist/adnuntiusRtdProvider.js +1 -1
  15. package/dist/adpartnerBidAdapter.js +1 -1
  16. package/dist/adqueryBidAdapter.js +1 -1
  17. package/dist/adqueryIdSystem.js +1 -1
  18. package/dist/adrelevantisBidAdapter.js +1 -1
  19. package/dist/adriverIdSystem.js +1 -1
  20. package/dist/adtelligentIdSystem.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/adxpremiumAnalyticsAdapter.js +1 -1
  25. package/dist/adyoulikeBidAdapter.js +1 -1
  26. package/dist/aidemBidAdapter.js +1 -1
  27. package/dist/ajaBidAdapter.js +1 -1
  28. package/dist/akamaiDapRtdProvider.js +1 -1
  29. package/dist/alkimiBidAdapter.js +1 -1
  30. package/dist/amxBidAdapter.js +1 -1
  31. package/dist/amxIdSystem.js +1 -1
  32. package/dist/analyticsAdapter.js +1 -1
  33. package/dist/appierAnalyticsAdapter.js +1 -1
  34. package/dist/appnexusBidAdapter.js +1 -1
  35. package/dist/asoBidAdapter.js +1 -1
  36. package/dist/atsAnalyticsAdapter.js +1 -1
  37. package/dist/automatadBidAdapter.js +1 -1
  38. package/dist/axonixBidAdapter.js +1 -1
  39. package/dist/bidViewability.js +1 -1
  40. package/dist/bidglassBidAdapter.js +1 -1
  41. package/dist/bidwatchAnalyticsAdapter.js +1 -1
  42. package/dist/big-richmediaBidAdapter.js +1 -1
  43. package/dist/brandmetricsRtdProvider.js +1 -1
  44. package/dist/bridBidAdapter.js +1 -1
  45. package/dist/bridgewellBidAdapter.js +1 -1
  46. package/dist/brightMountainMediaBidAdapter.js +1 -1
  47. package/dist/brightcomSSPBidAdapter.js +1 -1
  48. package/dist/britepoolIdSystem.js +1 -1
  49. package/dist/browsiRtdProvider.js +1 -1
  50. package/dist/byDataAnalyticsAdapter.js +1 -1
  51. package/dist/carodaBidAdapter.js +1 -1
  52. package/dist/categoryTranslation.js +1 -1
  53. package/dist/chtnwBidAdapter.js +1 -1
  54. package/dist/colossussspBidAdapter.js +1 -1
  55. package/dist/concertAnalyticsAdapter.js +1 -1
  56. package/dist/concertBidAdapter.js +1 -1
  57. package/dist/connectIdSystem.js +1 -1
  58. package/dist/connectadBidAdapter.js +1 -1
  59. package/dist/consumableBidAdapter.js +1 -1
  60. package/dist/conversantAnalyticsAdapter.js +1 -1
  61. package/dist/conversantBidAdapter.js +1 -1
  62. package/dist/craftBidAdapter.js +1 -1
  63. package/dist/criteoBidAdapter.js +1 -1
  64. package/dist/criteoIdSystem.js +1 -1
  65. package/dist/currency.js +1 -1
  66. package/dist/cwireBidAdapter.js +1 -1
  67. package/dist/dacIdSystem.js +1 -1
  68. package/dist/dailyhuntBidAdapter.js +1 -1
  69. package/dist/datablocksBidAdapter.js +1 -1
  70. package/dist/dependencies.json +4 -1
  71. package/dist/dgkeywordRtdProvider.js +1 -1
  72. package/dist/dmdIdSystem.js +1 -1
  73. package/dist/dspxBidAdapter.js +1 -1
  74. package/dist/eplanningAnalyticsAdapter.js +1 -1
  75. package/dist/eplanningBidAdapter.js +1 -1
  76. package/dist/euidIdSystem.js +1 -1
  77. package/dist/fabrickIdSystem.js +1 -1
  78. package/dist/feedadBidAdapter.js +1 -1
  79. package/dist/finativeBidAdapter.js +1 -1
  80. package/dist/fintezaAnalyticsAdapter.js +1 -1
  81. package/dist/fledgeForGpt.js +1 -1
  82. package/dist/freewheel-sspBidAdapter.js +1 -1
  83. package/dist/genericAnalyticsAdapter.js +1 -1
  84. package/dist/geoedgeRtdProvider.js +1 -1
  85. package/dist/gmosspBidAdapter.js +1 -1
  86. package/dist/gnetBidAdapter.js +1 -1
  87. package/dist/goldbachBidAdapter.js +1 -1
  88. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  89. package/dist/greenbidsRtdProvider.js +1 -1
  90. package/dist/gridBidAdapter.js +1 -1
  91. package/dist/growthCodeAnalyticsAdapter.js +1 -1
  92. package/dist/growthCodeIdSystem.js +1 -1
  93. package/dist/growthCodeRtdProvider.js +1 -1
  94. package/dist/gumgumBidAdapter.js +1 -1
  95. package/dist/h12mediaBidAdapter.js +1 -1
  96. package/dist/hadronAnalyticsAdapter.js +1 -1
  97. package/dist/hadronIdSystem.js +1 -1
  98. package/dist/hadronRtdProvider.js +1 -1
  99. package/dist/hypelabBidAdapter.js +1 -1
  100. package/dist/iasRtdProvider.js +1 -1
  101. package/dist/id5AnalyticsAdapter.js +1 -1
  102. package/dist/id5IdSystem.js +1 -1
  103. package/dist/idImportLibrary.js +1 -1
  104. package/dist/identityLinkIdSystem.js +1 -1
  105. package/dist/imRtdProvider.js +1 -1
  106. package/dist/imdsBidAdapter.js +1 -1
  107. package/dist/impactifyBidAdapter.js +1 -1
  108. package/dist/improvedigitalBidAdapter.js +1 -1
  109. package/dist/imuIdSystem.js +1 -1
  110. package/dist/insticatorBidAdapter.js +1 -1
  111. package/dist/intentIqIdSystem.js +1 -1
  112. package/dist/invisiblyAnalyticsAdapter.js +1 -1
  113. package/dist/ixBidAdapter.js +1 -1
  114. package/dist/jixieBidAdapter.js +1 -1
  115. package/dist/justpremiumBidAdapter.js +1 -1
  116. package/dist/jwplayerRtdProvider.js +1 -1
  117. package/dist/kargoAnalyticsAdapter.js +1 -1
  118. package/dist/kargoBidAdapter.js +1 -1
  119. package/dist/kinessoIdSystem.js +1 -1
  120. package/dist/konduitAnalyticsAdapter.js +1 -1
  121. package/dist/konduitWrapper.js +1 -1
  122. package/dist/kueezBidAdapter.js +1 -1
  123. package/dist/kueezRtbBidAdapter.js +1 -1
  124. package/dist/kulturemediaBidAdapter.js +1 -1
  125. package/dist/lassoBidAdapter.js +1 -1
  126. package/dist/lifestreetBidAdapter.js +1 -1
  127. package/dist/limelightDigitalBidAdapter.js +1 -1
  128. package/dist/liveIntentAnalyticsAdapter.js +1 -1
  129. package/dist/liveIntentIdSystem.js +1 -1
  130. package/dist/livewrappedAnalyticsAdapter.js +1 -1
  131. package/dist/logicadBidAdapter.js +1 -1
  132. package/dist/loglyliftBidAdapter.js +1 -1
  133. package/dist/lotamePanoramaIdSystem.js +1 -1
  134. package/dist/luponmediaBidAdapter.js +1 -1
  135. package/dist/magniteAnalyticsAdapter.js +1 -1
  136. package/dist/malltvAnalyticsAdapter.js +1 -1
  137. package/dist/mantisBidAdapter.js +1 -1
  138. package/dist/marsmediaAnalyticsAdapter.js +1 -1
  139. package/dist/marsmediaBidAdapter.js +1 -1
  140. package/dist/mediafuseBidAdapter.js +1 -1
  141. package/dist/medianetAnalyticsAdapter.js +1 -1
  142. package/dist/mediasquareBidAdapter.js +1 -1
  143. package/dist/merkleIdSystem.js +1 -1
  144. package/dist/mgidBidAdapter.js +1 -1
  145. package/dist/mgidRtdProvider.js +1 -1
  146. package/dist/minutemediaBidAdapter.js +1 -1
  147. package/dist/minutemediaplusBidAdapter.js +1 -1
  148. package/dist/mspa.js +1 -1
  149. package/dist/mwOpenLinkIdSystem.js +1 -1
  150. package/dist/nativoBidAdapter.js +1 -1
  151. package/dist/naveggIdSystem.js +1 -1
  152. package/dist/neuwoRtdProvider.js +1 -1
  153. package/dist/nexx360BidAdapter.js +1 -1
  154. package/dist/not-for-prod/prebid.js +248 -247
  155. package/dist/novatiqIdSystem.js +1 -1
  156. package/dist/oguryBidAdapter.js +1 -1
  157. package/dist/onetagBidAdapter.js +1 -1
  158. package/dist/ooloAnalyticsAdapter.js +1 -1
  159. package/dist/open8BidAdapter.js +1 -1
  160. package/dist/operaadsBidAdapter.js +1 -1
  161. package/dist/operaadsIdSystem.js +1 -0
  162. package/dist/optidigitalBidAdapter.js +1 -1
  163. package/dist/optimeraRtdProvider.js +1 -1
  164. package/dist/outbrainBidAdapter.js +1 -1
  165. package/dist/oxxionAnalyticsAdapter.js +1 -1
  166. package/dist/oxxionRtdProvider.js +1 -1
  167. package/dist/parrableIdSystem.js +1 -1
  168. package/dist/pixfutureBidAdapter.js +1 -1
  169. package/dist/prebid-core.js +2 -2
  170. package/dist/prebidServerBidAdapter.js +1 -1
  171. package/dist/prebidmanagerAnalyticsAdapter.js +1 -1
  172. package/dist/priceFloors.js +1 -1
  173. package/dist/prismaBidAdapter.js +1 -1
  174. package/dist/pubgeniusBidAdapter.js +1 -1
  175. package/dist/publinkIdSystem.js +1 -1
  176. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  177. package/dist/pubmaticBidAdapter.js +1 -1
  178. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  179. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  180. package/dist/pxyzBidAdapter.js +1 -1
  181. package/dist/quantcastBidAdapter.js +1 -1
  182. package/dist/qwarryBidAdapter.js +1 -1
  183. package/dist/readpeakBidAdapter.js +1 -1
  184. package/dist/reconciliationRtdProvider.js +1 -1
  185. package/dist/relaidoBidAdapter.js +1 -1
  186. package/dist/relevadRtdProvider.js +1 -1
  187. package/dist/retailspotBidAdapter.js +1 -1
  188. package/dist/rhythmoneBidAdapter.js +1 -1
  189. package/dist/riseBidAdapter.js +1 -1
  190. package/dist/rivrAnalyticsAdapter.js +1 -1
  191. package/dist/roxotAnalyticsAdapter.js +1 -1
  192. package/dist/rubiconBidAdapter.js +1 -1
  193. package/dist/scaleableAnalyticsAdapter.js +1 -1
  194. package/dist/seedingAllianceBidAdapter.js +1 -1
  195. package/dist/seedtagBidAdapter.js +1 -1
  196. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  197. package/dist/sharethroughBidAdapter.js +1 -1
  198. package/dist/shinezBidAdapter.js +1 -1
  199. package/dist/silverpushBidAdapter.js +1 -1
  200. package/dist/sirdataRtdProvider.js +1 -1
  201. package/dist/slimcutBidAdapter.js +1 -1
  202. package/dist/smaatoBidAdapter.js +1 -1
  203. package/dist/smartadserverBidAdapter.js +1 -1
  204. package/dist/smartxBidAdapter.js +1 -1
  205. package/dist/smartyadsBidAdapter.js +1 -1
  206. package/dist/smilewantedBidAdapter.js +1 -1
  207. package/dist/snigelBidAdapter.js +1 -1
  208. package/dist/sonobiAnalyticsAdapter.js +1 -1
  209. package/dist/sonobiBidAdapter.js +1 -1
  210. package/dist/sovrnAnalyticsAdapter.js +1 -1
  211. package/dist/sovrnBidAdapter.js +1 -1
  212. package/dist/sspBCBidAdapter.js +1 -1
  213. package/dist/staqAnalyticsAdapter.js +1 -1
  214. package/dist/stvBidAdapter.js +1 -1
  215. package/dist/sublimeBidAdapter.js +1 -1
  216. package/dist/taboolaBidAdapter.js +1 -1
  217. package/dist/talkadsBidAdapter.js +1 -1
  218. package/dist/tapadIdSystem.js +1 -1
  219. package/dist/targetVideoBidAdapter.js +1 -1
  220. package/dist/teadsBidAdapter.js +1 -1
  221. package/dist/teadsIdSystem.js +1 -1
  222. package/dist/terceptAnalyticsAdapter.js +1 -1
  223. package/dist/timeoutRtdProvider.js +1 -1
  224. package/dist/topicsFpdModule.js +1 -1
  225. package/dist/trionBidAdapter.js +1 -1
  226. package/dist/tripleliftBidAdapter.js +1 -1
  227. package/dist/ttdBidAdapter.js +1 -1
  228. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  229. package/dist/uid2IdSystem.js +1 -1
  230. package/dist/underdogmediaBidAdapter.js +1 -1
  231. package/dist/undertoneBidAdapter.js +1 -1
  232. package/dist/unifiedIdSystem.js +1 -1
  233. package/dist/verizonMediaIdSystem.js +1 -1
  234. package/dist/vidazooBidAdapter.js +1 -1
  235. package/dist/videobyteBidAdapter.js +1 -1
  236. package/dist/visxBidAdapter.js +1 -1
  237. package/dist/vrtcalBidAdapter.js +1 -1
  238. package/dist/vuukleBidAdapter.js +1 -1
  239. package/dist/weboramaRtdProvider.js +1 -1
  240. package/dist/widespaceBidAdapter.js +1 -1
  241. package/dist/winrBidAdapter.js +1 -1
  242. package/dist/yahoosspBidAdapter.js +1 -1
  243. package/dist/yieldmoBidAdapter.js +1 -1
  244. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  245. package/dist/yuktamediaAnalyticsAdapter.js +1 -1
  246. package/dist/zeta_global_sspAnalyticsAdapter.js +1 -1
  247. package/dist/zeta_global_sspBidAdapter.js +1 -1
  248. package/integrationExamples/gpt/growthcode.html +3 -12
  249. package/integrationExamples/topics/topics-server.js +72 -0
  250. package/libraries/mspa/activityControls.js +3 -1
  251. package/modules/.submodules.json +2 -1
  252. package/modules/a1MediaRtdProvider.js +1 -1
  253. package/modules/adagioBidAdapter.js +11 -3
  254. package/modules/admaticBidAdapter.js +5 -0
  255. package/modules/adqueryBidAdapter.js +23 -21
  256. package/modules/adqueryIdSystem.js +45 -30
  257. package/modules/adrelevantisBidAdapter.js +2 -0
  258. package/modules/bidViewability.js +7 -0
  259. package/modules/bidViewability.md +9 -8
  260. package/modules/brandmetricsRtdProvider.js +30 -27
  261. package/modules/concertBidAdapter.js +1 -0
  262. package/modules/criteoBidAdapter.js +66 -43
  263. package/modules/fledgeForGpt.js +17 -4
  264. package/modules/fledgeForGpt.md +17 -10
  265. package/modules/geoedgeRtdProvider.js +44 -18
  266. package/modules/geoedgeRtdProvider.md +2 -1
  267. package/modules/growthCodeAnalyticsAdapter.js +7 -4
  268. package/modules/growthCodeAnalyticsAdapter.md +1 -7
  269. package/modules/liveIntentIdSystem.js +16 -1
  270. package/modules/nativoBidAdapter.js +21 -3
  271. package/modules/nexx360BidAdapter.js +7 -1
  272. package/modules/onetagBidAdapter.js +3 -0
  273. package/modules/operaadsBidAdapter.js +5 -0
  274. package/modules/operaadsBidAdapter.md +5 -5
  275. package/modules/operaadsIdSystem.js +106 -0
  276. package/modules/operaadsIdSystem.md +52 -0
  277. package/modules/oxxionAnalyticsAdapter.js +22 -5
  278. package/modules/prebidServerBidAdapter/index.js +8 -2
  279. package/modules/pubmaticAnalyticsAdapter.js +16 -3
  280. package/modules/rubiconBidAdapter.js +2 -2
  281. package/modules/smartyadsBidAdapter.js +18 -1
  282. package/modules/snigelBidAdapter.js +69 -16
  283. package/modules/snigelBidAdapter.md +9 -3
  284. package/modules/topicsFpdModule.js +35 -9
  285. package/modules/visxBidAdapter.js +51 -1
  286. package/package.json +2 -2
  287. package/src/adapters/bidderFactory.js +14 -5
  288. package/src/adloader.js +1 -0
  289. package/src/ajax.js +126 -87
  290. package/src/constants.json +8 -2
  291. package/src/native.js +14 -3
  292. package/test/mocks/xhr.js +256 -9
  293. package/test/spec/libraries/mspa/activityControls_spec.js +6 -0
  294. package/test/spec/modules/adagioBidAdapter_spec.js +15 -0
  295. package/test/spec/modules/adlooxAdServerVideo_spec.js +1 -5
  296. package/test/spec/modules/adlooxRtdProvider_spec.js +1 -5
  297. package/test/spec/modules/admaticBidAdapter_spec.js +5 -0
  298. package/test/spec/modules/adqueryIdSystem_spec.js +13 -24
  299. package/test/spec/modules/bidViewability_spec.js +32 -1
  300. package/test/spec/modules/brandmetricsRtdProvider_spec.js +6 -0
  301. package/test/spec/modules/categoryTranslation_spec.js +7 -9
  302. package/test/spec/modules/concertBidAdapter_spec.js +1 -1
  303. package/test/spec/modules/conversantAnalyticsAdapter_spec.js +3 -5
  304. package/test/spec/modules/criteoBidAdapter_spec.js +228 -0
  305. package/test/spec/modules/currency_spec.js +2 -2
  306. package/test/spec/modules/dmdIdSystem_spec.js +2 -2
  307. package/test/spec/modules/eids_spec.js +48 -0
  308. package/test/spec/modules/euidIdSystem_spec.js +10 -9
  309. package/test/spec/modules/feedadBidAdapter_spec.js +1 -1
  310. package/test/spec/modules/fledge_spec.js +117 -43
  311. package/test/spec/modules/geoedgeRtdProvider_spec.js +52 -39
  312. package/test/spec/modules/greenbidsRtdProvider_spec.js +3 -12
  313. package/test/spec/modules/growthCodeAnalyticsAdapter_spec.js +0 -1
  314. package/test/spec/modules/hadronIdSystem_spec.js +1 -1
  315. package/test/spec/modules/id5AnalyticsAdapter_spec.js +1 -7
  316. package/test/spec/modules/id5IdSystem_spec.js +25 -25
  317. package/test/spec/modules/identityLinkIdSystem_spec.js +0 -2
  318. package/test/spec/modules/intentIqIdSystem_spec.js +0 -2
  319. package/test/spec/modules/invisiblyAnalyticsAdapter_spec.js +2 -6
  320. package/test/spec/modules/jwplayerRtdProvider_spec.js +26 -28
  321. package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +5 -0
  322. package/test/spec/modules/liveIntentIdSystem_spec.js +5 -0
  323. package/test/spec/modules/magniteAnalyticsAdapter_spec.js +2 -2
  324. package/test/spec/modules/mgidRtdProvider_spec.js +1 -5
  325. package/test/spec/modules/nativoBidAdapter_spec.js +6 -1
  326. package/test/spec/modules/nexx360BidAdapter_spec.js +48 -1
  327. package/test/spec/modules/oguryBidAdapter_spec.js +5 -19
  328. package/test/spec/modules/onetagBidAdapter_spec.js +69 -0
  329. package/test/spec/modules/ooloAnalyticsAdapter_spec.js +1 -1
  330. package/test/spec/modules/operaadsIdSystem_spec.js +53 -0
  331. package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +6 -1
  332. package/test/spec/modules/prebidServerBidAdapter_spec.js +33 -2
  333. package/test/spec/modules/priceFloors_spec.js +33 -37
  334. package/test/spec/modules/publinkIdSystem_spec.js +1 -1
  335. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +102 -18
  336. package/test/spec/modules/pubwiseAnalyticsAdapter_spec.js +2 -8
  337. package/test/spec/modules/rubiconBidAdapter_spec.js +24 -0
  338. package/test/spec/modules/smartyadsBidAdapter_spec.js +49 -0
  339. package/test/spec/modules/snigelBidAdapter_spec.js +57 -6
  340. package/test/spec/modules/teadsIdSystem_spec.js +1 -1
  341. package/test/spec/modules/topicsFpdModule_spec.js +102 -1
  342. package/test/spec/modules/uid2IdSystem_helpers.js +5 -5
  343. package/test/spec/modules/uid2IdSystem_spec.js +24 -24
  344. package/test/spec/modules/userId_spec.js +1 -1
  345. package/test/spec/modules/visxBidAdapter_spec.js +151 -1
  346. package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +2 -5
  347. package/test/spec/native_spec.js +20 -5
  348. package/test/spec/unit/core/ajax_spec.js +403 -0
  349. package/test/spec/unit/core/bidderFactory_spec.js +80 -8
  350. package/test/spec/videoCache_spec.js +4 -4
@@ -8,7 +8,7 @@
8
8
  import {ajax} from '../src/ajax.js';
9
9
  import {getStorageManager} from '../src/storageManager.js';
10
10
  import {submodule} from '../src/hook.js';
11
- import { isFn, isStr, isPlainObject, logError } from '../src/utils.js';
11
+ import {isFn, isPlainObject, isStr, logError, logInfo} from '../src/utils.js';
12
12
  import {MODULE_TYPE_UID} from '../src/activities/modules.js';
13
13
 
14
14
  const MODULE_NAME = 'qid';
@@ -51,11 +51,7 @@ export const adqueryIdSubmodule = {
51
51
  * @returns {{qid:Object}}
52
52
  */
53
53
  decode(value) {
54
- let qid = storage.getDataFromLocalStorage('qid');
55
- if (isStr(qid)) {
56
- return {qid: qid};
57
- }
58
- return (value && typeof value['qid'] === 'string') ? { 'qid': value['qid'] } : undefined;
54
+ return {qid: value}
59
55
  },
60
56
  /**
61
57
  * performs action to obtain id and return a value in the callback's response argument
@@ -64,38 +60,57 @@ export const adqueryIdSubmodule = {
64
60
  * @returns {IdResponse|undefined}
65
61
  */
66
62
  getId(config) {
63
+ logInfo('adqueryIdSubmodule getId');
67
64
  if (!isPlainObject(config.params)) {
68
65
  config.params = {};
69
66
  }
70
- const url = paramOrDefault(config.params.url,
67
+
68
+ const url = paramOrDefault(
69
+ config.params.url,
71
70
  `https://bidder.adquery.io/prebid/qid`,
72
- config.params.urlArg);
71
+ config.params.urlArg
72
+ );
73
73
 
74
74
  const resp = function (callback) {
75
- let qid = storage.getDataFromLocalStorage('qid');
76
- if (isStr(qid)) {
77
- const responseObj = {qid: qid};
78
- callback(responseObj);
79
- } else {
80
- const callbacks = {
81
- success: response => {
82
- let responseObj;
83
- if (response) {
84
- try {
85
- responseObj = JSON.parse(response);
86
- } catch (error) {
87
- logError(error);
88
- }
75
+ let qid = window.qid;
76
+
77
+ if (!qid) {
78
+ const ramdomValues = window.crypto.getRandomValues(new Uint32Array(4));
79
+ qid = (ramdomValues[0].toString(36) +
80
+ ramdomValues[1].toString(36) +
81
+ ramdomValues[2].toString(36) +
82
+ ramdomValues[3].toString(36))
83
+ .substring(0, 20);
84
+
85
+ const randomValues = Array.from(window.crypto.getRandomValues(new Uint32Array(4)));
86
+ qid = randomValues.map(it => it.toString(36)).join().substring(20);
87
+ logInfo('adqueryIdSubmodule ID QID GENERTAED:', qid);
88
+ }
89
+ logInfo('adqueryIdSubmodule ID QID:', qid);
90
+
91
+ const callbacks = {
92
+ success: response => {
93
+ let responseObj;
94
+ if (response) {
95
+ try {
96
+ responseObj = JSON.parse(response);
97
+ } catch (error) {
98
+ logError(error);
89
99
  }
90
- callback(responseObj);
91
- },
92
- error: error => {
93
- logError(`${MODULE_NAME}: ID fetch encountered an error`, error);
94
- callback();
95
100
  }
96
- };
97
- ajax(url, callbacks, undefined, {method: 'GET'});
98
- }
101
+ if (responseObj.qid) {
102
+ let myQid = responseObj.qid;
103
+ storage.setDataInLocalStorage('qid', myQid);
104
+ return callback(myQid);
105
+ }
106
+ callback();
107
+ },
108
+ error: error => {
109
+ logError(`${MODULE_NAME}: ID fetch encountered an error`, error);
110
+ callback();
111
+ }
112
+ };
113
+ ajax(url + '?qid=' + qid, callbacks, undefined, {method: 'GET'});
99
114
  };
100
115
  return {callback: resp};
101
116
  },
@@ -597,6 +597,8 @@ function parseMediaType(rtbBid) {
597
597
  const adType = rtbBid.ad_type;
598
598
  if (adType === VIDEO) {
599
599
  return VIDEO;
600
+ } else if (adType === NATIVE) {
601
+ return NATIVE;
600
602
  } else {
601
603
  return BANNER;
602
604
  }
@@ -67,6 +67,8 @@ export let logWinningBidNotFound = (slot) => {
67
67
 
68
68
  export let impressionViewableHandler = (globalModuleConfig, slot, event) => {
69
69
  let respectiveBid = getMatchingWinningBidForGPTSlot(globalModuleConfig, slot);
70
+ let respectiveDeferredAdUnit = getGlobal().adUnits.find(adUnit => adUnit.deferBilling && respectiveBid.adUnitCode === adUnit.code);
71
+
70
72
  if (respectiveBid === null) {
71
73
  logWinningBidNotFound(slot);
72
74
  } else {
@@ -74,6 +76,11 @@ export let impressionViewableHandler = (globalModuleConfig, slot, event) => {
74
76
  fireViewabilityPixels(globalModuleConfig, respectiveBid);
75
77
  // trigger respective bidder's onBidViewable handler
76
78
  adapterManager.callBidViewableBidder(respectiveBid.adapterCode || respectiveBid.bidder, respectiveBid);
79
+
80
+ if (respectiveDeferredAdUnit) {
81
+ adapterManager.callBidBillableBidder(respectiveBid);
82
+ }
83
+
77
84
  // emit the BID_VIEWABLE event with bid details, this event can be consumed by bidders and analytics pixels
78
85
  events.emit(CONSTANTS.EVENTS.BID_VIEWABLE, respectiveBid);
79
86
  }
@@ -2,19 +2,20 @@
2
2
 
3
3
  Module Name: bidViewability
4
4
 
5
- Purpose: Track when a bid is viewable
5
+ Purpose: Track when a bid is viewable (and also ready for billing)
6
6
 
7
7
  Maintainer: harshad.mane@pubmatic.com
8
8
 
9
9
  # Description
10
- - This module, when included, will trigger a BID_VIEWABLE event which can be consumed by Analytics adapters, bidders will need to implement `onBidViewable` method to capture this event
11
- - Bidderes can check if this module is part of the final build and whether it is enabled or not by accessing ```pbjs.getConfig('bidViewability')```
10
+ - This module, when included, will trigger a BID_VIEWABLE event which can be consumed by Analytics adapters, bidders will need to implement the `onBidViewable` method to capture this event
11
+ - Bidders can check if this module is part of the final build and whether it is enabled or not by accessing ```pbjs.getConfig('bidViewability')```
12
12
  - GPT API is used to find when a bid is viewable, https://developers.google.com/publisher-tag/reference#googletag.events.impressionviewableevent . This event is fired when an impression becomes viewable, according to the Active View criteria.
13
13
  Refer: https://support.google.com/admanager/answer/4524488
14
- - The module does not work with adserver other than GAM with GPT integration
14
+ - This module does not work with any adserver's other than GAM with GPT integration
15
15
  - Logic used to find a matching pbjs-bid for a GPT slot is ``` (slot.getAdUnitPath() === bid.adUnitCode || slot.getSlotElementId() === bid.adUnitCode) ``` this logic can be changed by using param ```customMatchFunction```
16
- - When a rendered PBJS bid is viewable the module will trigger BID_VIEWABLE event, which can be consumed by bidders and analytics adapters
17
- - For the viewable bid if ```bid.vurls type array``` param is and module config ``` firePixels: true ``` is set then the URLs mentioned in bid.vurls will be executed. Please note that GDPR and USP related parameters will be added to the given URLs
16
+ - When a rendered PBJS bid is viewable the module will trigger a BID_VIEWABLE event, which can be consumed by bidders and analytics adapters
17
+ - If the viewable bid contains a ```vurls``` param containing URL's and the Bid Viewability module is configured with ``` firePixels: true ``` then the URLs mentioned in bid.vurls will be called. Please note that GDPR and USP related parameters will be added to the given URLs
18
+ - This module is also compatible with Prebid core's billing deferral logic, this means that bids linked to an ad unit marked with `deferBilling: true` will trigger a bid adapter's `onBidBillable` function (if present) indicating an ad slot was viewed and also billing ready (if it were deferred).
18
19
 
19
20
  # Params
20
21
  - enabled [required] [type: boolean, default: false], when set to true, the module will emit BID_VIEWABLE when applicable
@@ -44,6 +45,6 @@ Refer: https://support.google.com/admanager/answer/4524488
44
45
  ```
45
46
 
46
47
  # Please Note:
47
- - Doesn't seems to work with Instream Video, https://docs.prebid.org/dev-docs/examples/instream-banner-mix.html as GPT's impressionViewable event is not triggered for instream-video-creative
48
- - Works with Banner, Outsteam, Native creatives
48
+ - This module doesn't seem to work with Instream Video, https://docs.prebid.org/dev-docs/examples/instream-banner-mix.html as GPT's impressionViewable event is not triggered for instream-video-creative
49
+ - Works with Banner, Outsteam and Native creatives
49
50
 
@@ -21,13 +21,14 @@ let billableEventsInitialized = false
21
21
 
22
22
  function init (config, userConsent) {
23
23
  const hasConsent = checkConsent(userConsent)
24
+ const initialize = hasConsent !== false
24
25
 
25
- if (hasConsent) {
26
+ if (initialize) {
26
27
  const moduleConfig = getMergedConfig(config)
27
28
  initializeBrandmetrics(moduleConfig.params.scriptId)
28
29
  initializeBillableEvents()
29
30
  }
30
- return hasConsent
31
+ return initialize
31
32
  }
32
33
 
33
34
  /**
@@ -36,33 +37,35 @@ function init (config, userConsent) {
36
37
  * @returns {boolean}
37
38
  */
38
39
  function checkConsent (userConsent) {
39
- let consent = false
40
-
41
- if (userConsent && userConsent.gdpr && userConsent.gdpr.gdprApplies) {
42
- const gdpr = userConsent.gdpr
43
-
44
- if (gdpr.vendorData) {
45
- const vendor = gdpr.vendorData.vendor
46
- const purpose = gdpr.vendorData.purpose
47
-
48
- let vendorConsent = false
49
- if (vendor.consents) {
50
- vendorConsent = vendor.consents[GVL_ID]
40
+ let consent
41
+
42
+ if (userConsent) {
43
+ if (userConsent.gdpr && userConsent.gdpr.gdprApplies) {
44
+ const gdpr = userConsent.gdpr
45
+
46
+ if (gdpr.vendorData) {
47
+ const vendor = gdpr.vendorData.vendor
48
+ const purpose = gdpr.vendorData.purpose
49
+
50
+ let vendorConsent = false
51
+ if (vendor.consents) {
52
+ vendorConsent = vendor.consents[GVL_ID]
53
+ }
54
+
55
+ if (vendor.legitimateInterests) {
56
+ vendorConsent = vendorConsent || vendor.legitimateInterests[GVL_ID]
57
+ }
58
+
59
+ const purposes = TCF_PURPOSES.map(id => {
60
+ return (purpose.consents && purpose.consents[id]) || (purpose.legitimateInterests && purpose.legitimateInterests[id])
61
+ })
62
+ const purposesValid = purposes.filter(p => p === true).length === TCF_PURPOSES.length
63
+ consent = vendorConsent && purposesValid
51
64
  }
52
-
53
- if (vendor.legitimateInterests) {
54
- vendorConsent = vendorConsent || vendor.legitimateInterests[GVL_ID]
55
- }
56
-
57
- const purposes = TCF_PURPOSES.map(id => {
58
- return (purpose.consents && purpose.consents[id]) || (purpose.legitimateInterests && purpose.legitimateInterests[id])
59
- })
60
- const purposesValid = purposes.filter(p => p === true).length === TCF_PURPOSES.length
61
- consent = vendorConsent && purposesValid
65
+ } else if (userConsent.usp) {
66
+ const usp = userConsent.usp
67
+ consent = usp[1] !== 'N' && usp[2] !== 'Y'
62
68
  }
63
- } else if (userConsent.usp) {
64
- const usp = userConsent.usp
65
- consent = usp[1] !== 'N' && usp[2] !== 'Y'
66
69
  }
67
70
 
68
71
  return consent
@@ -41,6 +41,7 @@ export const spec = {
41
41
  prebidVersion: '$prebid.version$',
42
42
  pageUrl: bidderRequest.refererInfo.page,
43
43
  screen: [window.screen.width, window.screen.height].join('x'),
44
+ browserLanguage: window.navigator.language,
44
45
  debug: debugTurnedOn(),
45
46
  uid: getUid(bidderRequest, validBidRequests),
46
47
  optedOut: hasOptedOutOfPersonalization(),
@@ -3,7 +3,6 @@ import { loadExternalScript } from '../src/adloader.js';
3
3
  import { registerBidder } from '../src/adapters/bidderFactory.js';
4
4
  import { config } from '../src/config.js';
5
5
  import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
6
- import { find } from '../src/polyfill.js';
7
6
  import { verify } from 'criteo-direct-rsa-validate/build/verify.js'; // ref#2
8
7
  import { getStorageManager } from '../src/storageManager.js';
9
8
  import { getRefererInfo } from '../src/refererDetection.js';
@@ -29,7 +28,7 @@ const LOG_PREFIX = 'Criteo: ';
29
28
  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
30
29
  */
31
30
  const FAST_BID_VERSION_PLACEHOLDER = '%FAST_BID_VERSION%';
32
- export const FAST_BID_VERSION_CURRENT = 136;
31
+ export const FAST_BID_VERSION_CURRENT = 139;
33
32
  const FAST_BID_VERSION_LATEST = 'latest';
34
33
  const FAST_BID_VERSION_NONE = 'none';
35
34
  const PUBLISHER_TAG_URL_TEMPLATE = 'https://static.criteo.net/js/ld/publishertag.prebid' + FAST_BID_VERSION_PLACEHOLDER + '.js';
@@ -219,51 +218,53 @@ export const spec = {
219
218
 
220
219
  if (body && body.slots && isArray(body.slots)) {
221
220
  body.slots.forEach(slot => {
222
- const bidRequest = find(request.bidRequests, b => b.adUnitCode === slot.impid && (!b.params.zoneId || parseInt(b.params.zoneId) === slot.zoneid));
223
- const bidId = bidRequest.bidId;
224
- const bid = {
225
- requestId: bidId,
226
- cpm: slot.cpm,
227
- currency: slot.currency,
228
- netRevenue: true,
229
- ttl: slot.ttl || 60,
230
- creativeId: slot.creativecode,
231
- width: slot.width,
232
- height: slot.height,
233
- dealId: slot.deal,
234
- };
235
- if (body.ext?.paf?.transmission && slot.ext?.paf?.content_id) {
236
- const pafResponseMeta = {
237
- content_id: slot.ext.paf.content_id,
238
- transmission: response.ext.paf.transmission
221
+ const bidRequest = getAssociatedBidRequest(request.bidRequests, slot);
222
+ if (bidRequest) {
223
+ const bidId = bidRequest.bidId;
224
+ const bid = {
225
+ requestId: bidId,
226
+ cpm: slot.cpm,
227
+ currency: slot.currency,
228
+ netRevenue: true,
229
+ ttl: slot.ttl || 60,
230
+ creativeId: slot.creativecode,
231
+ width: slot.width,
232
+ height: slot.height,
233
+ dealId: slot.deal,
239
234
  };
240
- bid.meta = Object.assign({}, bid.meta, { paf: pafResponseMeta });
241
- }
242
- if (slot.adomain) {
243
- bid.meta = Object.assign({}, bid.meta, { advertiserDomains: [slot.adomain].flat() });
244
- }
245
- if (slot.ext?.meta?.networkName) {
246
- bid.meta = Object.assign({}, bid.meta, { networkName: slot.ext.meta.networkName })
247
- }
248
- if (slot.native) {
249
- if (bidRequest.params.nativeCallback) {
250
- bid.ad = createNativeAd(bidId, slot.native, bidRequest.params.nativeCallback);
251
- } else {
252
- bid.native = createPrebidNativeAd(slot.native);
253
- bid.mediaType = NATIVE;
235
+ if (body.ext?.paf?.transmission && slot.ext?.paf?.content_id) {
236
+ const pafResponseMeta = {
237
+ content_id: slot.ext.paf.content_id,
238
+ transmission: response.ext.paf.transmission
239
+ };
240
+ bid.meta = Object.assign({}, bid.meta, { paf: pafResponseMeta });
254
241
  }
255
- } else if (slot.video) {
256
- bid.vastUrl = slot.displayurl;
257
- bid.mediaType = VIDEO;
258
- const context = deepAccess(bidRequest, 'mediaTypes.video.context');
259
- // if outstream video, add a default render for it.
260
- if (context === OUTSTREAM) {
261
- bid.renderer = createOutstreamVideoRenderer(slot);
242
+ if (slot.adomain) {
243
+ bid.meta = Object.assign({}, bid.meta, { advertiserDomains: [slot.adomain].flat() });
262
244
  }
263
- } else {
264
- bid.ad = slot.creative;
245
+ if (slot.ext?.meta?.networkName) {
246
+ bid.meta = Object.assign({}, bid.meta, { networkName: slot.ext.meta.networkName })
247
+ }
248
+ if (slot.native) {
249
+ if (bidRequest.params.nativeCallback) {
250
+ bid.ad = createNativeAd(bidId, slot.native, bidRequest.params.nativeCallback);
251
+ } else {
252
+ bid.native = createPrebidNativeAd(slot.native);
253
+ bid.mediaType = NATIVE;
254
+ }
255
+ } else if (slot.video) {
256
+ bid.vastUrl = slot.displayurl;
257
+ bid.mediaType = VIDEO;
258
+ const context = deepAccess(bidRequest, 'mediaTypes.video.context');
259
+ // if outstream video, add a default render for it.
260
+ if (context === OUTSTREAM) {
261
+ bid.renderer = createOutstreamVideoRenderer(slot);
262
+ }
263
+ } else {
264
+ bid.ad = slot.creative;
265
+ }
266
+ bids.push(bid);
265
267
  }
266
- bids.push(bid);
267
268
  });
268
269
  }
269
270
 
@@ -462,6 +463,7 @@ function buildCdbRequest(context, bidRequests, bidderRequest) {
462
463
  networkId = bidRequest.params.networkId || networkId;
463
464
  schain = bidRequest.schain || schain;
464
465
  const slot = {
466
+ slotid: bidRequest.bidId,
465
467
  impid: bidRequest.adUnitCode,
466
468
  transactionid: bidRequest.ortb2Imp?.ext?.tid
467
469
  };
@@ -786,6 +788,27 @@ function createOutstreamVideoRenderer(slot) {
786
788
  return renderer;
787
789
  }
788
790
 
791
+ function getAssociatedBidRequest(bidRequests, slot) {
792
+ for (const request of bidRequests) {
793
+ if (request.adUnitCode === slot.impid) {
794
+ if (request.params.zoneId && parseInt(request.params.zoneId) === slot.zoneid) {
795
+ return request;
796
+ } else if (slot.native) {
797
+ if (request.mediaTypes?.native || request.nativeParams) {
798
+ return request;
799
+ }
800
+ } else if (slot.video) {
801
+ if (request.mediaTypes?.video) {
802
+ return request;
803
+ }
804
+ } else if (request.mediaTypes?.banner || request.sizes) {
805
+ return request;
806
+ }
807
+ }
808
+ }
809
+ return undefined;
810
+ }
811
+
789
812
  export function tryGetCriteoFastBid() {
790
813
  // begin ref#1
791
814
  try {
@@ -20,12 +20,14 @@ export function init(cfg) {
20
20
  if (cfg && cfg.enabled === true) {
21
21
  if (!isEnabled) {
22
22
  getHook('addComponentAuction').before(addComponentAuctionHook);
23
+ getHook('makeBidRequests').after(markForFledge);
23
24
  isEnabled = true;
24
25
  }
25
26
  logInfo(`${MODULE} enabled (browser ${isFledgeSupported() ? 'supports' : 'does NOT support'} fledge)`, cfg);
26
27
  } else {
27
28
  if (isEnabled) {
28
29
  getHook('addComponentAuction').getHooks({hook: addComponentAuctionHook}).remove();
30
+ getHook('makeBidRequests').getHooks({hook: markForFledge}).remove()
29
31
  isEnabled = false;
30
32
  }
31
33
  logInfo(`${MODULE} disabled`, cfg);
@@ -56,16 +58,27 @@ function isFledgeSupported() {
56
58
 
57
59
  export function markForFledge(next, bidderRequests) {
58
60
  if (isFledgeSupported()) {
61
+ const globalFledgeConfig = config.getConfig('fledgeForGpt');
62
+ const bidders = globalFledgeConfig?.bidders ?? [];
59
63
  bidderRequests.forEach((req) => {
60
- req.fledgeEnabled = config.runWithBidder(req.bidderCode, () => config.getConfig('fledgeEnabled'))
61
- })
64
+ const useGlobalConfig = globalFledgeConfig?.enabled && (bidders.length == 0 || bidders.includes(req.bidderCode));
65
+ Object.assign(req, config.runWithBidder(req.bidderCode, () => {
66
+ return {
67
+ fledgeEnabled: config.getConfig('fledgeEnabled') ?? (useGlobalConfig ? globalFledgeConfig.enabled : undefined),
68
+ defaultForSlots: config.getConfig('defaultForSlots') ?? (useGlobalConfig ? globalFledgeConfig?.defaultForSlots : undefined)
69
+ }
70
+ }));
71
+ });
62
72
  }
63
73
  next(bidderRequests);
64
74
  }
65
- getHook('makeBidRequests').after(markForFledge);
66
75
 
67
76
  export function setImpExtAe(imp, bidRequest, context) {
68
- if (!context.bidderRequest.fledgeEnabled) {
77
+ if (context.bidderRequest.fledgeEnabled) {
78
+ imp.ext = Object.assign(imp.ext || {}, {
79
+ ae: imp.ext?.ae ?? context.bidderRequest.defaultForSlots
80
+ })
81
+ } else {
69
82
  delete imp.ext?.ae;
70
83
  }
71
84
  }
@@ -15,8 +15,8 @@ This is accomplished by adding the `fledgeForGpt` module to the list of modules
15
15
  gulp build --modules=fledgeForGpt,...
16
16
  ```
17
17
 
18
- Second, they must enable FLEDGE in their Prebid.js configuration. To provide a high degree of flexiblity for testing, FLEDGE
19
- settings exist at the module level, the bidder level, and the slot level.
18
+ Second, they must enable FLEDGE in their Prebid.js configuration.
19
+ This is done through module level configuration, but to provide a high degree of flexiblity for testing, FLEDGE settings also exist at the bidder level and slot level.
20
20
 
21
21
  ### Module Configuration
22
22
  This module exposes the following settings:
@@ -24,15 +24,20 @@ This module exposes the following settings:
24
24
  |Name |Type |Description |Notes |
25
25
  | :------------ | :------------ | :------------ |:------------ |
26
26
  |enabled | Boolean |Enable/disable the module |Defaults to `false` |
27
+ |bidders | Array[String] |Optional list of bidders |Defaults to all bidders |
28
+ |defaultForSlots | Number |Default value for `imp.ext.ae` in requests for specified bidders |Should be 1 |
27
29
 
28
- As noted above, FLEDGE support is disabled by default. To enable it, set the `enabled` value to `true` for this module
29
- using the `setConfig` method of Prebid.js:
30
+ As noted above, FLEDGE support is disabled by default. To enable it, set the `enabled` value to `true` for this module and configure `defaultForSlots` to be `1` (meaning _Client-side auction_).
31
+ using the `setConfig` method of Prebid.js. Optionally, a list of
32
+ bidders to apply these settings to may be provided:
30
33
 
31
34
  ```js
32
35
  pbjs.que.push(function() {
33
36
  pbjs.setConfig({
34
37
  fledgeForGpt: {
35
- enabled: true
38
+ enabled: true,
39
+ bidders: ['openx', 'rtbhouse'],
40
+ defaultForSlots: 1
36
41
  }
37
42
  });
38
43
  });
@@ -44,23 +49,25 @@ This module adds the following setting for bidders:
44
49
  |Name |Type |Description |Notes |
45
50
  | :------------ | :------------ | :------------ |:------------ |
46
51
  | fledgeEnabled | Boolean | Enable/disable a bidder to participate in FLEDGE | Defaults to `false` |
52
+ |defaultForSlots | Number |Default value for `imp.ext.ae` in requests for specified bidders |Should be 1|
47
53
 
48
- In addition to enabling FLEDGE at the module level, individual bidders must also be enabled. This allows publishers to
49
- selectively test with one or more bidders as they desire. To enable one or more bidders, use the `setBidderConfig` method
54
+ Individual bidders may be further included or excluded here using the `setBidderConfig` method
50
55
  of Prebid.js:
51
56
 
52
57
  ```js
53
58
  pbjs.setBidderConfig({
54
59
  bidders: ["openx"],
55
60
  config: {
56
- fledgeEnabled: true
61
+ fledgeEnabled: true,
62
+ defaultForSlots: 1
57
63
  }
58
64
  });
59
65
  ```
60
66
 
61
67
  ### AdUnit Configuration
62
- Enabling an adunit for FLEDGE eligibility is accomplished by setting an attribute of the `ortb2Imp` object for that
63
- adunit.
68
+ All adunits can be opted-in to FLEDGE in the global config via the `defaultForSlots` parameter.
69
+ If needed, adunits can be configured individually by setting an attribute of the `ortb2Imp` object for that
70
+ adunit. This attribute will take precedence over `defaultForSlots` setting.
64
71
 
65
72
  |Name |Type |Description |Notes |
66
73
  | :------------ | :------------ | :------------ |:------------ |
@@ -20,6 +20,8 @@ import { ajax } from '../src/ajax.js';
20
20
  import { generateUUID, insertElement, isEmpty, logError } from '../src/utils.js';
21
21
  import * as events from '../src/events.js';
22
22
  import CONSTANTS from '../src/constants.json';
23
+ import { loadExternalScript } from '../src/adloader.js';
24
+ import { auctionManager } from '../src/auctionManager.js';
23
25
 
24
26
  /** @type {string} */
25
27
  const SUBMODULE_NAME = 'geoedge';
@@ -33,9 +35,13 @@ const PV_ID = generateUUID();
33
35
  /** @type {string} */
34
36
  const HOST_NAME = 'https://rumcdn.geoedge.be';
35
37
  /** @type {string} */
36
- const FILE_NAME = 'grumi.js';
38
+ const FILE_NAME_CLIENT = 'grumi.js';
39
+ /** @type {string} */
40
+ const FILE_NAME_INPAGE = 'grumi-ip.js';
41
+ /** @type {function} */
42
+ export let getClientUrl = (key) => `${HOST_NAME}/${key}/${FILE_NAME_CLIENT}`;
37
43
  /** @type {function} */
38
- export let getClientUrl = (key) => `${HOST_NAME}/${key}/${FILE_NAME}`;
44
+ export let getInPageUrl = (key) => `${HOST_NAME}/${key}/${FILE_NAME_INPAGE}`;
39
45
  /** @type {string} */
40
46
  export let wrapper
41
47
  /** @type {boolean} */;
@@ -177,7 +183,8 @@ function isSupportedBidder(bidder, paramsBidders) {
177
183
  function shouldWrap(bid, params) {
178
184
  let supportedBidder = isSupportedBidder(bid.bidderCode, params.bidders);
179
185
  let donePreload = params.wap ? preloaded : true;
180
- return wrapperReady && supportedBidder && donePreload;
186
+ let isGPT = params.gpt;
187
+ return wrapperReady && supportedBidder && donePreload && !isGPT;
181
188
  }
182
189
 
183
190
  function conditionallyWrap(bidResponse, config, userConsent) {
@@ -187,31 +194,55 @@ function conditionallyWrap(bidResponse, config, userConsent) {
187
194
  }
188
195
  }
189
196
 
197
+ function isBillingMessage(data, params) {
198
+ return data.key === params.key && data.impression;
199
+ }
200
+
190
201
  /**
191
- * Fire billable events for applicable bids
202
+ * Fire billable events when our client sends a message
203
+ * Messages will be sent only when:
204
+ * a. applicable bids are wrapped
205
+ * b. our code laoded and executed sucesfully
192
206
  */
193
207
  function fireBillableEventsForApplicableBids(params) {
194
- events.on(CONSTANTS.EVENTS.BID_WON, function (winningBid) {
195
- if (shouldWrap(winningBid, params)) {
208
+ window.addEventListener('message', function (message) {
209
+ let data = message.data;
210
+ if (isBillingMessage(data, params)) {
211
+ let winningBid = auctionManager.findBidByAdId(data.adId);
196
212
  events.emit(CONSTANTS.EVENTS.BILLABLE_EVENT, {
197
213
  vendor: SUBMODULE_NAME,
198
- billingId: generateUUID(),
199
- type: 'impression',
200
- transactionId: winningBid.transactionId,
201
- auctionId: winningBid.auctionId,
202
- bidId: winningBid.requestId
214
+ billingId: data.impressionId,
215
+ type: winningBid ? 'impression' : data.type,
216
+ transactionId: winningBid?.transactionId || data.transactionId,
217
+ auctionId: winningBid?.auctionId || data.auctionId,
218
+ bidId: winningBid?.requestId || data.requestId
203
219
  });
204
220
  }
205
221
  });
206
222
  }
207
223
 
224
+ /**
225
+ * Loads Geoedge in page script that monitors all ad slots created by GPT
226
+ * @param {Object} params
227
+ */
228
+ function setupInPage(params) {
229
+ window.grumi = params;
230
+ window.grumi.fromPrebid = true;
231
+ loadExternalScript(getInPageUrl(params.key), SUBMODULE_NAME);
232
+ }
233
+
208
234
  function init(config, userConsent) {
209
235
  let params = config.params;
210
236
  if (!params || !params.key) {
211
237
  logError('missing key for geoedge RTD module provider');
212
238
  return false;
213
239
  }
214
- preloadClient(params.key);
240
+ if (params.gpt) {
241
+ setupInPage(params);
242
+ } else {
243
+ fetchWrapper(setWrapper);
244
+ preloadClient(params.key);
245
+ }
215
246
  fireBillableEventsForApplicableBids(params);
216
247
  return true;
217
248
  }
@@ -227,9 +258,4 @@ export const geoedgeSubmodule = {
227
258
  onBidResponseEvent: conditionallyWrap
228
259
  };
229
260
 
230
- export function beforeInit() {
231
- fetchWrapper(setWrapper);
232
- submodule('realTimeData', geoedgeSubmodule);
233
- }
234
-
235
- beforeInit();
261
+ submodule('realTimeData', geoedgeSubmodule);
@@ -5,7 +5,7 @@ Module Type: Rtd Provider
5
5
  Maintainer: guy.books@geoedge.com
6
6
 
7
7
  The Geoedge Realtime module lets publishers block bad ads such as automatic redirects, malware, offensive creatives and landing pages.
8
- To use this module, you'll need to work with [Geoedge](https://www.geoedge.com/publishers-real-time-protection/) to get an account and cutomer key.
8
+ To use this module, you'll need to work with [Geoedge](https://www.geoedge.com/publishers-real-time-protection/) to get an account and customer key.
9
9
 
10
10
  ## Integration
11
11
 
@@ -49,6 +49,7 @@ Parameters details:
49
49
  |params.key | String | Customer key |Required, contact Geoedge to get your key |
50
50
  |params.bidders | Object | Bidders to monitor |Optional, list of bidder to include / exclude from monitoring. Omitting this will monitor bids from all bidders. |
51
51
  |params.wap |Boolean |Wrap after preload |Optional, defaults to `false`. Set to `true` if you want to monitor only after the module has preloaded the monitoring client. |
52
+ |params.gpt |Boolean |Wrap all GPT ad slots |Optional, defaults to `false`. Set to `true` if you want to monitor all Google Publisher Tag ad slots, regaedless if the winning bid comes from Prebid or Google Ad Manager (Direct, Adx, Adesnse, Open Bidding, etc). |
52
53
 
53
54
  ## Example
54
55