prebid.js 7.22.0 → 7.24.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 (314) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/aaxBlockmeterRtdProvider.js +1 -0
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/admaticBidAdapter.js +1 -0
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adtrgtmeBidAdapter.js +1 -1
  9. package/dist/adxcgBidAdapter.js +1 -1
  10. package/dist/adyoulikeBidAdapter.js +1 -1
  11. package/dist/ajaBidAdapter.js +1 -1
  12. package/dist/amxBidAdapter.js +1 -1
  13. package/dist/amxIdSystem.js +1 -1
  14. package/dist/analyticsAdapter.js +1 -1
  15. package/dist/appierAnalyticsAdapter.js +1 -1
  16. package/dist/appnexusBidAdapter.js +1 -1
  17. package/dist/asoBidAdapter.js +1 -1
  18. package/dist/audiencerunBidAdapter.js +1 -1
  19. package/dist/axonixBidAdapter.js +1 -1
  20. package/dist/bidViewability.js +1 -1
  21. package/dist/bidViewabilityIO.js +1 -1
  22. package/dist/bidglassBidAdapter.js +1 -1
  23. package/dist/big-richmediaBidAdapter.js +1 -1
  24. package/dist/bluebillywigBidAdapter.js +1 -1
  25. package/dist/bridgewellBidAdapter.js +1 -1
  26. package/dist/brightMountainMediaBidAdapter.js +1 -1
  27. package/dist/browsiRtdProvider.js +1 -1
  28. package/dist/carodaBidAdapter.js +1 -1
  29. package/dist/chtnwBidAdapter.js +1 -0
  30. package/dist/cleanioRtdProvider.js +1 -1
  31. package/dist/concertBidAdapter.js +1 -1
  32. package/dist/connectIdSystem.js +1 -1
  33. package/dist/connectadBidAdapter.js +1 -1
  34. package/dist/consentManagement.js +1 -1
  35. package/dist/consentManagementUsp.js +1 -1
  36. package/dist/consumableBidAdapter.js +1 -1
  37. package/dist/conversantBidAdapter.js +1 -1
  38. package/dist/craftBidAdapter.js +1 -1
  39. package/dist/criteoBidAdapter.js +1 -1
  40. package/dist/currency.js +1 -1
  41. package/dist/dependencies.json +19 -0
  42. package/dist/dfpAdServerVideo.js +1 -1
  43. package/dist/dgkeywordRtdProvider.js +1 -1
  44. package/dist/dspxBidAdapter.js +1 -1
  45. package/dist/eplanningBidAdapter.js +1 -1
  46. package/dist/finativeBidAdapter.js +1 -1
  47. package/dist/gdprEnforcement.js +1 -1
  48. package/dist/glimpseBidAdapter.js +1 -1
  49. package/dist/gmosspBidAdapter.js +1 -1
  50. package/dist/goldbachBidAdapter.js +1 -1
  51. package/dist/googleAnalyticsAdapter.js +1 -1
  52. package/dist/gridBidAdapter.js +1 -1
  53. package/dist/gridNMBidAdapter.js +1 -1
  54. package/dist/growthCodeIdSystem.js +1 -1
  55. package/dist/gumgumBidAdapter.js +1 -1
  56. package/dist/h12mediaBidAdapter.js +1 -1
  57. package/dist/id5AnalyticsAdapter.js +1 -1
  58. package/dist/id5IdSystem.js +1 -1
  59. package/dist/impactifyBidAdapter.js +1 -1
  60. package/dist/improvedigitalBidAdapter.js +1 -1
  61. package/dist/inmarBidAdapter.js +1 -1
  62. package/dist/insticatorBidAdapter.js +1 -1
  63. package/dist/instreamTracking.js +1 -1
  64. package/dist/ixBidAdapter.js +1 -1
  65. package/dist/jixieBidAdapter.js +1 -1
  66. package/dist/justpremiumBidAdapter.js +1 -1
  67. package/dist/jwplayerVideoProvider.js +1 -0
  68. package/dist/kargoBidAdapter.js +1 -1
  69. package/dist/konduitAnalyticsAdapter.js +1 -1
  70. package/dist/kueezBidAdapter.js +1 -1
  71. package/dist/kueezRtbBidAdapter.js +1 -0
  72. package/dist/lassoBidAdapter.js +1 -1
  73. package/dist/lifestreetBidAdapter.js +1 -1
  74. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  75. package/dist/logicadBidAdapter.js +1 -1
  76. package/dist/loglyliftBidAdapter.js +1 -1
  77. package/dist/magniteAnalyticsAdapter.js +1 -1
  78. package/dist/malltvAnalyticsAdapter.js +1 -1
  79. package/dist/marsmediaBidAdapter.js +1 -1
  80. package/dist/mediafuseBidAdapter.js +1 -1
  81. package/dist/mediakeysBidAdapter.js +1 -1
  82. package/dist/mediasquareBidAdapter.js +1 -1
  83. package/dist/mgidBidAdapter.js +1 -1
  84. package/dist/mgidRtdProvider.js +1 -0
  85. package/dist/minutemediaBidAdapter.js +1 -1
  86. package/dist/multibid.js +1 -1
  87. package/dist/not-for-prod/prebid.js +153 -141
  88. package/dist/oguryBidAdapter.js +1 -1
  89. package/dist/onetagBidAdapter.js +1 -1
  90. package/dist/ooloAnalyticsAdapter.js +1 -1
  91. package/dist/openxOrtbBidAdapter.js +1 -1
  92. package/dist/ortbConverter.js +1 -0
  93. package/dist/outbrainBidAdapter.js +1 -1
  94. package/dist/oxxionRtdProvider.js +1 -0
  95. package/dist/parrableIdSystem.js +1 -1
  96. package/dist/pbsExtensions.js +1 -0
  97. package/dist/permutiveRtdProvider.js +1 -1
  98. package/dist/pixfutureBidAdapter.js +1 -1
  99. package/dist/prebid-core.js +1 -1
  100. package/dist/prebidServerBidAdapter.js +1 -1
  101. package/dist/priceFloors.js +1 -1
  102. package/dist/pubCommonId.js +1 -1
  103. package/dist/publinkIdSystem.js +1 -1
  104. package/dist/pubmaticBidAdapter.js +1 -1
  105. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  106. package/dist/pxyzBidAdapter.js +1 -1
  107. package/dist/quantcastBidAdapter.js +1 -1
  108. package/dist/readpeakBidAdapter.js +1 -1
  109. package/dist/relaidoBidAdapter.js +1 -1
  110. package/dist/rhythmoneBidAdapter.js +1 -1
  111. package/dist/riseBidAdapter.js +1 -1
  112. package/dist/rtdModule.js +1 -1
  113. package/dist/rubiconAnalyticsAdapter.js +1 -1
  114. package/dist/rubiconBidAdapter.js +1 -1
  115. package/dist/schain.js +1 -1
  116. package/dist/seedingAllianceBidAdapter.js +1 -1
  117. package/dist/seedtagBidAdapter.js +1 -1
  118. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  119. package/dist/sharethroughBidAdapter.js +1 -1
  120. package/dist/shinezBidAdapter.js +1 -1
  121. package/dist/smaatoBidAdapter.js +1 -1
  122. package/dist/smartadserverBidAdapter.js +1 -1
  123. package/dist/smartxBidAdapter.js +1 -1
  124. package/dist/smilewantedBidAdapter.js +1 -1
  125. package/dist/sonobiBidAdapter.js +1 -1
  126. package/dist/sovrnAnalyticsAdapter.js +1 -1
  127. package/dist/sovrnBidAdapter.js +1 -1
  128. package/dist/spotxBidAdapter.js +1 -1
  129. package/dist/sspBCBidAdapter.js +1 -1
  130. package/dist/sublimeBidAdapter.js +1 -1
  131. package/dist/synacormediaBidAdapter.js +1 -1
  132. package/dist/targetVideoBidAdapter.js +1 -1
  133. package/dist/teadsBidAdapter.js +1 -1
  134. package/dist/teadsIdSystem.js +1 -1
  135. package/dist/trionBidAdapter.js +1 -1
  136. package/dist/tripleliftBidAdapter.js +1 -1
  137. package/dist/ttdBidAdapter.js +1 -1
  138. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  139. package/dist/underdogmediaBidAdapter.js +1 -1
  140. package/dist/undertoneBidAdapter.js +1 -1
  141. package/dist/userId.js +1 -1
  142. package/dist/vidazooBidAdapter.js +1 -1
  143. package/dist/video.js +1 -0
  144. package/dist/videoModule.js +1 -0
  145. package/dist/videobyteBidAdapter.js +1 -1
  146. package/dist/videojsVideoProvider.js +1 -0
  147. package/dist/visxBidAdapter.js +1 -1
  148. package/dist/vuukleBidAdapter.js +1 -1
  149. package/dist/widespaceBidAdapter.js +1 -1
  150. package/dist/winrBidAdapter.js +1 -1
  151. package/dist/yahoosspBidAdapter.js +1 -1
  152. package/dist/yieldmoBidAdapter.js +1 -1
  153. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  154. package/integrationExamples/gpt/mgidRtdProvider_example.html +143 -0
  155. package/integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html +98 -0
  156. package/integrationExamples/videoModule/jwplayer/bidRequestScheduling.html +89 -0
  157. package/integrationExamples/videoModule/jwplayer/eventListeners.html +244 -0
  158. package/integrationExamples/videoModule/jwplayer/gamAdServerMediation.html +122 -0
  159. package/integrationExamples/videoModule/jwplayer/mediaMetadata.html +80 -0
  160. package/integrationExamples/videoModule/jwplayer/playlist.html +122 -0
  161. package/integrationExamples/videoModule/videojs/bidMarkedAsUsed.html +126 -0
  162. package/integrationExamples/videoModule/videojs/bidRequestScheduling.html +132 -0
  163. package/integrationExamples/videoModule/videojs/eventListeners.html +238 -0
  164. package/integrationExamples/videoModule/videojs/gamAdServerMediation.html +138 -0
  165. package/integrationExamples/videoModule/videojs/mediaMetadata.html +103 -0
  166. package/integrationExamples/videoModule/videojs/playlist.html +151 -0
  167. package/libraries/ortbConverter/README.md +378 -0
  168. package/libraries/ortbConverter/converter.js +135 -0
  169. package/libraries/ortbConverter/lib/composer.js +43 -0
  170. package/libraries/ortbConverter/lib/mergeProcessors.js +9 -0
  171. package/libraries/ortbConverter/lib/sizes.js +14 -0
  172. package/libraries/ortbConverter/processors/banner.js +40 -0
  173. package/libraries/ortbConverter/processors/default.js +167 -0
  174. package/libraries/ortbConverter/processors/mediaType.js +21 -0
  175. package/libraries/ortbConverter/processors/native.js +37 -0
  176. package/libraries/ortbConverter/processors/video.js +66 -0
  177. package/libraries/pbsExtensions/pbsExtensions.js +12 -0
  178. package/libraries/pbsExtensions/processors/aliases.js +17 -0
  179. package/libraries/pbsExtensions/processors/mediaType.js +23 -0
  180. package/libraries/pbsExtensions/processors/params.js +22 -0
  181. package/libraries/pbsExtensions/processors/pbs.js +99 -0
  182. package/libraries/pbsExtensions/processors/requestExtPrebid.js +30 -0
  183. package/libraries/pbsExtensions/processors/video.js +23 -0
  184. package/libraries/video/constants/enums.js +5 -0
  185. package/libraries/video/constants/events.js +97 -0
  186. package/libraries/video/constants/ortb.js +169 -0
  187. package/libraries/video/constants/vendorCodes.js +6 -0
  188. package/libraries/video/shared/eventHandler.js +18 -0
  189. package/libraries/video/shared/parentModule.js +82 -0
  190. package/libraries/video/shared/state.js +47 -0
  191. package/libraries/video/shared/vastXmlBuilder.js +77 -0
  192. package/libraries/video/shared/vastXmlEditor.js +115 -0
  193. package/modules/.submodules.json +7 -1
  194. package/modules/aaxBlockmeterRtdProvider.js +59 -0
  195. package/modules/aaxBlockmeterRtdProvider.md +48 -0
  196. package/modules/admaticBidAdapter.js +147 -0
  197. package/modules/admaticBidAdapter.md +48 -0
  198. package/modules/amxBidAdapter.js +1 -0
  199. package/modules/appnexusBidAdapter.js +38 -1
  200. package/modules/chtnwBidAdapter.js +110 -0
  201. package/modules/chtnwBidAdapter.md +31 -0
  202. package/modules/concertBidAdapter.js +44 -2
  203. package/modules/connectIdSystem.js +36 -23
  204. package/modules/connectIdSystem.md +3 -2
  205. package/modules/consentManagement.js +22 -1
  206. package/modules/consentManagementUsp.js +29 -7
  207. package/modules/criteoBidAdapter.js +25 -5
  208. package/modules/currency.js +9 -0
  209. package/modules/dgkeywordRtdProvider.js +3 -3
  210. package/modules/gridNMBidAdapter.js +10 -14
  211. package/modules/growthCodeIdSystem.js +9 -5
  212. package/modules/gumgumBidAdapter.js +4 -0
  213. package/modules/improvedigitalBidAdapter.js +191 -470
  214. package/modules/ixBidAdapter.js +54 -71
  215. package/modules/jwplayerVideoProvider.js +929 -0
  216. package/modules/jwplayerVideoProvider.md +25 -0
  217. package/modules/kargoBidAdapter.js +1 -1
  218. package/modules/kueezRtbBidAdapter.js +278 -0
  219. package/modules/kueezRtbBidAdapter.md +35 -0
  220. package/modules/magniteAnalyticsAdapter.js +6 -1
  221. package/modules/mgidRtdProvider.js +190 -0
  222. package/modules/mgidRtdProvider.md +51 -0
  223. package/modules/multibid/index.js +12 -0
  224. package/modules/openxOrtbBidAdapter.js +120 -275
  225. package/modules/oxxionRtdProvider.js +119 -0
  226. package/modules/oxxionRtdProvider.md +48 -0
  227. package/modules/permutiveRtdProvider.js +2 -1
  228. package/modules/permutiveRtdProvider.md +36 -1
  229. package/modules/prebidServerBidAdapter/index.js +19 -716
  230. package/modules/prebidServerBidAdapter/ortbConverter.js +274 -0
  231. package/modules/priceFloors.js +73 -1
  232. package/modules/pubmaticBidAdapter.js +21 -29
  233. package/modules/rtdModule/index.js +22 -1
  234. package/modules/schain.js +24 -1
  235. package/modules/spotxBidAdapter.js +16 -15
  236. package/modules/synacormediaBidAdapter.js +1 -1
  237. package/modules/teadsIdSystem.js +5 -0
  238. package/modules/tripleliftBidAdapter.js +1 -1
  239. package/modules/userId/eids.js +3 -10
  240. package/modules/userId/index.js +64 -6
  241. package/modules/videoModule/addingSubmodule.md +521 -0
  242. package/modules/videoModule/coreVideo.js +234 -0
  243. package/modules/videoModule/gamAdServerSubmodule.js +27 -0
  244. package/modules/videoModule/index.js +244 -0
  245. package/modules/videoModule/videoImpressionVerifier.js +206 -0
  246. package/modules/videojsVideoProvider.js +854 -0
  247. package/modules/videojsVideoProvider.md +17 -0
  248. package/package.json +12 -8
  249. package/src/adRendering.js +1 -1
  250. package/src/adapterManager.js +56 -7
  251. package/src/adloader.js +3 -1
  252. package/src/auction.js +6 -1
  253. package/src/events.js +5 -1
  254. package/src/pbjsORTB.js +35 -0
  255. package/src/prebid.js +137 -112
  256. package/src/targeting.js +10 -2
  257. package/src/utils/currency.js +16 -0
  258. package/src/utils.js +21 -0
  259. package/test/spec/auctionmanager_spec.js +15 -0
  260. package/test/spec/modules/aaxBlockmeter_spec.js +58 -0
  261. package/test/spec/modules/admaticBidAdapter_spec.js +46 -0
  262. package/test/spec/modules/chtnwBidAdapter_spec.js +105 -0
  263. package/test/spec/modules/concertBidAdapter_spec.js +56 -0
  264. package/test/spec/modules/connectIdSystem_spec.js +175 -5
  265. package/test/spec/modules/consentManagementUsp_spec.js +64 -18
  266. package/test/spec/modules/criteoBidAdapter_spec.js +28 -0
  267. package/test/spec/modules/dgkeywordRtdProvider_spec.js +3 -3
  268. package/test/spec/modules/eids_spec.js +10 -7
  269. package/test/spec/modules/ftrackIdSystem_spec.js +34 -22
  270. package/test/spec/modules/gumgumBidAdapter_spec.js +15 -0
  271. package/test/spec/modules/improvedigitalBidAdapter_spec.js +231 -211
  272. package/test/spec/modules/ixBidAdapter_spec.js +412 -350
  273. package/test/spec/modules/kueezRtbBidAdapter_spec.js +396 -0
  274. package/test/spec/modules/magniteAnalyticsAdapter_spec.js +26 -0
  275. package/test/spec/modules/mgidRtdProvider_spec.js +366 -0
  276. package/test/spec/modules/openxOrtbBidAdapter_spec.js +77 -49
  277. package/test/spec/modules/oxxionRtdProvider_spec.js +142 -0
  278. package/test/spec/modules/permutiveRtdProvider_spec.js +64 -5
  279. package/test/spec/modules/prebidServerBidAdapter_spec.js +139 -137
  280. package/test/spec/modules/realTimeDataModule_spec.js +65 -0
  281. package/test/spec/modules/tripleliftBidAdapter_spec.js +14 -0
  282. package/test/spec/modules/userId_spec.js +67 -1
  283. package/test/spec/modules/videoModule/coreVideo_spec.js +98 -0
  284. package/test/spec/modules/videoModule/pbVideo_spec.js +362 -0
  285. package/test/spec/modules/videoModule/shared/parentModule_spec.js +73 -0
  286. package/test/spec/modules/videoModule/shared/state_spec.js +26 -0
  287. package/test/spec/modules/videoModule/shared/vastXmlBuilder_spec.js +103 -0
  288. package/test/spec/modules/videoModule/shared/vastXmlEditor_spec.js +209 -0
  289. package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +846 -0
  290. package/test/spec/modules/videoModule/submodules/videojsVideoProvider_spec.js +391 -0
  291. package/test/spec/modules/videoModule/videoImpressionVerifier_spec.js +112 -0
  292. package/test/spec/ortbConverter/banner_spec.js +203 -0
  293. package/test/spec/ortbConverter/composer_spec.js +69 -0
  294. package/test/spec/ortbConverter/converter_spec.js +283 -0
  295. package/test/spec/ortbConverter/currency_spec.js +40 -0
  296. package/test/spec/ortbConverter/default_processors_spec.js +61 -0
  297. package/test/spec/ortbConverter/gdpr_spec.js +38 -0
  298. package/test/spec/ortbConverter/mediaTypes_spec.js +67 -0
  299. package/test/spec/ortbConverter/mergeProcessors_spec.js +59 -0
  300. package/test/spec/ortbConverter/multibid_spec.js +35 -0
  301. package/test/spec/ortbConverter/native_spec.js +95 -0
  302. package/test/spec/ortbConverter/pbjsORTB_spec.js +67 -0
  303. package/test/spec/ortbConverter/pbsExtensions/aliases_spec.js +57 -0
  304. package/test/spec/ortbConverter/pbsExtensions/params_spec.js +96 -0
  305. package/test/spec/ortbConverter/pbsExtensions/video_spec.js +52 -0
  306. package/test/spec/ortbConverter/priceFloors_spec.js +143 -0
  307. package/test/spec/ortbConverter/schain_spec.js +33 -0
  308. package/test/spec/ortbConverter/userId_spec.js +21 -0
  309. package/test/spec/ortbConverter/usp_spec.js +15 -0
  310. package/test/spec/ortbConverter/video_spec.js +189 -0
  311. package/test/spec/unit/core/adapterManager_spec.js +102 -0
  312. package/test/spec/unit/core/targeting_spec.js +34 -0
  313. package/test/spec/unit/pbjs_api_spec.js +124 -45
  314. package/test/spec/utils_spec.js +45 -1
@@ -0,0 +1,48 @@
1
+ ## Overview
2
+
3
+ Module Name: AAX Blockmeter Realtime Data Module
4
+ Module Type: Rtd Provider
5
+ Maintainer: product@aax.media
6
+
7
+ ## Description
8
+
9
+ The module enables publishers to measure traffic coming from visitors using adblockers.
10
+
11
+ AAX can also help publishers monetize this traffic by allowing them to serve [acceptable ads](https://acceptableads.com/about/) to these adblock visitors and recover their lost revenue. [Reach out to us](https://www.aax.media/try-blockmeter/) to know more.
12
+
13
+ ## Integration
14
+
15
+ Build the AAX Blockmeter Realtime Data Module into the Prebid.js package with:
16
+
17
+ ```
18
+ gulp build --modules=aaxBlockmeterRtdProvider,rtdModule
19
+ ```
20
+
21
+ ## Configuration
22
+
23
+ This module is configured as part of the `realTimeData.dataProviders` object.
24
+
25
+ | Name | Scope | Description | Example | Type |
26
+ |:----------:|:--------:|:-----------------------------|:---------------:|:------:|
27
+ | `name` | required | Real time data module name | `'aaxBlockmeter'` | `string` |
28
+ | `params` | required | | | `Object` |
29
+ | `params.pub` | required | AAX to share pub ID, [Reach out to us](https://www.aax.media/try-blockmeter/) to know more! | `'AAX00000'` | `string` |
30
+ | `params.url` | optional | AAX Blockmeter Script Url. Defaults to `'c.aaxads.com/aax.js?ver=1.2'` | `'c.aaxads.com/aax.js?ver=1.2'` | `string` |
31
+
32
+ ### Example
33
+
34
+ ```javascript
35
+ pbjs.setConfig({
36
+ "realTimeData": {
37
+ "dataProviders": [
38
+ {
39
+ "name": "aaxBlockmeter",
40
+ "params": {
41
+ "pub": "AAX00000",
42
+ "url": "c.aaxads.com/aax.js?ver=1.2",
43
+ }
44
+ }
45
+ ]
46
+ }
47
+ })
48
+ ```
@@ -0,0 +1,147 @@
1
+ import { getValue, logError, deepAccess, getBidIdParameter, isArray } from '../src/utils.js';
2
+ import { loadExternalScript } from '../src/adloader.js';
3
+ import {registerBidder} from '../src/adapters/bidderFactory.js';
4
+
5
+ const ENDPOINT_URL = 'https://layer.serve.admatic.com.tr/pb';
6
+ const SYNC_URL = 'https://cdn.serve.admatic.com.tr/showad/sync.js';
7
+ const BIDDER_CODE = 'admatic';
8
+
9
+ export const spec = {
10
+ code: 'admatic',
11
+ supportedMediaTypes: ['video', 'banner'],
12
+ /**
13
+ * Determines whether or not the given bid request is valid.
14
+ *
15
+ * @param {BidRequest} bid The bid params to validate.
16
+ * @return boolean True if this is a valid bid, and false otherwise.
17
+ */
18
+ isBidRequestValid: function(bid) {
19
+ let isValid = false;
20
+ if (typeof bid.params !== 'undefined') {
21
+ let isValidNetworkId = _validateId(getValue(bid.params, 'networkId'));
22
+ isValid = isValidNetworkId;// && isValidTypeId;
23
+ }
24
+
25
+ if (!isValid) {
26
+ logError('AdMatic networkId parameters are required. Bid aborted.');
27
+ }
28
+ return isValid;
29
+ },
30
+ /**
31
+ * Make a server request from the list of BidRequests.
32
+ *
33
+ * @param {validBidRequests[]} an array of bids
34
+ * @return ServerRequest Info describing the request to the server.
35
+ */
36
+ buildRequests: function(validBidRequests, bidderRequest) {
37
+ const bids = validBidRequests.map(buildRequestObject);
38
+ const networkId = getValue(validBidRequests[0].params, 'networkId');
39
+ const currency = getValue(validBidRequests[0].params, 'currency') || 'TRY';
40
+
41
+ setTimeout(() => {
42
+ loadExternalScript(SYNC_URL, BIDDER_CODE);
43
+ }, bidderRequest.timeout);
44
+
45
+ const payload = {
46
+ 'user': {
47
+ 'ua': navigator.userAgent
48
+ },
49
+ 'blacklist': [],
50
+ 'site': {
51
+ 'page': location.href,
52
+ 'ref': location.origin,
53
+ 'publisher': {
54
+ 'name': location.hostname,
55
+ 'publisherId': networkId
56
+ }
57
+ },
58
+ imp: bids,
59
+ ext: {
60
+ 'cur': currency,
61
+ 'type': 'admatic'
62
+ }
63
+ };
64
+
65
+ const payloadString = JSON.stringify(payload);
66
+ return {
67
+ method: 'POST',
68
+ url: ENDPOINT_URL,
69
+ data: payloadString,
70
+ options: {
71
+ contentType: 'application/json'
72
+ }
73
+ };
74
+ },
75
+ /**
76
+ * Unpack the response from the server into a list of bids.
77
+ *
78
+ * @param {*} serverResponse A successful response from the server.
79
+ * @return {Bid[]} An array of bids which were nested inside the server.
80
+ */
81
+ interpretResponse: (response, request) => {
82
+ const body = response.body || response;
83
+ const bidResponses = [];
84
+ if (body.data.length > 0) {
85
+ body.data.forEach(function (bid) {
86
+ const resbid = {
87
+ requestId: bid.id,
88
+ cpm: bid.price,
89
+ width: bid.width,
90
+ height: bid.height,
91
+ currency: body.cur,
92
+ netRevenue: true,
93
+ ad: bid.party_tag,
94
+ creativeId: bid.creative_id,
95
+ meta: {
96
+ advertiserDomains: bid && bid.adomain ? bid.adomain : []
97
+ },
98
+ ttl: 360,
99
+ bidder: 'admatic',
100
+ timeToRespond: 1,
101
+ requestTimestamp: 1
102
+ };
103
+ bidResponses.push(resbid);
104
+ });
105
+ };
106
+ return bidResponses;
107
+ }
108
+ };
109
+
110
+ function buildRequestObject(bid) {
111
+ const reqObj = {};
112
+ reqObj.size = getSizes(bid);
113
+ reqObj.id = getBidIdParameter('bidId', bid);
114
+ reqObj.floor = getValue(bid.params, 'floor') || 0.01;
115
+ return reqObj;
116
+ }
117
+
118
+ function getSizes(bid) {
119
+ return concatSizes(bid);
120
+ }
121
+
122
+ function concatSizes(bid) {
123
+ let playerSize = deepAccess(bid, 'mediaTypes.video.playerSize');
124
+ let videoSizes = deepAccess(bid, 'mediaTypes.video.sizes');
125
+ let bannerSizes = deepAccess(bid, 'mediaTypes.banner.sizes');
126
+
127
+ if (isArray(bannerSizes) || isArray(playerSize) || isArray(videoSizes)) {
128
+ let mediaTypesSizes = [bannerSizes, videoSizes, playerSize];
129
+ return mediaTypesSizes
130
+ .reduce(function(acc, currSize) {
131
+ if (isArray(currSize)) {
132
+ if (isArray(currSize[0])) {
133
+ currSize.forEach(function (childSize) {
134
+ acc.push({ w: childSize[0], h: childSize[1] });
135
+ })
136
+ }
137
+ }
138
+ return acc;
139
+ }, []);
140
+ }
141
+ }
142
+
143
+ function _validateId(id) {
144
+ return (parseInt(id) > 0);
145
+ }
146
+
147
+ registerBidder(spec);
@@ -0,0 +1,48 @@
1
+ # Overview
2
+
3
+ **Module Name**: Admatic Bidder Adapter
4
+ **Module Type**: Bidder Adapter
5
+ **Maintainer**: prebid@admatic.com.tr
6
+
7
+ # Description
8
+
9
+ Use `admatic` as bidder.
10
+
11
+ `networkId` is required and must be integer.
12
+
13
+ ## AdUnits configuration example
14
+ ```
15
+ var adUnits = [{
16
+ code: 'your-slot_1-div', //use exactly the same code as your slot div id.
17
+ sizes: [[300, 250]],
18
+ bids: [{
19
+ bidder: 'admatic',
20
+ params: {
21
+ networkId: 12345,
22
+ floor: 0.5
23
+ }
24
+ }]
25
+ },{
26
+ code: 'your-slot_2-div', //use exactly the same code as your slot div id.
27
+ sizes: [[600, 800]],
28
+ bids: [{
29
+ bidder: 'admatic',
30
+ params: {
31
+ networkId: 12345,
32
+ floor: 0.5
33
+ }
34
+ }]
35
+ }];
36
+ ```
37
+
38
+ ## UserSync example
39
+
40
+ ```
41
+ pbjs.setConfig({
42
+ userSync: {
43
+ iframeEnabled: true,
44
+ syncEnabled: true,
45
+ syncDelay: 1
46
+ }
47
+ });
48
+ ```
@@ -207,6 +207,7 @@ const isTrue = (boolValue) =>
207
207
 
208
208
  export const spec = {
209
209
  code: BIDDER_CODE,
210
+ gvlid: 737,
210
211
  supportedMediaTypes: [BANNER, VIDEO],
211
212
 
212
213
  isBidRequestValid(bid) {
@@ -43,7 +43,7 @@ const URL = 'https://ib.adnxs.com/ut/v3/prebid';
43
43
  const URL_SIMPLE = 'https://ib.adnxs-simple.com/ut/v3/prebid';
44
44
  const VIDEO_TARGETING = ['id', 'minduration', 'maxduration',
45
45
  'skippable', 'playback_method', 'frameworks', 'context', 'skipoffset'];
46
- const VIDEO_RTB_TARGETING = ['minduration', 'maxduration', 'skip', 'skipafter', 'playbackmethod', 'api'];
46
+ const VIDEO_RTB_TARGETING = ['minduration', 'maxduration', 'skip', 'skipafter', 'playbackmethod', 'api', 'startdelay'];
47
47
  const USER_PARAMS = ['age', 'externalUid', 'segments', 'gender', 'dnt', 'language'];
48
48
  const APP_DEVICE_PARAMS = ['geo', 'device_id']; // appid is collected separately
49
49
  const DEBUG_PARAMS = ['enabled', 'dongle', 'member_id', 'debug_timeout'];
@@ -920,6 +920,17 @@ function bidToTag(bid) {
920
920
  tag['video_frameworks'] = apiTmp;
921
921
  }
922
922
  break;
923
+
924
+ case 'startdelay':
925
+ case 'placement':
926
+ const contextKey = 'context';
927
+ if (typeof tag.video[contextKey] !== 'number') {
928
+ const placement = videoMediaType['placement'];
929
+ const startdelay = videoMediaType['startdelay'];
930
+ const context = getContextFromPlacement(placement) || getContextFromStartDelay(startdelay);
931
+ tag.video[contextKey] = VIDEO_MAPPING[contextKey][context];
932
+ }
933
+ break;
923
934
  }
924
935
  });
925
936
  }
@@ -967,6 +978,32 @@ function transformSizes(requestSizes) {
967
978
  return sizes;
968
979
  }
969
980
 
981
+ function getContextFromPlacement(ortbPlacement) {
982
+ if (!ortbPlacement) {
983
+ return;
984
+ }
985
+
986
+ if (ortbPlacement === 2) {
987
+ return 'in-banner';
988
+ } else if (ortbPlacement > 2) {
989
+ return 'outstream';
990
+ }
991
+ }
992
+
993
+ function getContextFromStartDelay(ortbStartDelay) {
994
+ if (!ortbStartDelay) {
995
+ return;
996
+ }
997
+
998
+ if (ortbStartDelay === 0) {
999
+ return 'pre_roll';
1000
+ } else if (ortbStartDelay === -1) {
1001
+ return 'mid_roll';
1002
+ } else if (ortbStartDelay === -2) {
1003
+ return 'post_roll';
1004
+ }
1005
+ }
1006
+
970
1007
  function hasUserInfo(bid) {
971
1008
  return !!bid.params.user;
972
1009
  }
@@ -0,0 +1,110 @@
1
+ import {
2
+ generateUUID,
3
+ getDNT,
4
+ _each,
5
+ } from '../src/utils.js';
6
+ import { config } from '../src/config.js';
7
+ import { registerBidder } from '../src/adapters/bidderFactory.js';
8
+ import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
9
+ import { getStorageManager } from '../src/storageManager.js';
10
+ import { ajax } from '../src/ajax.js';
11
+ import {BANNER, VIDEO, NATIVE} from '../src/mediaTypes.js';
12
+ const ENDPOINT_URL = 'https://prebid.cht.hinet.net/api/v1';
13
+ const BIDDER_CODE = 'chtnw';
14
+ const COOKIE_NAME = '__htid';
15
+ const storage = getStorageManager({bidderCode: BIDDER_CODE});
16
+
17
+ const { getConfig } = config;
18
+
19
+ function _isMobile() {
20
+ return (/(ios|ipod|ipad|iphone|android)/i).test(navigator.userAgent);
21
+ }
22
+
23
+ export const spec = {
24
+ code: BIDDER_CODE,
25
+ supportedMediaTypes: [BANNER, VIDEO, NATIVE],
26
+ isBidRequestValid: function(bid = {}) {
27
+ return !!(bid && bid.params);
28
+ },
29
+ buildRequests: function(validBidRequests = [], bidderRequest = {}) {
30
+ validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
31
+ const chtnwId = (storage.getCookie(COOKIE_NAME) != undefined) ? storage.getCookie(COOKIE_NAME) : generateUUID();
32
+ if (storage.cookiesAreEnabled()) {
33
+ storage.setCookie(COOKIE_NAME, chtnwId);
34
+ }
35
+ const device = getConfig('device') || {};
36
+ device.w = device.w || window.innerWidth;
37
+ device.h = device.h || window.innerHeight;
38
+ device.ua = device.ua || navigator.userAgent;
39
+ device.dnt = getDNT() ? 1 : 0;
40
+ device.language = (navigator && navigator.language) ? navigator.language.split('-')[0] : '';
41
+ const bidParams = [];
42
+ _each(validBidRequests, function(bid) {
43
+ bidParams.push({
44
+ bidId: bid.bidId,
45
+ placement: bid.params.placementId,
46
+ sizes: bid.sizes,
47
+ adSlot: bid.adUnitCode
48
+ });
49
+ });
50
+ return {
51
+ method: 'POST',
52
+ url: ENDPOINT_URL + '/request/prebid.json',
53
+ data: {
54
+ bids: bidParams,
55
+ uuid: chtnwId,
56
+ device: device,
57
+ version: {
58
+ prebid: '$prebid.version$',
59
+ adapter: '1.0.0',
60
+ },
61
+ site: {
62
+ numIframes: bidderRequest.refererInfo?.numIframes || 0,
63
+ isAmp: bidderRequest.refererInfo?.isAmp || false,
64
+ pageUrl: bidderRequest.refererInfo?.page || '',
65
+ ref: bidderRequest.refererInfo?.ref || '',
66
+ },
67
+ },
68
+ bids: validBidRequests
69
+ };
70
+ },
71
+ interpretResponse: function(serverResponse) {
72
+ const bidResponses = []
73
+ _each(serverResponse.body, function(response, i) {
74
+ bidResponses.push({
75
+ ...response
76
+ });
77
+ });
78
+ return bidResponses;
79
+ },
80
+ getUserSyncs: function(syncOptions, serverResponses, gdprConsent, uspConsent) {
81
+ const syncs = [];
82
+ if (syncOptions.pixelEnabled) {
83
+ const chtnwId = generateUUID()
84
+ const uuid = chtnwId
85
+ const type = (_isMobile()) ? 'dot' : 'pixel';
86
+ syncs.push({
87
+ type: 'image',
88
+ url: `https://t.ssp.hinet.net/${type}?bd=${uuid}&t=chtnw`
89
+ })
90
+ }
91
+ return syncs
92
+ },
93
+ onTimeout: function(timeoutData) {
94
+ if (timeoutData === null) {
95
+ return;
96
+ }
97
+ ajax(ENDPOINT_URL + '/trace/timeout/bid', null, JSON.stringify(timeoutData), {
98
+ method: 'POST',
99
+ withCredentials: false
100
+ });
101
+ },
102
+ onBidWon: function(bid) {
103
+ if (bid.nurl) {
104
+ ajax(bid.nurl, null);
105
+ }
106
+ },
107
+ onSetTargeting: function(bid) {
108
+ },
109
+ }
110
+ registerBidder(spec);
@@ -0,0 +1,31 @@
1
+ # Overview
2
+
3
+ ```
4
+ Module Name: CHT Bidder Adapter
5
+ Module Type: Bidder Adapter
6
+ Maintainer: chtdsp@cht.com.tw
7
+ ```
8
+
9
+ # Description
10
+
11
+ Module that connects to CHT's demand sources
12
+
13
+ # Test Parameters
14
+ ```
15
+ var adUnits = [
16
+ {
17
+ code: 'adunit-code',
18
+ mediaTypes: {
19
+ banner: {
20
+ sizes: [[300, 250]]
21
+ }
22
+ },
23
+ bids: [{
24
+ bidder: 'chtnw',
25
+ params: {
26
+ placementId: '38EL412LO82XR9O6'
27
+ }
28
+ }]
29
+ }
30
+ ];
31
+ ```
@@ -34,6 +34,9 @@ export const spec = {
34
34
  buildRequests: function(validBidRequests, bidderRequest) {
35
35
  logMessage(validBidRequests);
36
36
  logMessage(bidderRequest);
37
+
38
+ const eids = [];
39
+
37
40
  let payload = {
38
41
  meta: {
39
42
  prebidVersion: '$prebid.version$',
@@ -49,6 +52,10 @@ export const spec = {
49
52
  };
50
53
 
51
54
  payload.slots = validBidRequests.map(bidRequest => {
55
+ collectEid(eids, bidRequest);
56
+ const adUnitElement = document.getElementById(bidRequest.adUnitCode)
57
+ const coordinates = getOffset(adUnitElement)
58
+
52
59
  let slot = {
53
60
  name: bidRequest.adUnitCode,
54
61
  bidId: bidRequest.bidId,
@@ -59,12 +66,15 @@ export const spec = {
59
66
  adSlot: bidRequest.params.slot || bidRequest.adUnitCode,
60
67
  placementId: bidRequest.params.placementId || '',
61
68
  site: bidRequest.params.site || bidderRequest.refererInfo.page,
62
- ref: bidderRequest.refererInfo.ref
63
- };
69
+ ref: bidderRequest.refererInfo.ref,
70
+ offsetCoordinates: { x: coordinates?.left, y: coordinates?.top }
71
+ }
64
72
 
65
73
  return slot;
66
74
  });
67
75
 
76
+ payload.meta.eids = eids.filter(Boolean);
77
+
68
78
  logMessage(payload);
69
79
 
70
80
  return {
@@ -216,3 +226,35 @@ function consentAllowsPpid(bidderRequest) {
216
226
 
217
227
  return (uspConsent || gdprConsent);
218
228
  }
229
+
230
+ function collectEid(eids, bid) {
231
+ if (bid.userId) {
232
+ const eid = getUserId(bid.userId.uid2 && bid.userId.uid2.id, 'uidapi.com', undefined, 3)
233
+ eids.push(eid)
234
+ }
235
+ }
236
+
237
+ function getUserId(id, source, uidExt, atype) {
238
+ if (id) {
239
+ const uid = { id, atype };
240
+
241
+ if (uidExt) {
242
+ uid.ext = uidExt;
243
+ }
244
+
245
+ return {
246
+ source,
247
+ uids: [ uid ]
248
+ };
249
+ }
250
+ }
251
+
252
+ function getOffset(el) {
253
+ if (el) {
254
+ const rect = el.getBoundingClientRect();
255
+ return {
256
+ left: rect.left + window.scrollX,
257
+ top: rect.top + window.scrollY
258
+ };
259
+ }
260
+ }
@@ -15,18 +15,7 @@ const VENDOR_ID = 25;
15
15
  const PLACEHOLDER = '__PIXEL_ID__';
16
16
  const UPS_ENDPOINT = `https://ups.analytics.yahoo.com/ups/${PLACEHOLDER}/fed`;
17
17
  const OVERRIDE_OPT_OUT_KEY = 'connectIdOptOut';
18
-
19
- function isEUConsentRequired(consentData) {
20
- return !!(consentData && consentData.gdpr && consentData.gdpr.gdprApplies);
21
- }
22
-
23
- function userHasOptedOut() {
24
- try {
25
- return localStorage.getItem(OVERRIDE_OPT_OUT_KEY) === '1';
26
- } catch {
27
- return false;
28
- }
29
- }
18
+ const INPUT_PARAM_KEYS = ['pixelId', 'he', 'puid'];
30
19
 
31
20
  /** @type {Submodule} */
32
21
  export const connectIdSubmodule = {
@@ -45,7 +34,7 @@ export const connectIdSubmodule = {
45
34
  * @returns {{connectId: string} | undefined}
46
35
  */
47
36
  decode(value) {
48
- if (userHasOptedOut()) {
37
+ if (connectIdSubmodule.userHasOptedOut()) {
49
38
  return undefined;
50
39
  }
51
40
  return (typeof value === 'object' && value.connectid)
@@ -59,27 +48,29 @@ export const connectIdSubmodule = {
59
48
  * @returns {IdResponse|undefined}
60
49
  */
61
50
  getId(config, consentData) {
62
- if (userHasOptedOut()) {
51
+ if (connectIdSubmodule.userHasOptedOut()) {
63
52
  return;
64
53
  }
65
54
  const params = config.params || {};
66
- if (!params || typeof params.he !== 'string' ||
67
- (typeof params.pixelId === 'undefined' && typeof params.endpoint === 'undefined')) {
68
- logError('The connectId submodule requires the \'he\' and \'pixelId\' parameters to be defined.');
55
+ if (!params || (typeof params.he !== 'string' && typeof params.puid !== 'string') ||
56
+ (typeof params.pixelId === 'undefined' && typeof params.endpoint === 'undefined')) {
57
+ logError('The connectId submodule requires the \'pixelId\' and at least one of the \'he\' ' +
58
+ 'or \'puid\' parameters to be defined.');
69
59
  return;
70
60
  }
71
61
 
72
62
  const data = {
73
63
  '1p': includes([1, '1', true], params['1p']) ? '1' : '0',
74
- he: params.he,
75
- gdpr: isEUConsentRequired(consentData) ? '1' : '0',
76
- gdpr_consent: isEUConsentRequired(consentData) ? consentData.gdpr.consentString : '',
64
+ gdpr: connectIdSubmodule.isEUConsentRequired(consentData) ? '1' : '0',
65
+ gdpr_consent: connectIdSubmodule.isEUConsentRequired(consentData) ? consentData.gdpr.consentString : '',
77
66
  us_privacy: consentData && consentData.uspConsent ? consentData.uspConsent : ''
78
67
  };
79
68
 
80
- if (params.pixelId) {
81
- data.pixelId = params.pixelId
82
- }
69
+ INPUT_PARAM_KEYS.forEach(key => {
70
+ if (typeof params[key] != 'undefined') {
71
+ data[key] = params[key];
72
+ }
73
+ });
83
74
 
84
75
  const resp = function (callback) {
85
76
  const callbacks = {
@@ -106,6 +97,28 @@ export const connectIdSubmodule = {
106
97
  return {callback: resp};
107
98
  },
108
99
 
100
+ /**
101
+ * Utility function that returns a boolean flag indicating if the opporunity
102
+ * is subject to GDPR
103
+ * @returns {Boolean}
104
+ */
105
+ isEUConsentRequired(consentData) {
106
+ return !!(consentData && consentData.gdpr && consentData.gdpr.gdprApplies);
107
+ },
108
+
109
+ /**
110
+ * Utility function that returns a boolean flag indicating if the user
111
+ * has opeted out via the Yahoo easy-opt-out mechanism.
112
+ * @returns {Boolean}
113
+ */
114
+ userHasOptedOut() {
115
+ try {
116
+ return localStorage.getItem(OVERRIDE_OPT_OUT_KEY) === '1';
117
+ } catch {
118
+ return false;
119
+ }
120
+ },
121
+
109
122
  /**
110
123
  * Return the function used to perform XHR calls.
111
124
  * Utilised for each of testing.
@@ -29,5 +29,6 @@ The below parameters apply only to the Yahoo ConnectID user ID Module.
29
29
  | --- | --- | --- | --- | --- |
30
30
  | name | Required | String | ID value for the Yahoo ConnectID module - `"connectId"` | `"connectId"` |
31
31
  | params | Required | Object | Data for Yahoo ConnectID initialization. | |
32
- | params.pixelId | Required | Number | The Yahoo supplied publisher specific pixel Id | `8976` |
33
- | params.he | Required | String | The SHA-256 hashed user email address | `"529cb86de31e9547a712d9f380146e98bbd39beec"` |
32
+ | params.pixelId | Required | Number | The Yahoo supplied publisher specific pixel Id. | `8976` |
33
+ | params.he | Optional | String | The SHA-256 hashed user email address. One of either the `he` parameter or the `puid` parameter must be supplied. | `"529cb86de31e9547a712d9f380146e98bbd39beec"` |
34
+ | params.puid | Optional | String | The publisher-supplied user identifier. One of either the `he` parameter or the `puid` parameter must be supplied. | `"P-975484817"` |
@@ -4,11 +4,12 @@
4
4
  * and make it available for any GDPR supported adapters to read/pass this information to
5
5
  * their system.
6
6
  */
7
- import {isNumber, isPlainObject, isStr, logError, logInfo, logWarn} from '../src/utils.js';
7
+ import {deepSetValue, isNumber, isPlainObject, isStr, logError, logInfo, logWarn} from '../src/utils.js';
8
8
  import {config} from '../src/config.js';
9
9
  import {gdprDataHandler} from '../src/adapterManager.js';
10
10
  import {includes} from '../src/polyfill.js';
11
11
  import {timedAuctionHook} from '../src/utils/perfMetrics.js';
12
+ import {registerOrtbProcessor, REQUEST} from '../src/pbjsORTB.js';
12
13
 
13
14
  const DEFAULT_CMP = 'iab';
14
15
  const DEFAULT_CONSENT_TIMEOUT = 10000;
@@ -354,3 +355,23 @@ export function setConsentConfig(config) {
354
355
  loadConsentData(); // immediately look up consent data to make it available without requiring an auction
355
356
  }
356
357
  config.getConfig('consentManagement', config => setConsentConfig(config.consentManagement));
358
+
359
+ export function setOrtbGdpr(ortbRequest, bidderRequest) {
360
+ const consent = bidderRequest.gdprConsent;
361
+ if (consent) {
362
+ if (typeof consent.gdprApplies === 'boolean') {
363
+ deepSetValue(ortbRequest, 'regs.ext.gdpr', consent.gdprApplies ? 1 : 0);
364
+ }
365
+ deepSetValue(ortbRequest, 'user.ext.consent', consent.consentString);
366
+ }
367
+ }
368
+
369
+ export function setOrtbAdditionalConsent(ortbRequest, bidderRequest) {
370
+ const addtl = bidderRequest.gdprConsent?.addtlConsent;
371
+ if (addtl && typeof addtl === 'string') {
372
+ deepSetValue(ortbRequest, 'user.ext.ConsentedProvidersSettings.consented_providers', addtl);
373
+ }
374
+ }
375
+
376
+ registerOrtbProcessor({type: REQUEST, name: 'gdpr', fn: setOrtbGdpr});
377
+ registerOrtbProcessor({type: REQUEST, name: 'gdprAddtlConsent', fn: setOrtbAdditionalConsent})