prebid.js 7.26.0 → 7.28.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 (334) hide show
  1. package/.github/workflows/issue_tracker.yml +1 -1
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/adWMGAnalyticsAdapter.js +1 -1
  5. package/dist/adagioAnalyticsAdapter.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/adhashBidAdapter.js +1 -1
  10. package/dist/adkernelAdnAnalyticsAdapter.js +1 -1
  11. package/dist/adlooxAdServerVideo.js +1 -1
  12. package/dist/adlooxAnalyticsAdapter.js +1 -1
  13. package/dist/adlooxRtdProvider.js +1 -1
  14. package/dist/admaticBidAdapter.js +1 -1
  15. package/dist/admixerBidAdapter.js +1 -1
  16. package/dist/adomikAnalyticsAdapter.js +1 -1
  17. package/dist/adrelevantisBidAdapter.js +1 -1
  18. package/dist/adtrgtmeBidAdapter.js +1 -1
  19. package/dist/adxcgAnalyticsAdapter.js +1 -1
  20. package/dist/adxcgBidAdapter.js +1 -1
  21. package/dist/adxpremiumAnalyticsAdapter.js +1 -1
  22. package/dist/aidemBidAdapter.js +1 -0
  23. package/dist/ajaBidAdapter.js +1 -1
  24. package/dist/amxBidAdapter.js +1 -1
  25. package/dist/amxIdSystem.js +1 -1
  26. package/dist/analyticsAdapter.js +1 -1
  27. package/dist/appierAnalyticsAdapter.js +1 -1
  28. package/dist/appnexusBidAdapter.js +1 -1
  29. package/dist/asoBidAdapter.js +1 -1
  30. package/dist/atsAnalyticsAdapter.js +1 -1
  31. package/dist/axonixBidAdapter.js +1 -1
  32. package/dist/bidViewability.js +1 -1
  33. package/dist/bidglassBidAdapter.js +1 -1
  34. package/dist/bidwatchAnalyticsAdapter.js +1 -1
  35. package/dist/big-richmediaBidAdapter.js +1 -1
  36. package/dist/bridgewellBidAdapter.js +1 -1
  37. package/dist/brightMountainMediaBidAdapter.js +1 -1
  38. package/dist/browsiRtdProvider.js +1 -1
  39. package/dist/bucksenseBidAdapter.js +1 -1
  40. package/dist/byDataAnalyticsAdapter.js +1 -1
  41. package/dist/carodaBidAdapter.js +1 -1
  42. package/dist/chtnwBidAdapter.js +1 -1
  43. package/dist/concertAnalyticsAdapter.js +1 -1
  44. package/dist/concertBidAdapter.js +1 -1
  45. package/dist/connectadBidAdapter.js +1 -1
  46. package/dist/consentManagement.js +1 -1
  47. package/dist/consentManagementUsp.js +1 -1
  48. package/dist/consumableBidAdapter.js +1 -1
  49. package/dist/conversantAnalyticsAdapter.js +1 -1
  50. package/dist/conversantBidAdapter.js +1 -1
  51. package/dist/craftBidAdapter.js +1 -1
  52. package/dist/criteoBidAdapter.js +1 -1
  53. package/dist/datablocksAnalyticsAdapter.js +1 -1
  54. package/dist/dependencies.json +6 -0
  55. package/dist/dfpAdServerVideo.js +1 -1
  56. package/dist/discoveryBidAdapter.js +1 -1
  57. package/dist/dspxBidAdapter.js +1 -1
  58. package/dist/eplanningAnalyticsAdapter.js +1 -1
  59. package/dist/eplanningBidAdapter.js +1 -1
  60. package/dist/finativeBidAdapter.js +1 -1
  61. package/dist/fintezaAnalyticsAdapter.js +1 -1
  62. package/dist/fluctBidAdapter.js +1 -1
  63. package/dist/ftrackIdSystem.js +1 -1
  64. package/dist/gdprEnforcement.js +1 -1
  65. package/dist/genericAnalyticsAdapter.js +1 -0
  66. package/dist/geoedgeRtdProvider.js +1 -1
  67. package/dist/glimpseBidAdapter.js +1 -1
  68. package/dist/glomexBidAdapter.js +1 -1
  69. package/dist/gmosspBidAdapter.js +1 -1
  70. package/dist/goldbachBidAdapter.js +1 -1
  71. package/dist/googleAnalyticsAdapter.js +1 -1
  72. package/dist/gravitoIdSystem.js +1 -1
  73. package/dist/gridBidAdapter.js +1 -1
  74. package/dist/gridNMBidAdapter.js +1 -1
  75. package/dist/growthCodeAnalyticsAdapter.js +1 -0
  76. package/dist/gumgumBidAdapter.js +1 -1
  77. package/dist/h12mediaBidAdapter.js +1 -1
  78. package/dist/hadronAnalyticsAdapter.js +1 -1
  79. package/dist/id5AnalyticsAdapter.js +1 -1
  80. package/dist/id5IdSystem.js +1 -1
  81. package/dist/impactifyBidAdapter.js +1 -1
  82. package/dist/improvedigitalBidAdapter.js +1 -1
  83. package/dist/inmarBidAdapter.js +1 -1
  84. package/dist/insticatorBidAdapter.js +1 -1
  85. package/dist/invisiblyAnalyticsAdapter.js +1 -1
  86. package/dist/ixBidAdapter.js +1 -1
  87. package/dist/justpremiumBidAdapter.js +1 -1
  88. package/dist/jwplayerRtdProvider.js +1 -1
  89. package/dist/kargoAnalyticsAdapter.js +1 -1
  90. package/dist/kargoBidAdapter.js +1 -1
  91. package/dist/kinessoIdSystem.js +1 -1
  92. package/dist/konduitAnalyticsAdapter.js +1 -1
  93. package/dist/kueezBidAdapter.js +1 -1
  94. package/dist/kueezRtbBidAdapter.js +1 -1
  95. package/dist/lassoBidAdapter.js +1 -1
  96. package/dist/lifestreetBidAdapter.js +1 -1
  97. package/dist/limelightDigitalBidAdapter.js +1 -1
  98. package/dist/liveIntentAnalyticsAdapter.js +1 -1
  99. package/dist/liveIntentIdSystem.js +1 -1
  100. package/dist/livewrappedAnalyticsAdapter.js +1 -1
  101. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  102. package/dist/logicadBidAdapter.js +1 -1
  103. package/dist/loglyliftBidAdapter.js +1 -1
  104. package/dist/lotamePanoramaIdSystem.js +1 -1
  105. package/dist/magniteAnalyticsAdapter.js +1 -1
  106. package/dist/malltvAnalyticsAdapter.js +1 -1
  107. package/dist/marsmediaAnalyticsAdapter.js +1 -1
  108. package/dist/marsmediaBidAdapter.js +1 -1
  109. package/dist/mediafuseBidAdapter.js +1 -1
  110. package/dist/mediagoBidAdapter.js +1 -1
  111. package/dist/medianetAnalyticsAdapter.js +1 -1
  112. package/dist/mediasquareBidAdapter.js +1 -1
  113. package/dist/mgidBidAdapter.js +1 -1
  114. package/dist/minutemediaBidAdapter.js +1 -1
  115. package/dist/nexx360BidAdapter.js +1 -1
  116. package/dist/not-for-prod/prebid.js +206 -202
  117. package/dist/oguryBidAdapter.js +1 -1
  118. package/dist/onetagBidAdapter.js +1 -1
  119. package/dist/ooloAnalyticsAdapter.js +1 -1
  120. package/dist/openxAnalyticsAdapter.js +1 -1
  121. package/dist/optimonAnalyticsAdapter.js +1 -1
  122. package/dist/outbrainBidAdapter.js +1 -1
  123. package/dist/parrableIdSystem.js +1 -1
  124. package/dist/pbsExtensions.js +1 -1
  125. package/dist/pianoDmpAnalyticsAdapter.js +1 -1
  126. package/dist/pixfutureBidAdapter.js +1 -1
  127. package/dist/prebid-core.js +2 -2
  128. package/dist/prebidServerBidAdapter.js +1 -1
  129. package/dist/prebidmanagerAnalyticsAdapter.js +1 -1
  130. package/dist/pubCommonId.js +1 -1
  131. package/dist/pubProvidedIdSystem.js +1 -1
  132. package/dist/publinkIdSystem.js +1 -1
  133. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  134. package/dist/pubmaticBidAdapter.js +1 -1
  135. package/dist/pubperfAnalyticsAdapter.js +1 -1
  136. package/dist/pubstackAnalyticsAdapter.js +1 -1
  137. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  138. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  139. package/dist/pulsepointAnalyticsAdapter.js +1 -1
  140. package/dist/pxyzBidAdapter.js +1 -1
  141. package/dist/quantcastBidAdapter.js +1 -1
  142. package/dist/quantcastIdSystem.js +1 -1
  143. package/dist/rasBidAdapter.js +1 -1
  144. package/dist/readpeakBidAdapter.js +1 -1
  145. package/dist/realvuAnalyticsAdapter.js +1 -1
  146. package/dist/redtramBidAdapter.js +1 -0
  147. package/dist/relaidoBidAdapter.js +1 -1
  148. package/dist/relevantAnalyticsAdapter.js +1 -1
  149. package/dist/rhythmoneBidAdapter.js +1 -1
  150. package/dist/riseBidAdapter.js +1 -1
  151. package/dist/rivrAnalyticsAdapter.js +1 -1
  152. package/dist/roxotAnalyticsAdapter.js +1 -1
  153. package/dist/rtbhouseBidAdapter.js +1 -1
  154. package/dist/rtdModule.js +1 -1
  155. package/dist/rubiconAnalyticsAdapter.js +1 -1
  156. package/dist/rubiconBidAdapter.js +1 -1
  157. package/dist/s2sTesting.js +1 -1
  158. package/dist/scaleableAnalyticsAdapter.js +1 -1
  159. package/dist/schain.js +1 -1
  160. package/dist/seedingAllianceBidAdapter.js +1 -1
  161. package/dist/seedtagBidAdapter.js +1 -1
  162. package/dist/sharedIdSystem.js +1 -1
  163. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  164. package/dist/sharethroughBidAdapter.js +1 -1
  165. package/dist/shinezBidAdapter.js +1 -1
  166. package/dist/sigmoidAnalyticsAdapter.js +1 -1
  167. package/dist/smaatoBidAdapter.js +1 -1
  168. package/dist/smartadserverBidAdapter.js +1 -1
  169. package/dist/smartxBidAdapter.js +1 -1
  170. package/dist/smilewantedBidAdapter.js +1 -1
  171. package/dist/sonobiAnalyticsAdapter.js +1 -1
  172. package/dist/sonobiBidAdapter.js +1 -1
  173. package/dist/sovrnAnalyticsAdapter.js +1 -1
  174. package/dist/sovrnBidAdapter.js +1 -1
  175. package/dist/sspBCBidAdapter.js +1 -1
  176. package/dist/staqAnalyticsAdapter.js +1 -1
  177. package/dist/sublimeBidAdapter.js +1 -1
  178. package/dist/synacormediaBidAdapter.js +1 -1
  179. package/dist/taboolaBidAdapter.js +1 -1
  180. package/dist/tapadIdSystem.js +1 -1
  181. package/dist/targetVideoBidAdapter.js +1 -1
  182. package/dist/teadsBidAdapter.js +1 -1
  183. package/dist/teadsIdSystem.js +1 -1
  184. package/dist/terceptAnalyticsAdapter.js +1 -1
  185. package/dist/trionBidAdapter.js +1 -1
  186. package/dist/tripleliftBidAdapter.js +1 -1
  187. package/dist/ttdBidAdapter.js +1 -1
  188. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  189. package/dist/underdogmediaBidAdapter.js +1 -1
  190. package/dist/undertoneBidAdapter.js +1 -1
  191. package/dist/userId.js +1 -1
  192. package/dist/vidazooBidAdapter.js +1 -1
  193. package/dist/videobyteBidAdapter.js +1 -1
  194. package/dist/visxBidAdapter.js +1 -1
  195. package/dist/vuukleBidAdapter.js +1 -1
  196. package/dist/weboramaRtdProvider.js +1 -1
  197. package/dist/widespaceBidAdapter.js +1 -1
  198. package/dist/winrBidAdapter.js +1 -1
  199. package/dist/yahoosspBidAdapter.js +1 -1
  200. package/dist/yandexBidAdapter.js +1 -1
  201. package/dist/yieldlabBidAdapter.js +1 -1
  202. package/dist/yieldliftBidAdapter.js +1 -1
  203. package/dist/yieldmoBidAdapter.js +1 -1
  204. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  205. package/dist/yuktamediaAnalyticsAdapter.js +1 -1
  206. package/dist/zeta_global_sspAnalyticsAdapter.js +1 -1
  207. package/integrationExamples/gpt/growthcode.html +134 -0
  208. package/libraries/analyticsAdapter/AnalyticsAdapter.js +95 -102
  209. package/libraries/ortb2.5StrictTranslator/dsl.js +54 -0
  210. package/libraries/ortb2.5StrictTranslator/spec.js +81 -0
  211. package/libraries/ortb2.5StrictTranslator/translator.js +37 -0
  212. package/libraries/ortb2.5Translator/translator.js +82 -0
  213. package/modules/33acrossIdSystem.js +3 -0
  214. package/modules/adhashBidAdapter.js +115 -30
  215. package/modules/adhashBidAdapter.md +1 -3
  216. package/modules/admaticBidAdapter.js +10 -1
  217. package/modules/admixerBidAdapter.js +1 -1
  218. package/modules/aidemBidAdapter.js +492 -0
  219. package/modules/aidemBidAdapter.md +187 -0
  220. package/modules/browsiRtdProvider.js +6 -4
  221. package/modules/bucksenseBidAdapter.js +1 -1
  222. package/modules/criteoBidAdapter.js +3 -3
  223. package/modules/discoveryBidAdapter.js +3 -0
  224. package/modules/eplanningBidAdapter.js +2 -6
  225. package/modules/fluctBidAdapter.js +5 -0
  226. package/modules/gdprEnforcement.js +26 -24
  227. package/modules/genericAnalyticsAdapter.js +157 -0
  228. package/modules/geoedgeRtdProvider.js +22 -0
  229. package/modules/glomexBidAdapter.js +2 -0
  230. package/modules/gravitoIdSystem.js +3 -4
  231. package/modules/gridBidAdapter.js +1 -1
  232. package/modules/gridNMBidAdapter.js +1 -1
  233. package/modules/growthCodeAnalyticsAdapter.js +176 -0
  234. package/modules/growthCodeAnalyticsAdapter.md +41 -0
  235. package/modules/impactifyBidAdapter.js +19 -1
  236. package/modules/jwplayerRtdProvider.js +1 -2
  237. package/modules/kargoBidAdapter.js +1 -1
  238. package/modules/lassoBidAdapter.js +8 -4
  239. package/modules/limelightDigitalBidAdapter.js +1 -1
  240. package/modules/liveIntentIdSystem.js +1 -2
  241. package/modules/mediagoBidAdapter.js +2 -1
  242. package/modules/minutemediaBidAdapter.md +3 -3
  243. package/modules/nexx360BidAdapter.js +264 -138
  244. package/modules/openxBidAdapter.md +15 -14
  245. package/modules/pubCommonId.js +2 -1
  246. package/modules/pubProvidedIdSystem.js +2 -0
  247. package/modules/rasBidAdapter.js +8 -3
  248. package/modules/rasBidAdapter.md +16 -15
  249. package/modules/redtramBidAdapter.js +155 -0
  250. package/modules/redtramBidAdapter.md +33 -0
  251. package/modules/riseBidAdapter.js +15 -0
  252. package/modules/riseBidAdapter.md +3 -3
  253. package/modules/rtbhouseBidAdapter.js +90 -29
  254. package/modules/rubiconBidAdapter.js +2 -1
  255. package/modules/seedtagBidAdapter.js +67 -56
  256. package/modules/seedtagBidAdapter.md +60 -0
  257. package/modules/sharedIdSystem.js +3 -1
  258. package/modules/smartxBidAdapter.js +1 -1
  259. package/modules/smnBidAdapter.md +52 -0
  260. package/modules/taboolaBidAdapter.js +20 -7
  261. package/modules/tripleliftBidAdapter.js +1 -1
  262. package/modules/ttdBidAdapter.js +4 -0
  263. package/modules/vidazooBidAdapter.js +31 -8
  264. package/modules/yandexBidAdapter.js +85 -19
  265. package/modules/yandexBidAdapter.md +7 -7
  266. package/modules/yieldlabBidAdapter.js +10 -4
  267. package/modules/yieldliftBidAdapter.js +3 -3
  268. package/package.json +2 -2
  269. package/src/auction.js +30 -4
  270. package/src/consentHandler.js +8 -0
  271. package/src/constants.json +2 -1
  272. package/src/events.js +4 -0
  273. package/src/native.js +31 -20
  274. package/src/refererDetection.js +6 -1
  275. package/src/storageManager.js +6 -3
  276. package/test/helpers/analytics.js +34 -0
  277. package/test/helpers/refererDetectionHelper.js +88 -0
  278. package/test/mocks/analyticsStub.js +3 -1
  279. package/test/spec/AnalyticsAdapter_spec.js +119 -116
  280. package/test/spec/auctionmanager_spec.js +119 -1
  281. package/test/spec/modules/33acrossIdSystem_spec.js +4 -1
  282. package/test/spec/modules/adWMGAnalyticsAdapter_spec.js +10 -8
  283. package/test/spec/modules/adagioAnalyticsAdapter_spec.js +18 -25
  284. package/test/spec/modules/adhashBidAdapter_spec.js +65 -11
  285. package/test/spec/modules/aidemBidAdapter_spec.js +664 -0
  286. package/test/spec/modules/bidwatchAnalyticsAdapter_spec.js +0 -2
  287. package/test/spec/modules/browsiRtdProvider_spec.js +2 -1
  288. package/test/spec/modules/concertAnalyticsAdapter_spec.js +2 -4
  289. package/test/spec/modules/enrichmentFpdModule_spec.js +3 -2
  290. package/test/spec/modules/eplanningAnalyticsAdapter_spec.js +0 -3
  291. package/test/spec/modules/eplanningBidAdapter_spec.js +4 -4
  292. package/test/spec/modules/fluctBidAdapter_spec.js +37 -1
  293. package/test/spec/modules/fpdModule_spec.js +1 -1
  294. package/test/spec/modules/gdprEnforcement_spec.js +115 -68
  295. package/test/spec/modules/genericAnalyticsAdapter_spec.js +284 -0
  296. package/test/spec/modules/geoedgeRtdProvider_spec.js +15 -0
  297. package/test/spec/modules/glomexBidAdapter_spec.js +4 -0
  298. package/test/spec/modules/gravitoIdSystem_spec.js +1 -1
  299. package/test/spec/modules/growthCodeAnalyticsAdapter_spec.js +70 -0
  300. package/test/spec/modules/impactifyBidAdapter_spec.js +13 -0
  301. package/test/spec/modules/invisiblyAnalyticsAdapter_spec.js +17 -27
  302. package/test/spec/modules/jwplayerRtdProvider_spec.js +3 -3
  303. package/test/spec/modules/konduitAnalyticsAdapter_spec.js +0 -2
  304. package/test/spec/modules/liveIntentAnalyticsAdapter_spec.js +3 -6
  305. package/test/spec/modules/medianetAnalyticsAdapter_spec.js +7 -1
  306. package/test/spec/modules/nexx360BidAdapter_spec.js +441 -221
  307. package/test/spec/modules/optimonAnalyticsAdapter_spec.js +3 -11
  308. package/test/spec/modules/pianoDmpAnalyticsAdapter_spec.js +4 -11
  309. package/test/spec/modules/prebidmanagerAnalyticsAdapter_spec.js +3 -12
  310. package/test/spec/modules/pubperfAnalyticsAdapter_spec.js +6 -19
  311. package/test/spec/modules/pubstackAnalyticsAdapter_spec.js +3 -17
  312. package/test/spec/modules/pubwiseAnalyticsAdapter_spec.js +13 -19
  313. package/test/spec/modules/rasBidAdapter_spec.js +5 -1
  314. package/test/spec/modules/redtramBidAdapter_spec.js +256 -0
  315. package/test/spec/modules/riseBidAdapter_spec.js +24 -0
  316. package/test/spec/modules/rtbhouseBidAdapter_spec.js +79 -0
  317. package/test/spec/modules/seedtagBidAdapter_spec.js +65 -92
  318. package/test/spec/modules/sigmoidAnalyticsAdapter_spec.js +4 -8
  319. package/test/spec/modules/sovrnAnalyticsAdapter_spec.js +6 -18
  320. package/test/spec/modules/taboolaBidAdapter_spec.js +39 -0
  321. package/test/spec/modules/tripleliftBidAdapter_spec.js +3 -10
  322. package/test/spec/modules/ttdBidAdapter_spec.js +50 -9
  323. package/test/spec/modules/vidazooBidAdapter_spec.js +173 -27
  324. package/test/spec/modules/yandexBidAdapter_spec.js +22 -13
  325. package/test/spec/modules/yieldlabBidAdapter_spec.js +49 -20
  326. package/test/spec/modules/yieldliftBidAdapter_spec.js +1 -1
  327. package/test/spec/modules/yieldoneAnalyticsAdapter_spec.js +5 -2
  328. package/test/spec/native_spec.js +68 -56
  329. package/test/spec/ortb2.5StrictTranslator/dsl_spec.js +137 -0
  330. package/test/spec/ortb2.5StrictTranslator/spec_spec.js +358 -0
  331. package/test/spec/ortb2.5StrictTranslator/translator_spec.js +16 -0
  332. package/test/spec/ortb2.5Translator/translator_spec.js +64 -0
  333. package/test/spec/refererDetection_spec.js +46 -95
  334. package/test/spec/unit/core/storageManager_spec.js +2 -1
@@ -0,0 +1,134 @@
1
+ <!--
2
+ GrowthCode Setup Example contact support@growthcode.io for more information.
3
+ -->
4
+
5
+ <html>
6
+ <head>
7
+ <script async src="../../build/dev/prebid.js"></script>
8
+ <script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
9
+ <script>
10
+ var FAILSAFE_TIMEOUT = 3300;
11
+ var PREBID_TIMEOUT = 1000;
12
+
13
+ var adUnits = [{
14
+ code: 'div-gpt-ad-1460505748561-0',
15
+ mediaTypes: {
16
+ banner: {
17
+ sizes: [[300, 250], [300,600]],
18
+ }
19
+ },
20
+ // Replace this object to test a new Adapter!
21
+ bids: [{
22
+ bidder: 'appnexus',
23
+ params: {
24
+ placementId: 13144370
25
+ }
26
+ }],
27
+ }];
28
+
29
+ var pbjs = pbjs || {};
30
+ pbjs.que = pbjs.que || [];
31
+
32
+ </script>
33
+
34
+ <script>
35
+ var googletag = googletag || {};
36
+ googletag.cmd = googletag.cmd || [];
37
+ googletag.cmd.push(function() {
38
+ googletag.pubads().disableInitialLoad();
39
+ });
40
+
41
+ pbjs.que.push(function() {
42
+ pbjs.addAdUnits(adUnits);
43
+ pbjs.requestBids({
44
+ bidsBackHandler: sendAdserverRequest,
45
+ timeout: PREBID_TIMEOUT
46
+ });
47
+ pbjs.enableAnalytics({
48
+ provider: 'growthCodeAnalytics',
49
+ options: {
50
+ pid: 'TEST01',
51
+ trackEvents: [
52
+ 'auctionInit',
53
+ 'auctionEnd',
54
+ 'bidAdjustment',
55
+ 'bidTimeout',
56
+ 'bidTimeout',
57
+ 'bidRequested',
58
+ 'bidResponse',
59
+ 'setTargeting',
60
+ 'requestBids',
61
+ 'addAdUnits',
62
+ 'noBid',
63
+ 'bidWon',
64
+ 'bidderDone']
65
+ }
66
+ });
67
+ pbjs.setConfig({
68
+ debugging: {
69
+ enabled: true,
70
+ bids: [{
71
+ bidder: 'appnexus',
72
+ adUnitCode: '/19968336/header-bid-tag-0',
73
+ cpm: 1.5,
74
+ adId: '111111',
75
+ ad: '<html><body><img src="https://files.prebid.org/creatives/prebid300x250.png"></body></html>'
76
+ }]
77
+ },
78
+ userSync: {
79
+ userIds: [{
80
+ name: "sharedId",
81
+ storage: {
82
+ type: "html5",
83
+ name: "_sharedID", // create a cookie with this name
84
+ expires: 365 // expires in 1 years
85
+ }
86
+ },{
87
+ name: 'growthCodeId',
88
+ params: {
89
+ pid: 'TEST01',
90
+ publisher_id: '_sharedID',
91
+ publisher_id_storage: 'html5',
92
+ }
93
+ }]
94
+ }
95
+ });
96
+ });
97
+
98
+ function sendAdserverRequest() {
99
+ if (pbjs.adserverRequestSent) return;
100
+ pbjs.adserverRequestSent = true;
101
+ googletag.cmd.push(function() {
102
+ pbjs.que.push(function() {
103
+ pbjs.setTargetingForGPTAsync();
104
+ googletag.pubads().refresh();
105
+ });
106
+ });
107
+ }
108
+
109
+ setTimeout(function() {
110
+ sendAdserverRequest();
111
+ }, FAILSAFE_TIMEOUT);
112
+
113
+ </script>
114
+
115
+ <script>
116
+ googletag.cmd.push(function () {
117
+ googletag.defineSlot('/19968336/header-bid-tag-0', [[300, 250], [300, 600]], 'div-gpt-ad-1460505748561-0').addService(googletag.pubads());
118
+
119
+ googletag.pubads().enableSingleRequest();
120
+ googletag.enableServices();
121
+ });
122
+ </script>
123
+ </head>
124
+
125
+ <body>
126
+ <h2>Prebid.js Test</h2>
127
+ <h5>Div-1</h5>
128
+ <div id='div-gpt-ad-1460505748561-0'>
129
+ <script type='text/javascript'>
130
+ googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460505748561-0'); });
131
+ </script>
132
+ </div>
133
+ </body>
134
+ </html>
@@ -1,47 +1,68 @@
1
1
  import CONSTANTS from '../../src/constants.json';
2
- import { ajax } from '../../src/ajax.js';
3
- import { logMessage, _each } from '../../src/utils.js';
4
- import * as events from '../../src/events.js'
2
+ import {ajax} from '../../src/ajax.js';
3
+ import {logError, logMessage} from '../../src/utils.js';
4
+ import * as events from '../../src/events.js';
5
5
 
6
6
  export const _internal = {
7
7
  ajax
8
8
  };
9
-
10
- const {
11
- EVENTS: {
12
- AUCTION_INIT,
13
- AUCTION_END,
14
- REQUEST_BIDS,
15
- BID_REQUESTED,
16
- BID_TIMEOUT,
17
- BID_RESPONSE,
18
- NO_BID,
19
- BID_WON,
20
- BID_ADJUSTMENT,
21
- BIDDER_DONE,
22
- SET_TARGETING,
23
- AD_RENDER_FAILED,
24
- AD_RENDER_SUCCEEDED,
25
- AUCTION_DEBUG,
26
- ADD_AD_UNITS,
27
- BILLABLE_EVENT
28
- }
29
- } = CONSTANTS;
30
-
31
9
  const ENDPOINT = 'endpoint';
32
10
  const BUNDLE = 'bundle';
33
11
 
12
+ export const DEFAULT_INCLUDE_EVENTS = Object.values(CONSTANTS.EVENTS)
13
+ .filter(ev => ev !== CONSTANTS.EVENTS.AUCTION_DEBUG);
14
+
15
+ let debounceDelay = 100;
16
+
17
+ export function setDebounceDelay(delay) {
18
+ debounceDelay = delay;
19
+ }
20
+
34
21
  export default function AnalyticsAdapter({ url, analyticsType, global, handler }) {
35
- const _queue = [];
36
- let _eventCount = 0;
37
- let _enableCheck = true;
38
- let _handlers;
39
- let _enabled = false;
40
- let _sampled = true;
41
-
42
- if (analyticsType === ENDPOINT || BUNDLE) {
43
- _emptyQueue();
44
- }
22
+ const queue = [];
23
+ let handlers;
24
+ let enabled = false;
25
+ let sampled = true;
26
+ let provider;
27
+
28
+ const emptyQueue = (() => {
29
+ let running = false;
30
+ let timer;
31
+ const clearQueue = () => {
32
+ if (!running) {
33
+ running = true; // needed to avoid recursive re-processing when analytics event handlers trigger other events
34
+ try {
35
+ let i = 0;
36
+ let notDecreasing = 0;
37
+ while (queue.length > 0) {
38
+ i++;
39
+ const len = queue.length;
40
+ queue.shift()();
41
+ if (queue.length >= len) {
42
+ notDecreasing++;
43
+ } else {
44
+ notDecreasing = 0
45
+ }
46
+ if (notDecreasing >= 10) {
47
+ logError('Detected probable infinite loop, discarding events', queue)
48
+ queue.length = 0;
49
+ return;
50
+ }
51
+ }
52
+ logMessage(`${provider} analytics: processed ${i} events`);
53
+ } finally {
54
+ running = false;
55
+ }
56
+ }
57
+ };
58
+ return function () {
59
+ if (timer != null) {
60
+ clearTimeout(timer);
61
+ timer = null;
62
+ }
63
+ debounceDelay === 0 ? clearQueue() : timer = setTimeout(clearQueue, debounceDelay);
64
+ }
65
+ })();
45
66
 
46
67
  return Object.defineProperties({
47
68
  track: _track,
@@ -54,7 +75,7 @@ export default function AnalyticsAdapter({ url, analyticsType, global, handler }
54
75
  getUrl: () => url
55
76
  }, {
56
77
  enabled: {
57
- get: () => _enabled
78
+ get: () => enabled
58
79
  }
59
80
  });
60
81
 
@@ -72,69 +93,58 @@ export default function AnalyticsAdapter({ url, analyticsType, global, handler }
72
93
  _internal.ajax(url, callback, JSON.stringify({ eventType, args }));
73
94
  }
74
95
 
75
- function _enqueue({ eventType, args }) {
76
- const _this = this;
77
-
78
- if (global && window[global] && eventType && args) {
79
- this.track({ eventType, args });
80
- } else {
81
- _queue.push(function () {
82
- _eventCount++;
83
- _this.track({ eventType, args });
84
- });
85
- }
96
+ function _enqueue({eventType, args}) {
97
+ queue.push(() => {
98
+ this.track({eventType, args});
99
+ });
100
+ emptyQueue();
86
101
  }
87
102
 
88
103
  function _enable(config) {
104
+ provider = config?.provider;
89
105
  var _this = this;
90
106
 
91
107
  if (typeof config === 'object' && typeof config.options === 'object') {
92
- _sampled = typeof config.options.sampling === 'undefined' || Math.random() < parseFloat(config.options.sampling);
108
+ sampled = typeof config.options.sampling === 'undefined' || Math.random() < parseFloat(config.options.sampling);
93
109
  } else {
94
- _sampled = true;
110
+ sampled = true;
95
111
  }
96
112
 
97
- if (_sampled) {
113
+ if (sampled) {
114
+ const trackedEvents = (() => {
115
+ const {includeEvents = DEFAULT_INCLUDE_EVENTS, excludeEvents = []} = (config || {});
116
+ return new Set(
117
+ Object.values(CONSTANTS.EVENTS)
118
+ .filter(ev => includeEvents.includes(ev))
119
+ .filter(ev => !excludeEvents.includes(ev))
120
+ );
121
+ })();
122
+
98
123
  // first send all events fired before enableAnalytics called
99
124
  events.getEvents().forEach(event => {
100
- if (!event) {
125
+ if (!event || !trackedEvents.has(event.eventType)) {
101
126
  return;
102
127
  }
103
128
 
104
129
  const { eventType, args } = event;
105
-
106
- if (eventType !== BID_TIMEOUT) {
107
- _enqueue.call(_this, { eventType, args });
108
- }
130
+ _enqueue.call(_this, { eventType, args });
109
131
  });
110
132
 
111
133
  // Next register event listeners to send data immediately
112
-
113
- _handlers = {
114
- [REQUEST_BIDS]: args => this.enqueue({ eventType: REQUEST_BIDS, args }),
115
- [BID_REQUESTED]: args => this.enqueue({ eventType: BID_REQUESTED, args }),
116
- [BID_RESPONSE]: args => this.enqueue({ eventType: BID_RESPONSE, args }),
117
- [NO_BID]: args => this.enqueue({ eventType: NO_BID, args }),
118
- [BID_TIMEOUT]: args => this.enqueue({ eventType: BID_TIMEOUT, args }),
119
- [BID_WON]: args => this.enqueue({ eventType: BID_WON, args }),
120
- [BID_ADJUSTMENT]: args => this.enqueue({ eventType: BID_ADJUSTMENT, args }),
121
- [BIDDER_DONE]: args => this.enqueue({ eventType: BIDDER_DONE, args }),
122
- [SET_TARGETING]: args => this.enqueue({ eventType: SET_TARGETING, args }),
123
- [AUCTION_END]: args => this.enqueue({ eventType: AUCTION_END, args }),
124
- [AD_RENDER_FAILED]: args => this.enqueue({ eventType: AD_RENDER_FAILED, args }),
125
- [AD_RENDER_SUCCEEDED]: args => this.enqueue({ eventType: AD_RENDER_SUCCEEDED, args }),
126
- [AUCTION_DEBUG]: args => this.enqueue({ eventType: AUCTION_DEBUG, args }),
127
- [ADD_AD_UNITS]: args => this.enqueue({ eventType: ADD_AD_UNITS, args }),
128
- [BILLABLE_EVENT]: args => this.enqueue({ eventType: BILLABLE_EVENT, args }),
129
- [AUCTION_INIT]: args => {
130
- args.config = typeof config === 'object' ? config.options || {} : {}; // enableAnaltyics configuration object
131
- this.enqueue({ eventType: AUCTION_INIT, args });
132
- }
133
- };
134
-
135
- _each(_handlers, (handler, event) => {
136
- events.on(event, handler);
137
- });
134
+ handlers = Object.fromEntries(
135
+ Array.from(trackedEvents)
136
+ .map((ev) => {
137
+ const handler = ev === CONSTANTS.EVENTS.AUCTION_INIT
138
+ ? (args) => {
139
+ // TODO: remove this special case in v8
140
+ args.config = typeof config === 'object' ? config.options || {} : {};
141
+ this.enqueue({eventType: ev, args});
142
+ }
143
+ : (args) => this.enqueue({eventType: ev, args});
144
+ events.on(ev, handler);
145
+ return [ev, handler];
146
+ })
147
+ )
138
148
  } else {
139
149
  logMessage(`Analytics adapter for "${global}" disabled by sampling`);
140
150
  }
@@ -144,31 +154,14 @@ export default function AnalyticsAdapter({ url, analyticsType, global, handler }
144
154
  this.enableAnalytics = function _enable() {
145
155
  return logMessage(`Analytics adapter for "${global}" already enabled, unnecessary call to \`enableAnalytics\`.`);
146
156
  };
147
- _enabled = true;
157
+ enabled = true;
148
158
  }
149
159
 
150
160
  function _disable() {
151
- _each(_handlers, (handler, event) => {
161
+ Object.entries(handlers || {}).forEach(([event, handler]) => {
152
162
  events.off(event, handler);
153
- });
163
+ })
154
164
  this.enableAnalytics = this._oldEnable ? this._oldEnable : _enable;
155
- _enabled = false;
156
- }
157
-
158
- function _emptyQueue() {
159
- if (_enableCheck) {
160
- for (var i = 0; i < _queue.length; i++) {
161
- _queue[i]();
162
- }
163
-
164
- // override push to execute the command immediately from now on
165
- _queue.push = function (fn) {
166
- fn();
167
- };
168
-
169
- _enableCheck = false;
170
- }
171
-
172
- logMessage(`event count sent to ${global}: ${_eventCount}`);
165
+ enabled = false;
173
166
  }
174
167
  }
@@ -0,0 +1,54 @@
1
+ export const ERR_TYPE = 0; // field has wrong type (only objects, enums, and arrays of objects or enums are checked)
2
+ export const ERR_UNKNOWN_FIELD = 1; // field is not defined in ORTB 2.5 spec
3
+ export const ERR_ENUM = 2; // field is an enum and its value is not one of those listed in the ORTB 2.5 spec
4
+
5
+ // eslint-disable-next-line symbol-description
6
+ export const extend = Symbol();
7
+
8
+ export function Obj(primitiveFields, spec = {}) {
9
+ const scan = (path, parent, field, value, onError) => {
10
+ if (value == null || typeof value !== 'object') {
11
+ onError(ERR_TYPE, path, parent, field, value);
12
+ return;
13
+ }
14
+ Object.entries(value).forEach(([k, v]) => {
15
+ if (v == null) return;
16
+ const kpath = path == null ? k : `${path}.${k}`;
17
+ if (spec.hasOwnProperty(k)) {
18
+ spec[k](kpath, value, k, v, onError);
19
+ return;
20
+ }
21
+ if (k !== 'ext' && !primitiveFields.includes(k)) {
22
+ onError(ERR_UNKNOWN_FIELD, kpath, value, k, v);
23
+ }
24
+ });
25
+ };
26
+ scan[extend] = (extraPrimitives, specOverride = {}) =>
27
+ Obj(primitiveFields.concat(extraPrimitives), Object.assign({}, spec, specOverride));
28
+ return scan;
29
+ }
30
+
31
+ export const ID = Obj(['id']);
32
+ export const Named = ID[extend](['name']);
33
+
34
+ export function Arr(def) {
35
+ return (path, parent, field, value, onError) => {
36
+ if (!Array.isArray(value)) {
37
+ onError(ERR_TYPE, path, parent, field, value);
38
+ } else {
39
+ value.forEach((item, i) => def(`${path}.${i}`, value, i, item, onError));
40
+ }
41
+ };
42
+ }
43
+
44
+ export function IntEnum(min, max) {
45
+ return (path, parent, field, value, onError) => {
46
+ const errno = (() => {
47
+ if (typeof value !== 'number') return ERR_TYPE;
48
+ if (isNaN(value) || value > max || value < min) return ERR_ENUM;
49
+ })();
50
+ if (errno != null) {
51
+ onError(errno, path, parent, field, value);
52
+ }
53
+ };
54
+ }
@@ -0,0 +1,81 @@
1
+ import {Arr, extend, ID, IntEnum, Named, Obj} from './dsl.js';
2
+
3
+ const CatDomain = Named[extend](['cat', 'domain']);
4
+ const Segment = Named[extend](['value']);
5
+ const Data = Named[extend]([], {
6
+ segment: Arr(Segment)
7
+ });
8
+ const Content = ID[extend](['episode', 'title', 'series', 'season', 'artist', 'genre', 'album', 'isrc', 'url', 'cat', 'contentrating', 'userrating', 'keywords', 'livestream', 'sourcerelationship', 'len', 'language', 'embeddable'], {
9
+ producer: CatDomain,
10
+ data: Arr(Data),
11
+ prodq: IntEnum(0, 3),
12
+ videoquality: IntEnum(0, 3),
13
+ context: IntEnum(1, 7),
14
+ qagmediarating: IntEnum(1, 3),
15
+ });
16
+
17
+ const Client = CatDomain[extend](['sectioncat', 'pagecat', 'privacypolicy', 'keywords'], {
18
+ publisher: CatDomain, content: Content,
19
+ });
20
+ const Site = Client[extend](['page', 'ref', 'search', 'mobile']);
21
+ const App = Client[extend](['bundle', 'storeurl', 'ver', 'paid']);
22
+
23
+ const Geo = Obj(['lat', 'lon', 'accuracy', 'lastfix', 'country', 'region', 'regionfips104', 'metro', 'city', 'zip', 'utcoffset'], {
24
+ type: IntEnum(1, 3),
25
+ ipservice: IntEnum(1, 4)
26
+ });
27
+ const Device = Obj(['ua', 'dnt', 'lmt', 'ip', 'ipv6', 'make', 'model', 'os', 'osv', 'hwv', 'h', 'w', 'ppi', 'pxratio', 'js', 'geofetch', 'flashver', 'language', 'carrier', 'mccmnc', 'ifa', 'didsha1', 'didmd5', 'dpidsha1', 'dpidmd5', 'macsha1', 'macmd5'], {
28
+ geo: Geo, devicetype: IntEnum(1, 7), connectiontype: IntEnum(0, 6)
29
+ });
30
+ const User = ID[extend](['buyeruid', 'yob', 'gender', 'keywords', 'customdata'], {
31
+ geo: Geo, data: Arr(Data),
32
+ });
33
+
34
+ const Floorable = ID[extend](['bidfloor', 'bidfloorcur']);
35
+ const Deal = Floorable[extend](['at', 'wseat', 'wadomain']);
36
+ const Pmp = Obj(['private_auction'], {
37
+ deals: Arr(Deal),
38
+ });
39
+ const Format = Obj(['w', 'h', 'wratio', 'hratio', 'wmin']);
40
+ const MediaType = Obj(['mimes'], {
41
+ api: Arr(IntEnum(1, 6)), battr: Arr(IntEnum(1, 17))
42
+ });
43
+ const Banner = MediaType[extend](['id', 'w', 'h', 'wmax', 'hmax', 'hmin', 'wmin', 'topframe', 'vcm'], {
44
+ format: Arr(Format), btype: Arr(IntEnum(1, 4)), pos: IntEnum(0, 7), expdir: Arr(IntEnum(1, 5))
45
+ });
46
+ const Native = MediaType[extend](['request', 'ver']);
47
+ const RichMediaType = MediaType[extend](['minduration', 'maxduration', 'startdelay', 'sequence', 'maxextended', 'minbitrate', 'maxbitrate'], {
48
+ protocols: Arr(IntEnum(1, 10)),
49
+ delivery: Arr(IntEnum(1, 3)),
50
+ companionad: Arr(Banner),
51
+ companiontype: Arr(IntEnum(1, 3)),
52
+ });
53
+ /*
54
+ const Audio = RichMediaType[extend](['maxseq', 'stitched'], {
55
+ feed: IntEnum(1, 3), nvol: IntEnum(0, 4),
56
+ });
57
+ */
58
+ const Video = RichMediaType[extend](['w', 'h', 'skip', 'skipmin', 'skipafter', 'boxingallowed'], {
59
+ pos: IntEnum(0, 7),
60
+ protocol: IntEnum(1, 10),
61
+ placement: IntEnum(1, 5),
62
+ linearity: IntEnum(1, 2),
63
+ playbackmethod: Arr(IntEnum(1, 6)),
64
+ playbackend: IntEnum(1, 3),
65
+ });
66
+ const Metric = Obj(['type', 'value', 'vendor']);
67
+ const Imp = (() => {
68
+ const spec = {
69
+ metric: Arr(Metric), banner: Banner, video: Video, pmp: Pmp,
70
+ };
71
+ if (FEATURES.NATIVE) {
72
+ spec.native = Native;
73
+ }
74
+ return Floorable[extend](['displaymanager', 'displaymanagerver', 'instl', 'tagid', 'clickbrowser', 'secure', 'iframebuster', 'exp'], spec);
75
+ })();
76
+
77
+ const Regs = Obj(['coppa']);
78
+ const Source = Obj(['fd', 'tid', 'pchain']);
79
+ export const BidRequest = ID[extend](['test', 'at', 'tmax', 'wseat', 'bseat', 'allimps', 'cur', 'wlang', 'bcat', 'badv', 'bapp'], {
80
+ imp: Arr(Imp), site: Site, app: App, device: Device, user: User, source: Source, regs: Regs
81
+ });
@@ -0,0 +1,37 @@
1
+ import {BidRequest} from './spec.js';
2
+ import {logWarn} from '../../src/utils.js';
3
+ import {toOrtb25} from '../ortb2.5Translator/translator.js';
4
+
5
+ function deleteField(errno, path, obj, field, value) {
6
+ logWarn(`${path} is not valid ORTB 2.5, field will be removed from request:`, value);
7
+ Array.isArray(obj) ? obj.splice(field, 1) : delete obj[field];
8
+ }
9
+
10
+ /**
11
+ * Translates an ortb request to 2.5, and removes from the result any field that is:
12
+ * - not defined in the 2.5 spec, or
13
+ * - defined as an enum, but has a value that is not listed in the 2.5 spec.
14
+ *
15
+ * `ortb2` is modified in place and returned.
16
+ *
17
+ * Note that using this utility will cause your adapter to pull in an additional ~3KB after minification.
18
+ * If possible, consider making your endpoint tolerant to unrecognized or invalid fields instead.
19
+ *
20
+ *
21
+ * @param ortb2 ORTB request
22
+ * @param translator translation function. The default moves 2.x fields that have a known standard location in 2.5.
23
+ * See the `ortb2.5Translator` library.
24
+ * @param onError a function invoked once for each field that is not valid according to the 2.5 spec; it takes
25
+ * (errno, path, obj, field, value), where:
26
+ * - errno is an error code (defined in dsl.js)
27
+ * - path is the JSON path of the offending field, for example `regs.gdpr`
28
+ * - obj is the object containing the offending field, for example `ortb2.regs`
29
+ * - field is the field name, for example `'gdpr'`
30
+ * - value is `obj[field]`.
31
+ * The default logs a warning and deletes the offending field.
32
+ */
33
+ export function toOrtb25Strict(ortb2, translator = toOrtb25, onError = deleteField) {
34
+ ortb2 = translator(ortb2);
35
+ BidRequest(null, null, null, ortb2, onError);
36
+ return ortb2;
37
+ }
@@ -0,0 +1,82 @@
1
+ import {deepAccess, deepSetValue, logError} from '../../src/utils.js';
2
+
3
+ export const EXT_PROMOTIONS = [
4
+ 'source.schain',
5
+ 'regs.gdpr',
6
+ 'regs.us_privacy',
7
+ 'regs.gpp',
8
+ 'user.consent',
9
+ 'user.eids'
10
+ ];
11
+
12
+ export function splitPath(path) {
13
+ const parts = path.split('.');
14
+ const prefix = parts.slice(0, parts.length - 1).join('.');
15
+ const field = parts[parts.length - 1];
16
+ return [prefix, field];
17
+ }
18
+
19
+ /**
20
+ * @param sourcePath a JSON path such as `regs.us_privacy`
21
+ * @param dest {function(String, String): String} a function taking (prefix, field) and returning a destination path;
22
+ * for example, ('regs', 'us_privacy') => 'regs.ext.us_privacy'
23
+ * @return {(function({}): (function(): void|undefined))|*} a function that takes an object and, if it contains
24
+ * sourcePath, copies its contents to destinationPath, returning a function that deletes the original sourcePath.
25
+ */
26
+ export function moveRule(sourcePath, dest = (prefix, field) => `${prefix}.ext.${field}`) {
27
+ const [prefix, field] = splitPath(sourcePath);
28
+ dest = dest(prefix, field);
29
+ return (ortb2) => {
30
+ const obj = deepAccess(ortb2, prefix);
31
+ if (obj?.[field] != null) {
32
+ deepSetValue(ortb2, dest, obj[field]);
33
+ return () => delete obj[field];
34
+ }
35
+ };
36
+ }
37
+
38
+ function kwarrayRule(section) {
39
+ // move 2.6 `kwarray` into 2.5 comma-separated `keywords`.
40
+ return (ortb2) => {
41
+ const kwarray = ortb2[section]?.kwarray;
42
+ if (kwarray != null) {
43
+ let kw = (ortb2[section].keywords || '').split(',');
44
+ if (Array.isArray(kwarray)) kw.push(...kwarray);
45
+ ortb2[section].keywords = kw.join(',');
46
+ return () => delete ortb2[section].kwarray;
47
+ }
48
+ };
49
+ }
50
+
51
+ export const DEFAULT_RULES = Object.freeze([
52
+ ...EXT_PROMOTIONS.map((f) => moveRule(f)),
53
+ ...['app', 'content', 'site', 'user'].map(kwarrayRule)
54
+ ]);
55
+
56
+ /**
57
+ * Factory for ORTB 2.5 translation functions.
58
+ *
59
+ * @param deleteFields if true, the translation function will remove fields that have been translated (transferred somewhere else within the request)
60
+ * @param rules translation rules; an array of functions of the type returned by `moveRule`
61
+ * @return {function({}): {}} a translation function that takes an ORTB object, modifies it in place, and returns it.
62
+ */
63
+ export function ortb25Translator(deleteFields = true, rules = DEFAULT_RULES) {
64
+ return function (ortb2) {
65
+ rules.forEach(f => {
66
+ try {
67
+ const deleter = f(ortb2);
68
+ if (typeof deleter === 'function' && deleteFields) deleter();
69
+ } catch (e) {
70
+ logError('Error translating request to ORTB 2.5', e);
71
+ }
72
+ })
73
+ return ortb2;
74
+ }
75
+ }
76
+
77
+ /**
78
+ * Translate an ortb request to version 2.5 by moving 2.6 (and later) fields that have a standardized 2.5 extension.
79
+ *
80
+ * The request is modified in place and returned.
81
+ */
82
+ export const toOrtb25 = ortb25Translator();
@@ -13,6 +13,7 @@ import { uspDataHandler } from '../src/adapterManager.js';
13
13
  const MODULE_NAME = '33acrossId';
14
14
  const API_URL = 'https://lexicon.33across.com/v1/envelope';
15
15
  const AJAX_TIMEOUT = 10000;
16
+ const CALLER_NAME = 'pbjs';
16
17
 
17
18
  function getEnvelope(response) {
18
19
  if (!response.succeeded) {
@@ -36,6 +37,8 @@ function calculateQueryStringParams(pid, gdprConsentData) {
36
37
  const params = {
37
38
  pid,
38
39
  gdpr: Number(gdprApplies),
40
+ src: CALLER_NAME,
41
+ ver: '$prebid.version$'
39
42
  };
40
43
 
41
44
  if (uspString) {