prebid.js 7.3.0 → 7.6.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 (225) hide show
  1. package/.circleci/config.yml +11 -6
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/adnuntiusBidAdapter.js +1 -1
  7. package/dist/adotBidAdapter.js +1 -1
  8. package/dist/adpod.js +1 -1
  9. package/dist/adrelevantisBidAdapter.js +1 -1
  10. package/dist/adrinoBidAdapter.js +1 -1
  11. package/dist/adtelligentBidAdapter.js +1 -1
  12. package/dist/adxcgBidAdapter.js +1 -1
  13. package/dist/ajaBidAdapter.js +1 -1
  14. package/dist/amxBidAdapter.js +1 -1
  15. package/dist/amxIdSystem.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/asoBidAdapter.js +1 -1
  19. package/dist/atsAnalyticsAdapter.js +1 -1
  20. package/dist/axonixBidAdapter.js +1 -1
  21. package/dist/bidglassBidAdapter.js +1 -1
  22. package/dist/big-richmediaBidAdapter.js +1 -1
  23. package/dist/bridgewellBidAdapter.js +1 -1
  24. package/dist/brightMountainMediaBidAdapter.js +1 -1
  25. package/dist/byDataAnalyticsAdapter.js +1 -1
  26. package/dist/concertBidAdapter.js +1 -1
  27. package/dist/connectadBidAdapter.js +1 -1
  28. package/dist/consumableBidAdapter.js +1 -1
  29. package/dist/conversantBidAdapter.js +1 -1
  30. package/dist/craftBidAdapter.js +1 -1
  31. package/dist/criteoBidAdapter.js +1 -1
  32. package/dist/debugging-standalone.js +1 -1
  33. package/dist/debugging.js +1 -1
  34. package/dist/dspxBidAdapter.js +1 -1
  35. package/dist/eplanningBidAdapter.js +1 -1
  36. package/dist/finativeBidAdapter.js +1 -1
  37. package/dist/gdprEnforcement.js +1 -1
  38. package/dist/glimpseBidAdapter.js +1 -1
  39. package/dist/gmosspBidAdapter.js +1 -1
  40. package/dist/goldbachBidAdapter.js +1 -1
  41. package/dist/gridBidAdapter.js +1 -1
  42. package/dist/gridNMBidAdapter.js +1 -1
  43. package/dist/gumgumBidAdapter.js +1 -1
  44. package/dist/h12mediaBidAdapter.js +1 -1
  45. package/dist/hadronIdSystem.js +1 -1
  46. package/dist/hadronRtdProvider.js +1 -1
  47. package/dist/id5IdSystem.js +1 -1
  48. package/dist/imRtdProvider.js +1 -1
  49. package/dist/improvedigitalBidAdapter.js +1 -1
  50. package/dist/inmarBidAdapter.js +1 -1
  51. package/dist/insticatorBidAdapter.js +1 -1
  52. package/dist/ixBidAdapter.js +1 -1
  53. package/dist/justpremiumBidAdapter.js +1 -1
  54. package/dist/kargoAnalyticsAdapter.js +1 -1
  55. package/dist/kargoBidAdapter.js +1 -1
  56. package/dist/konduitAnalyticsAdapter.js +1 -1
  57. package/dist/kueezBidAdapter.js +1 -1
  58. package/dist/lassoBidAdapter.js +1 -1
  59. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  60. package/dist/logicadBidAdapter.js +1 -1
  61. package/dist/loglyliftBidAdapter.js +1 -1
  62. package/dist/malltvAnalyticsAdapter.js +1 -1
  63. package/dist/marsmediaBidAdapter.js +1 -1
  64. package/dist/mediafuseBidAdapter.js +1 -1
  65. package/dist/mediasquareBidAdapter.js +1 -1
  66. package/dist/mgidBidAdapter.js +1 -1
  67. package/dist/minutemediaBidAdapter.js +1 -1
  68. package/dist/missenaBidAdapter.js +1 -1
  69. package/dist/newspassidBidAdapter.js +1 -0
  70. package/dist/nextMillenniumBidAdapter.js +1 -1
  71. package/dist/not-for-prod/prebid.js +131 -127
  72. package/dist/oguryBidAdapter.js +1 -1
  73. package/dist/onetagBidAdapter.js +1 -1
  74. package/dist/ooloAnalyticsAdapter.js +1 -1
  75. package/dist/openxOrtbBidAdapter.js +1 -0
  76. package/dist/outbrainBidAdapter.js +1 -1
  77. package/dist/parrableIdSystem.js +1 -1
  78. package/dist/pixfutureBidAdapter.js +1 -1
  79. package/dist/prebid-core.js +2 -2
  80. package/dist/priceFloors.js +1 -1
  81. package/dist/pubCommonId.js +1 -1
  82. package/dist/publinkIdSystem.js +1 -1
  83. package/dist/pubmaticBidAdapter.js +1 -1
  84. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  85. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  86. package/dist/pxyzBidAdapter.js +1 -1
  87. package/dist/quantcastBidAdapter.js +1 -1
  88. package/dist/rasBidAdapter.js +1 -0
  89. package/dist/readpeakBidAdapter.js +1 -1
  90. package/dist/relaidoBidAdapter.js +1 -1
  91. package/dist/rhythmoneBidAdapter.js +1 -1
  92. package/dist/riseBidAdapter.js +1 -1
  93. package/dist/rubiconAnalyticsAdapter.js +1 -1
  94. package/dist/rubiconBidAdapter.js +1 -1
  95. package/dist/seedingAllianceBidAdapter.js +1 -1
  96. package/dist/seedtagBidAdapter.js +1 -1
  97. package/dist/sharedIdSystem.js +1 -1
  98. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  99. package/dist/sharethroughBidAdapter.js +1 -1
  100. package/dist/shinezBidAdapter.js +1 -0
  101. package/dist/sizeMappingV2.js +1 -1
  102. package/dist/smaatoBidAdapter.js +1 -1
  103. package/dist/smartadserverBidAdapter.js +1 -1
  104. package/dist/smartxBidAdapter.js +1 -1
  105. package/dist/smilewantedBidAdapter.js +1 -1
  106. package/dist/sonobiBidAdapter.js +1 -1
  107. package/dist/sovrnAnalyticsAdapter.js +1 -1
  108. package/dist/sovrnBidAdapter.js +1 -1
  109. package/dist/sspBCBidAdapter.js +1 -1
  110. package/dist/sublimeBidAdapter.js +1 -1
  111. package/dist/synacormediaBidAdapter.js +1 -1
  112. package/dist/taboolaBidAdapter.js +1 -1
  113. package/dist/targetVideoBidAdapter.js +1 -1
  114. package/dist/teadsBidAdapter.js +1 -1
  115. package/dist/trionBidAdapter.js +1 -1
  116. package/dist/tripleliftBidAdapter.js +1 -1
  117. package/dist/ttdBidAdapter.js +1 -1
  118. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  119. package/dist/underdogmediaBidAdapter.js +1 -1
  120. package/dist/undertoneBidAdapter.js +1 -1
  121. package/dist/ventesBidAdapter.js +1 -1
  122. package/dist/vidazooBidAdapter.js +1 -1
  123. package/dist/videobyteBidAdapter.js +1 -1
  124. package/dist/visxBidAdapter.js +1 -1
  125. package/dist/vrtcalBidAdapter.js +1 -1
  126. package/dist/vuukleBidAdapter.js +1 -1
  127. package/dist/widespaceBidAdapter.js +1 -1
  128. package/dist/winrBidAdapter.js +1 -1
  129. package/dist/yahoosspBidAdapter.js +1 -1
  130. package/dist/yieldmoBidAdapter.js +1 -1
  131. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  132. package/gulpfile.js +1 -1
  133. package/karma.conf.maker.js +3 -1
  134. package/modules/adgenerationBidAdapter.js +24 -1
  135. package/modules/adnuntiusBidAdapter.js +26 -8
  136. package/modules/adotBidAdapter.js +13 -4
  137. package/modules/adrinoBidAdapter.js +10 -2
  138. package/modules/adrinoBidAdapter.md +6 -0
  139. package/modules/adtelligentBidAdapter.js +2 -1
  140. package/modules/appnexusBidAdapter.js +3 -3
  141. package/modules/atsAnalyticsAdapter.js +4 -5
  142. package/modules/byDataAnalyticsAdapter.js +172 -74
  143. package/modules/byDataAnalyticsAdapter.md +5 -6
  144. package/modules/consumableBidAdapter.js +12 -1
  145. package/modules/criteoBidAdapter.js +7 -1
  146. package/modules/cwireBidAdapter.md +1 -1
  147. package/modules/debugging/bidInterceptor.js +1 -1
  148. package/modules/debugging/index.js +2 -1
  149. package/modules/eplanningBidAdapter.js +82 -97
  150. package/modules/gdprEnforcement.js +8 -14
  151. package/modules/gridNMBidAdapter.js +45 -4
  152. package/modules/hadronAnalyticsAdapter.md +5 -5
  153. package/modules/hadronIdSystem.js +18 -5
  154. package/modules/hadronIdSystem.md +15 -11
  155. package/modules/hadronRtdProvider.js +14 -1
  156. package/modules/hadronRtdProvider.md +17 -13
  157. package/modules/imRtdProvider.js +0 -8
  158. package/modules/insticatorBidAdapter.js +9 -0
  159. package/modules/ixBidAdapter.js +462 -58
  160. package/modules/ixBidAdapter.md +95 -5
  161. package/modules/kargoAnalyticsAdapter.js +88 -6
  162. package/modules/kargoAnalyticsAdapter.md +33 -0
  163. package/modules/kargoBidAdapter.js +1 -2
  164. package/modules/minutemediaBidAdapter.js +1 -0
  165. package/modules/missenaBidAdapter.js +20 -2
  166. package/modules/newspassidBidAdapter.js +649 -0
  167. package/modules/nextMillenniumBidAdapter.js +17 -1
  168. package/modules/oguryBidAdapter.js +2 -0
  169. package/modules/openxBidAdapter.md +3 -1
  170. package/modules/openxOrtbBidAdapter.js +349 -0
  171. package/modules/openxOrtbBidAdapter.md +105 -0
  172. package/modules/priceFloors.js +1 -1
  173. package/modules/pubCommonId.js +1 -2
  174. package/modules/pubxaiAnalyticsAdapter.js +6 -1
  175. package/modules/rasBidAdapter.js +149 -0
  176. package/modules/rasBidAdapter.md +50 -0
  177. package/modules/readpeakBidAdapter.js +15 -6
  178. package/modules/relaidoBidAdapter.js +19 -4
  179. package/modules/seedtagBidAdapter.js +37 -1
  180. package/modules/sharedIdSystem.js +11 -5
  181. package/modules/sharethroughBidAdapter.js +9 -24
  182. package/modules/shinezBidAdapter.js +435 -0
  183. package/modules/shinezBidAdapter.md +76 -0
  184. package/modules/taboolaBidAdapter.js +1 -1
  185. package/modules/taboolaBidAdapter.md +3 -3
  186. package/modules/ventesBidAdapter.js +1 -1
  187. package/modules/ventesBidAdapter.md +1 -1
  188. package/modules/vrtcalBidAdapter.js +35 -0
  189. package/package.json +1 -1
  190. package/plugins/pbjsGlobals.js +2 -1
  191. package/src/storageManager.js +4 -5
  192. package/test/spec/modules/adgenerationBidAdapter_spec.js +52 -4
  193. package/test/spec/modules/adnuntiusBidAdapter_spec.js +126 -14
  194. package/test/spec/modules/adotBidAdapter_spec.js +12 -9
  195. package/test/spec/modules/adrinoBidAdapter_spec.js +22 -0
  196. package/test/spec/modules/appnexusBidAdapter_spec.js +165 -156
  197. package/test/spec/modules/byDataAnalyticsAdapter_spec.js +74 -24
  198. package/test/spec/modules/consumableBidAdapter_spec.js +75 -0
  199. package/test/spec/modules/criteoBidAdapter_spec.js +15 -5
  200. package/test/spec/modules/debugging_mod_spec.js +7 -0
  201. package/test/spec/modules/eplanningBidAdapter_spec.js +58 -18
  202. package/test/spec/modules/gdprEnforcement_spec.js +53 -100
  203. package/test/spec/modules/gridNMBidAdapter_spec.js +32 -0
  204. package/test/spec/modules/hadronIdSystem_spec.js +2 -2
  205. package/test/spec/modules/imRtdProvider_spec.js +0 -1
  206. package/test/spec/modules/insticatorBidAdapter_spec.js +22 -1
  207. package/test/spec/modules/ixBidAdapter_spec.js +470 -10
  208. package/test/spec/modules/kargoAnalyticsAdapter_spec.js +42 -0
  209. package/test/spec/modules/kargoBidAdapter_spec.js +1 -0
  210. package/test/spec/modules/minutemediaBidAdapter_spec.js +3 -0
  211. package/test/spec/modules/missenaBidAdapter_spec.js +36 -14
  212. package/test/spec/modules/newspassidBidAdapter_spec.js +1793 -0
  213. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +20 -0
  214. package/test/spec/modules/openxOrtbBidAdapter_spec.js +1303 -0
  215. package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +5 -0
  216. package/test/spec/modules/rasBidAdapter_spec.js +190 -0
  217. package/test/spec/modules/readpeakBidAdapter_spec.js +1 -0
  218. package/test/spec/modules/relaidoBidAdapter_spec.js +29 -2
  219. package/test/spec/modules/seedtagBidAdapter_spec.js +29 -0
  220. package/test/spec/modules/sharethroughBidAdapter_spec.js +4 -4
  221. package/test/spec/modules/shinezBidAdapter_spec.js +479 -0
  222. package/test/spec/modules/taboolaBidAdapter_spec.js +1 -1
  223. package/test/spec/modules/ventesBidAdapter_spec.js +2 -2
  224. package/test/spec/modules/vrtcalBidAdapter_spec.js +17 -0
  225. package/webpack.conf.js +1 -1
@@ -13,7 +13,7 @@ Description
13
13
  This module connects publishers to Index Exchange's (IX) network of demand
14
14
  sources through Prebid.js. This module is GDPR and CCPA compliant.
15
15
 
16
- It is compatible with the newer PrebidJS 5.0 ad unit format where the `banner` and/or `video` properties are encapsulated within the `adUnits[].mediaTypes` object. We
16
+ It is compatible with the newer PrebidJS 5.0 ad unit format where the `banner`, `video` and/or `native` properties are encapsulated within the `adUnits[].mediaTypes` object. We
17
17
  recommend that you use this newer format when possible as it will be better able
18
18
  to accommodate new feature additions.
19
19
 
@@ -32,7 +32,18 @@ var adUnits = [{
32
32
  video: {
33
33
  context: 'instream',
34
34
  playerSize: [300, 250]
35
- }
35
+ },
36
+ native: {
37
+ title: {
38
+ required: true
39
+ },
40
+ image: {
41
+ required: true
42
+ },
43
+ body: {
44
+ required: false
45
+ }
46
+ },
36
47
  },
37
48
  // ...
38
49
  }];
@@ -44,7 +55,7 @@ var adUnits = [{
44
55
  | --- | ---
45
56
  | Banner | Fully supported for all IX approved sizes.
46
57
  | Video | Fully supported for all IX approved sizes.
47
- | Native | Not supported.
58
+ | Native | Supported (render through GAM or publisher's renderer).
48
59
 
49
60
 
50
61
 
@@ -56,14 +67,14 @@ Each of the IX-specific parameters provided under the `adUnits[].bids[].params`
56
67
  object are detailed here.
57
68
 
58
69
 
59
- ### Banner
70
+ ## Banner
60
71
 
61
72
  | Key | Scope | Type | Description
62
73
  | --- | --- | --- | ---
63
74
  | siteId | Required | String | An IX-specific identifier that is associated with this ad unit. It will be associated to the single size, if the size provided. This is similar to a placement ID or an ad unit ID that some other modules have. Examples: `'3723'`, `'6482'`, `'3639'`
64
75
  | sizes | Required | Number[Number[]] | The size / sizes associated with the site ID. It should be one of the sizes listed in the ad unit under `adUnits[].mediaTypes.banner.sizes`. Examples: `[300, 250]`, `[300, 600]`, `[728, 90]`
65
76
 
66
- ### Video
77
+ ## Video
67
78
 
68
79
  | Key | Scope | Type | Description
69
80
  | --- | --- | --- | ---
@@ -81,6 +92,58 @@ object are detailed here.
81
92
  | video.playerConfig.floatOnScroll | Optional | Boolean | A boolean specifying whether you want to use the player’s floating capabilities, where: <br /> - `true`: Allow the player to float.<br /> <b>Note</b>: If you set floatOnScroll to true, Index updates the placement value to `5`. <br />- `false`: Do not allow the player to float (default).
82
93
  | video.playerConfig.floatSize | Optional | Integer[] | The height and width of the floating player in pixels. If you do not specify a float size, the player adjusts to the aspect ratio of the player size that is defined when it is not floating. Index recommends that you review and test the float size to your user experience preference.
83
94
 
95
+ ## Native
96
+
97
+ | Key | Scope | Type | Description
98
+ | --- | --- | --- | ---
99
+ | sendTargetingKeys | Optional | Boolean | Defines whether or not to send the hb_native_ASSET targeting keys to the ad server. Defaults to true.
100
+ | adTemplate | Optional | String | Used in the ‘AdUnit-Defined Creative Scenario’, this value controls the Native template right in the page.
101
+ | rendererUrl | Optional | String | Used in the ‘Custom Renderer Scenario’, this points to javascript code that will produce the Native template.
102
+ | title | Optional | Title asset | The title of the ad, usually a call to action or a brand name.
103
+ | body | Optional | Data asset | Text of the ad copy.
104
+ | body2 | Optional | Data asset | Additional Text of the ad copy.
105
+ | sponsoredBy | Optional | Data asset | The name of the brand associated with the ad.
106
+ | icon | Optional | Image asset | The brand icon that will appear with the ad.
107
+ | image | Optional | Image asset | A picture that is associated with the brand, or grabs the user’s attention.
108
+ | displayUrl | Optional | Data asset | Text that can be displayed instead of the raw click URL. e.g, “Example.com/Specials”
109
+ | cta | Optional | Data asset | Call to Action text, e.g., “Click here for more information”.
110
+ | rating | Optional | Data asset | Rating information, e.g., “4” out of 5.
111
+ | downloads | Optional | Data asset | The total downloads of the advertised application/product.
112
+ | likes | Optional | Data asset | The total number of individuals who like the advertised application/product.
113
+ | price | Optional | Data asset | The non-sale price of the advertised application/product.
114
+ | salePrice | Optional | Data asset | The sale price of the advertised application/product.
115
+ | address | Optional | Data asset | Address of the Buyer/Store. e.g, “123 Main Street, Anywhere USA”
116
+ | phone | Optional | Data asset | Phone Number of the Buyer/Store. e.g, “(123) 456-7890”
117
+
118
+ #### Title Asset
119
+
120
+ | Key | Scope | Type | Description
121
+ | --- | --- | --- | ---
122
+ | required | Required | Boolean | Specify whether or not a title is required.
123
+ | len | Optional | Integer | Maximum number of characters (defaults to 25 if omitted).
124
+ | ext | Optional | Object | Arbitrary additional parameters to send to the bidder.
125
+
126
+ #### Data Asset
127
+
128
+ | Key | Scope | Type | Description
129
+ | --- | --- | --- | ---
130
+ | required | Required | Boolean | Specify whether or not the asset is required.
131
+ | len | Optional | Integer | Maximum number of characters.
132
+ | ext | Optional | Object | Arbitrary additional parameters to send to the bidder.
133
+
134
+ #### Image Asset
135
+
136
+ | Key | Scope | Type | Description
137
+ | --- | --- | --- | ---
138
+ | required | Required | Boolean | Specify whether or not the asset is required.
139
+ | sizes | Optional | Integer[] | Minimum size requested for the image, e.g., [100, 100]
140
+ | mimes | Optional | String[] | Whitelist of content MIME types supported, e.g., ["image/jpg", "image/gif"]
141
+ | ext | Optional | Object | Arbitrary additional parameters to send to the bidder.
142
+
143
+ ### Rendering Native Ad
144
+
145
+ Native ad can be rendered by setting up GAM or setup custom native renderer. Reference [Prebid implementing the native template](https://docs.prebid.org/prebid/native-implementation.html#4-implementing-the-native-template) for more information.
146
+
84
147
  ## Deprecation warning
85
148
 
86
149
  We are deprecating the older format
@@ -319,6 +382,33 @@ pbjs.setBidderConfig({
319
382
  });
320
383
  ```
321
384
 
385
+ **Native**
386
+
387
+ ```javascript
388
+ var adUnits = [{
389
+ code: 'native-div-a',
390
+ mediaTypes: {
391
+ native: {
392
+ title: {
393
+ required: true
394
+ },
395
+ image: {
396
+ required: true
397
+ },
398
+ sponsoredBy: {
399
+ required: false
400
+ }
401
+ }
402
+ },
403
+ bids: [{
404
+ bidder: 'ix',
405
+ params: {
406
+ siteId: '715966'
407
+ }
408
+ }]
409
+ }];
410
+ ```
411
+
322
412
  ### 2. Include `ixBidAdapter` in your build process
323
413
 
324
414
  When running the build command, include `ixBidAdapter` as a module, as well as `dfpAdServerVideo` if you require video support.
@@ -1,14 +1,96 @@
1
+ import { logError } from '../src/utils.js';
2
+ import { ajax } from '../src/ajax.js';
1
3
  import adapter from '../src/AnalyticsAdapter.js';
2
4
  import adapterManager from '../src/adapterManager.js';
5
+ import CONSTANTS from '../src/constants.json';
3
6
 
4
- var kargoAdapter = adapter({
5
- analyticsType: 'endpoint',
6
- url: 'https://krk.kargo.com/api/v1/event/prebid'
7
- });
7
+ const EVENT_URL = 'https://krk.kargo.com/api/v1/event';
8
+ const KARGO_BIDDER_CODE = 'kargo';
9
+
10
+ const analyticsType = 'endpoint';
11
+
12
+ let _initOptions = {};
13
+
14
+ let _logBidResponseData = {
15
+ auctionId: '',
16
+ auctionTimeout: 0,
17
+ responseTime: 0,
18
+ };
19
+
20
+ let _bidResponseDataLogged = [];
21
+
22
+ var kargoAnalyticsAdapter = Object.assign(
23
+ adapter({ analyticsType }), {
24
+ track({ eventType, args }) {
25
+ switch (eventType) {
26
+ case CONSTANTS.EVENTS.AUCTION_INIT: {
27
+ _logBidResponseData.auctionTimeout = args.timeout;
28
+ break;
29
+ }
30
+ case CONSTANTS.EVENTS.BID_RESPONSE: {
31
+ handleBidResponseData(args);
32
+ break;
33
+ }
34
+ }
35
+ }
36
+ }
37
+ );
38
+
39
+ // handleBidResponseData: Get auction data for Kargo bids and send to server
40
+ function handleBidResponseData (bidResponse) {
41
+ // Verify this is Kargo and we haven't seen this auction data yet
42
+ if (bidResponse.bidder !== KARGO_BIDDER_CODE || _bidResponseDataLogged.includes(bidResponse.auctionId) !== false) {
43
+ return
44
+ }
45
+
46
+ _logBidResponseData.auctionId = bidResponse.auctionId;
47
+ _logBidResponseData.responseTime = bidResponse.timeToRespond;
48
+ sendAuctionData(_logBidResponseData);
49
+ }
50
+
51
+ // sendAuctionData: Send auction data to the server
52
+ function sendAuctionData (data) {
53
+ try {
54
+ _bidResponseDataLogged.push(data.auctionId);
55
+
56
+ if (!shouldFireEventRequest()) {
57
+ return;
58
+ }
59
+
60
+ ajax(
61
+ `${EVENT_URL}/auction-data`,
62
+ null,
63
+ {
64
+ aid: data.auctionId,
65
+ ato: data.auctionTimeout,
66
+ rt: data.responseTime,
67
+ it: 0,
68
+ },
69
+ {
70
+ method: 'GET',
71
+ }
72
+ );
73
+ } catch (err) {
74
+ logError('Error sending auction data: ', err);
75
+ }
76
+ }
77
+
78
+ // Sampling rate out of 100
79
+ function shouldFireEventRequest () {
80
+ const samplingRate = (_initOptions && _initOptions.sampling) || 100;
81
+ return ((Math.floor(Math.random() * 100) + 1) <= parseInt(samplingRate));
82
+ }
83
+
84
+ kargoAnalyticsAdapter.originEnableAnalytics = kargoAnalyticsAdapter.enableAnalytics;
85
+
86
+ kargoAnalyticsAdapter.enableAnalytics = function (config) {
87
+ _initOptions = config.options;
88
+ kargoAnalyticsAdapter.originEnableAnalytics(config);
89
+ };
8
90
 
9
91
  adapterManager.registerAnalyticsAdapter({
10
- adapter: kargoAdapter,
92
+ adapter: kargoAnalyticsAdapter,
11
93
  code: 'kargo'
12
94
  });
13
95
 
14
- export default kargoAdapter;
96
+ export default kargoAnalyticsAdapter;
@@ -0,0 +1,33 @@
1
+ # Overview
2
+
3
+ Module Name: Kargo Analytics Adapter
4
+ Module Type: Analytics Adapter
5
+ Maintainer: support@kargo.com
6
+
7
+ # Description
8
+
9
+ Analytics adapter for Kargo. Contact support@kargo.com for information.
10
+
11
+ # Usage
12
+
13
+ The simplest way to enable the analytics adapter is this
14
+
15
+ ```javascript
16
+ pbjs.enableAnalytics([{
17
+ provider: 'kargo',
18
+ options: {
19
+ sampling: 100 // value out of 100
20
+ }
21
+ }]);
22
+ ```
23
+
24
+ # Test Parameters
25
+
26
+ ```
27
+ {
28
+ provider: 'kargo',
29
+ options: {
30
+ sampling: 100
31
+ }
32
+ }
33
+ ```
@@ -88,6 +88,7 @@ export const spec = {
88
88
  }
89
89
 
90
90
  const bidResponse = {
91
+ ad: adUnit.adm,
91
92
  requestId: bidId,
92
93
  cpm: Number(adUnit.cpm),
93
94
  width: adUnit.width,
@@ -103,8 +104,6 @@ export const spec = {
103
104
 
104
105
  if (meta.mediaType == VIDEO) {
105
106
  bidResponse.vastXml = adUnit.adm;
106
- } else {
107
- bidResponse.ad = adUnit.adm;
108
107
  }
109
108
 
110
109
  bidResponses.push(bidResponse);
@@ -286,6 +286,7 @@ function generateBidParameters(bid, bidderRequest) {
286
286
  sizes: sizesArray,
287
287
  floorPrice: Math.max(getFloor(bid, mediaType), params.floorPrice),
288
288
  bidId: getBidIdParameter('bidId', bid),
289
+ loop: getBidIdParameter('bidderRequestsCount', bid),
289
290
  bidderRequestId: getBidIdParameter('bidderRequestId', bid),
290
291
  transactionId: getBidIdParameter('transactionId', bid),
291
292
  };
@@ -72,11 +72,29 @@ export const spec = {
72
72
 
73
73
  return bidResponses;
74
74
  },
75
- getUserSyncs: function (syncOptions, serverResponses) {
75
+ getUserSyncs: function (
76
+ syncOptions,
77
+ serverResponses,
78
+ gdprConsent,
79
+ uspConsent
80
+ ) {
76
81
  if (!syncOptions.iframeEnabled) {
77
82
  return [];
78
83
  }
79
- return [{ type: 'iframe', url: 'https://sync.missena.io/iframe' }];
84
+
85
+ let gdprParams = '';
86
+ if (
87
+ gdprConsent &&
88
+ 'gdprApplies' in gdprConsent &&
89
+ typeof gdprConsent.gdprApplies === 'boolean'
90
+ ) {
91
+ gdprParams = `?gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${
92
+ gdprConsent.consentString
93
+ }`;
94
+ }
95
+ return [
96
+ { type: 'iframe', url: 'https://sync.missena.io/iframe' + gdprParams },
97
+ ];
80
98
  },
81
99
  /**
82
100
  * Register bidder specific code, which will execute if bidder timed out after an auction