prebid.js 8.40.0 → 8.41.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 (199) hide show
  1. package/dist/33acrossAnalyticsAdapter.js +1 -1
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/BTBidAdapter.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/adkernelBidAdapter.js +1 -1
  10. package/dist/adqueryBidAdapter.js +1 -1
  11. package/dist/adrelevantisBidAdapter.js +1 -1
  12. package/dist/adstirBidAdapter.js +1 -1
  13. package/dist/adtrgtmeBidAdapter.js +1 -1
  14. package/dist/adxcgBidAdapter.js +1 -1
  15. package/dist/adyoulikeBidAdapter.js +1 -1
  16. package/dist/agmaAnalyticsAdapter.js +1 -1
  17. package/dist/ajaBidAdapter.js +1 -1
  18. package/dist/amxBidAdapter.js +1 -1
  19. package/dist/amxIdSystem.js +1 -1
  20. package/dist/appierAnalyticsAdapter.js +1 -1
  21. package/dist/appnexusBidAdapter.js +1 -1
  22. package/dist/asoBidAdapter.js +1 -1
  23. package/dist/automatadAnalyticsAdapter.js +1 -1
  24. package/dist/axonixBidAdapter.js +1 -1
  25. package/dist/bidglassBidAdapter.js +1 -1
  26. package/dist/big-richmediaBidAdapter.js +1 -1
  27. package/dist/bridBidAdapter.js +1 -1
  28. package/dist/bridgewellBidAdapter.js +1 -1
  29. package/dist/brightMountainMediaBidAdapter.js +1 -1
  30. package/dist/carodaBidAdapter.js +1 -1
  31. package/dist/chtnwBidAdapter.js +1 -1
  32. package/dist/concertBidAdapter.js +1 -1
  33. package/dist/connectadBidAdapter.js +1 -1
  34. package/dist/consumableBidAdapter.js +1 -1
  35. package/dist/conversantAnalyticsAdapter.js +1 -1
  36. package/dist/conversantBidAdapter.js +1 -1
  37. package/dist/craftBidAdapter.js +1 -1
  38. package/dist/criteoBidAdapter.js +1 -1
  39. package/dist/cwireBidAdapter.js +1 -1
  40. package/dist/discoveryBidAdapter.js +1 -1
  41. package/dist/dspxBidAdapter.js +1 -1
  42. package/dist/dxkultureBidAdapter.js +1 -1
  43. package/dist/eplanningBidAdapter.js +1 -1
  44. package/dist/euidIdSystem.js +1 -1
  45. package/dist/feedadBidAdapter.js +1 -1
  46. package/dist/finativeBidAdapter.js +1 -1
  47. package/dist/freewheel-sspBidAdapter.js +1 -1
  48. package/dist/gmosspBidAdapter.js +1 -1
  49. package/dist/goldbachBidAdapter.js +1 -1
  50. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  51. package/dist/greenbidsRtdProvider.js +1 -1
  52. package/dist/gridBidAdapter.js +1 -1
  53. package/dist/gumgumBidAdapter.js +1 -1
  54. package/dist/h12mediaBidAdapter.js +1 -1
  55. package/dist/hypelabBidAdapter.js +1 -1
  56. package/dist/id5IdSystem.js +1 -1
  57. package/dist/illuminBidAdapter.js +1 -1
  58. package/dist/imdsBidAdapter.js +1 -1
  59. package/dist/improvedigitalBidAdapter.js +1 -1
  60. package/dist/insticatorBidAdapter.js +1 -1
  61. package/dist/ixBidAdapter.js +1 -1
  62. package/dist/jixieBidAdapter.js +1 -1
  63. package/dist/justpremiumBidAdapter.js +1 -1
  64. package/dist/kargoBidAdapter.js +1 -1
  65. package/dist/kimberliteBidAdapter.js +1 -1
  66. package/dist/konduitAnalyticsAdapter.js +1 -1
  67. package/dist/kueezBidAdapter.js +1 -1
  68. package/dist/kueezRtbBidAdapter.js +1 -1
  69. package/dist/lassoBidAdapter.js +1 -1
  70. package/dist/lifestreetBidAdapter.js +1 -1
  71. package/dist/liveIntentIdSystem.js +1 -1
  72. package/dist/logicadBidAdapter.js +1 -1
  73. package/dist/loglyliftBidAdapter.js +1 -1
  74. package/dist/luceadBidAdapter.js +1 -1
  75. package/dist/magniteAnalyticsAdapter.js +1 -1
  76. package/dist/malltvAnalyticsAdapter.js +1 -1
  77. package/dist/marsmediaBidAdapter.js +1 -1
  78. package/dist/mediafuseBidAdapter.js +1 -1
  79. package/dist/mediasquareBidAdapter.js +1 -1
  80. package/dist/mgidBidAdapter.js +1 -1
  81. package/dist/minutemediaBidAdapter.js +1 -1
  82. package/dist/minutemediaplusBidAdapter.js +1 -1
  83. package/dist/missenaBidAdapter.js +1 -1
  84. package/dist/nextMillenniumBidAdapter.js +1 -1
  85. package/dist/nexx360BidAdapter.js +1 -1
  86. package/dist/not-for-prod/prebid.js +155 -153
  87. package/dist/oguryBidAdapter.js +1 -1
  88. package/dist/onetagBidAdapter.js +1 -1
  89. package/dist/ooloAnalyticsAdapter.js +1 -1
  90. package/dist/openxBidAdapter.js +1 -1
  91. package/dist/optidigitalBidAdapter.js +1 -1
  92. package/dist/outbrainBidAdapter.js +1 -1
  93. package/dist/parrableIdSystem.js +1 -1
  94. package/dist/pixfutureBidAdapter.js +1 -1
  95. package/dist/prebid-core.js +1 -1
  96. package/dist/pstudioBidAdapter.js +1 -0
  97. package/dist/publinkIdSystem.js +1 -1
  98. package/dist/publirBidAdapter.js +1 -0
  99. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  100. package/dist/pubmaticBidAdapter.js +1 -1
  101. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  102. package/dist/pxyzBidAdapter.js +1 -1
  103. package/dist/quantcastBidAdapter.js +1 -1
  104. package/dist/rasBidAdapter.js +1 -1
  105. package/dist/readpeakBidAdapter.js +1 -1
  106. package/dist/relaidoBidAdapter.js +1 -1
  107. package/dist/retailspotBidAdapter.js +1 -1
  108. package/dist/rhythmoneBidAdapter.js +1 -1
  109. package/dist/riseBidAdapter.js +1 -1
  110. package/dist/rtbhouseBidAdapter.js +1 -1
  111. package/dist/rubiconBidAdapter.js +1 -1
  112. package/dist/seedingAllianceBidAdapter.js +1 -1
  113. package/dist/seedtagBidAdapter.js +1 -1
  114. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  115. package/dist/sharethroughBidAdapter.js +1 -1
  116. package/dist/shinezBidAdapter.js +1 -1
  117. package/dist/shinezRtbBidAdapter.js +1 -1
  118. package/dist/smaatoBidAdapter.js +1 -1
  119. package/dist/smartadserverBidAdapter.js +1 -1
  120. package/dist/smartxBidAdapter.js +1 -1
  121. package/dist/smartyadsBidAdapter.js +1 -1
  122. package/dist/smilewantedBidAdapter.js +1 -1
  123. package/dist/sonobiBidAdapter.js +1 -1
  124. package/dist/sovrnAnalyticsAdapter.js +1 -1
  125. package/dist/sovrnBidAdapter.js +1 -1
  126. package/dist/sspBCBidAdapter.js +1 -1
  127. package/dist/stnBidAdapter.js +1 -1
  128. package/dist/stvBidAdapter.js +1 -1
  129. package/dist/sublimeBidAdapter.js +1 -1
  130. package/dist/taboolaBidAdapter.js +1 -1
  131. package/dist/tagorasBidAdapter.js +1 -1
  132. package/dist/targetVideoBidAdapter.js +1 -1
  133. package/dist/teadsBidAdapter.js +1 -1
  134. package/dist/themoneytizerBidAdapter.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/uid2IdSystem.js +1 -1
  140. package/dist/underdogmediaBidAdapter.js +1 -1
  141. package/dist/undertoneBidAdapter.js +1 -1
  142. package/dist/unrulyBidAdapter.js +1 -1
  143. package/dist/userId.js +1 -1
  144. package/dist/vidazooBidAdapter.js +1 -1
  145. package/dist/videobyteBidAdapter.js +1 -1
  146. package/dist/visxBidAdapter.js +1 -1
  147. package/dist/vuukleBidAdapter.js +1 -1
  148. package/dist/weboramaRtdProvider.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/dist/zeta_global_sspBidAdapter.js +1 -1
  155. package/integrationExamples/gpt/publir_hello_world.html +84 -0
  156. package/modules/adkernelBidAdapter.js +2 -1
  157. package/modules/automatadAnalyticsAdapter.js +31 -22
  158. package/modules/discoveryBidAdapter.js +5 -4
  159. package/modules/hypelabBidAdapter.js +31 -5
  160. package/modules/kargoBidAdapter.js +25 -13
  161. package/modules/kueezRtbBidAdapter.js +1 -1
  162. package/modules/nextMillenniumBidAdapter.js +52 -33
  163. package/modules/nexx360BidAdapter.js +2 -3
  164. package/modules/onetagBidAdapter.js +2 -1
  165. package/modules/pstudioBidAdapter.js +435 -0
  166. package/modules/pstudioBidAdapter.md +148 -0
  167. package/modules/publirBidAdapter.js +391 -0
  168. package/modules/publirBidAdapter.md +47 -0
  169. package/modules/pubmaticAnalyticsAdapter.js +7 -2
  170. package/modules/rasBidAdapter.js +178 -22
  171. package/modules/rasBidAdapter.md +2 -2
  172. package/modules/rtbhouseBidAdapter.js +2 -1
  173. package/modules/sharethroughBidAdapter.js +4 -0
  174. package/modules/smartyadsBidAdapter.js +10 -2
  175. package/modules/sovrnBidAdapter.js +15 -8
  176. package/modules/sspBCBidAdapter.js +22 -17
  177. package/modules/taboolaBidAdapter.js +1 -1
  178. package/modules/userId/index.js +1 -1
  179. package/modules/weboramaRtdProvider.js +99 -36
  180. package/modules/weboramaRtdProvider.md +13 -4
  181. package/modules/zeta_global_sspBidAdapter.js +26 -1
  182. package/package.json +1 -1
  183. package/test/spec/modules/automatadAnalyticsAdapter_spec.js +102 -15
  184. package/test/spec/modules/discoveryBidAdapter_spec.js +1 -1
  185. package/test/spec/modules/hypelabBidAdapter_spec.js +5 -1
  186. package/test/spec/modules/kargoBidAdapter_spec.js +29 -11
  187. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +34 -3
  188. package/test/spec/modules/nexx360BidAdapter_spec.js +5 -5
  189. package/test/spec/modules/onetagBidAdapter_spec.js +4 -1
  190. package/test/spec/modules/pstudioBidAdapter_spec.js +514 -0
  191. package/test/spec/modules/publirBidAdapter_spec.js +488 -0
  192. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +12 -1
  193. package/test/spec/modules/rasBidAdapter_spec.js +364 -2
  194. package/test/spec/modules/sharethroughBidAdapter_spec.js +35 -0
  195. package/test/spec/modules/sovrnBidAdapter_spec.js +39 -0
  196. package/test/spec/modules/sspBCBidAdapter_spec.js +1 -1
  197. package/test/spec/modules/taboolaBidAdapter_spec.js +1 -1
  198. package/test/spec/modules/weboramaRtdProvider_spec.js +114 -0
  199. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +4 -4
@@ -0,0 +1,148 @@
1
+ # Overview
2
+
3
+ ```
4
+ Module Name: PStudio Bid Adapter
5
+ Module Type: Bidder Adapter
6
+ Maintainer: pstudio@telkomsel.com
7
+ ```
8
+
9
+ # Description
10
+
11
+ Currently module supports banner as well as instream video mediaTypes.
12
+
13
+
14
+ # Test parameters
15
+
16
+ Those parameters should be used to get test responses from the adapter.
17
+
18
+ ```js
19
+ var adUnits = [
20
+ // Banner ad unit
21
+ {
22
+ code: 'test-div-1',
23
+ mediaTypes: {
24
+ banner: {
25
+ sizes: [[300, 250]],
26
+ },
27
+ },
28
+ bids: [
29
+ {
30
+ bidder: 'pstudio',
31
+ params: {
32
+ // id of test publisher
33
+ pubid: '22430f9d-9610-432c-aabe-6134256f11af',
34
+ floorPrice: 1.25,
35
+ },
36
+ },
37
+ ],
38
+ },
39
+ // Instream video ad unit
40
+ {
41
+ code: 'test-div-2',
42
+ mediaTypes: {
43
+ video: {
44
+ context: 'instream',
45
+ playerSize: [640, 480],
46
+ mimes: ['video/mp4'],
47
+ protocols: [3],
48
+ },
49
+ },
50
+ bids: [
51
+ {
52
+ bidder: 'pstudio',
53
+ params: {
54
+ // id of test publisher
55
+ pubid: '22430f9d-9610-432c-aabe-6134256f11af',
56
+ floorPrice: 1.25,
57
+ },
58
+ },
59
+ ],
60
+ },
61
+ ];
62
+ ```
63
+
64
+ # Sample Banner Ad Unit
65
+
66
+ ```js
67
+ var adUnits = [
68
+ {
69
+ code: 'test-div-1',
70
+ mediaTypes: {
71
+ banner: {
72
+ sizes: [[300, 250]],
73
+ pos: 0,
74
+ name: 'test-name',
75
+ },
76
+ },
77
+ bids: [
78
+ {
79
+ bidder: 'pstudio',
80
+ params: {
81
+ pubid: '22430f9d-9610-432c-aabe-6134256f11af', // required
82
+ floorPrice: 1.15, // required
83
+ bcat: ['IAB1-1', 'IAB1-3'], // optional
84
+ badv: ['nike.com'], // optional
85
+ bapp: ['com.foo.mygame'], // optional
86
+ },
87
+ },
88
+ ],
89
+ },
90
+ ];
91
+ ```
92
+
93
+ # Sample Video Ad Unit
94
+
95
+ ```js
96
+ var videoAdUnits = [
97
+ {
98
+ code: 'test-instream-video',
99
+ mediaTypes: {
100
+ video: {
101
+ context: 'instream', // required (only instream accepted)
102
+ playerSize: [640, 480], // required (alternatively it could be pair of `w` and `h` parameters)
103
+ mimes: ['video/mp4'], // required (only choices `video/mp4`, `application/javascript`, `video/webm` and `video/ogg` supported)
104
+ protocols: [2, 3], // 1 required (only choices 2 and 3 supported)
105
+ minduration: 5, // optional
106
+ maxduration: 30, // optional
107
+ startdelay: 5, // optional
108
+ placement: 1, // optional (only 1 accepted, as it is instream placement)
109
+ skip: 1, // optional
110
+ skipafter: 1, // optional
111
+ minbitrate: 10, // optional
112
+ maxbitrate: 10, // optional
113
+ delivery: 1, // optional
114
+ playbackmethod: [1, 3], // optional
115
+ api: [2], // optional (only choice 2 supported)
116
+ linearity: 1, // optional
117
+ },
118
+ },
119
+ bids: [
120
+ {
121
+ bidder: 'pstudio',
122
+ params: {
123
+ pubid: '22430f9d-9610-432c-aabe-6134256f11af',
124
+ floorPrice: 1.25,
125
+ badv: ['adidas.com'],
126
+ },
127
+ },
128
+ ],
129
+ },
130
+ ];
131
+ ```
132
+
133
+ # Configuration for video
134
+
135
+ ### Prebid cache
136
+
137
+ For video ads, Prebid cache must be enabled, as the demand partner does not support caching of video content.
138
+
139
+ ```js
140
+ pbjs.setConfig({
141
+ cache: {
142
+ url: 'https://prebid.adnxs.com/pbc/v1/cache',
143
+ },
144
+ });
145
+ ```
146
+
147
+ Please provide Prebid Cache of your choice. This example uses AppNexus cache, but if you use other cache, change it according to your needs.
148
+
@@ -0,0 +1,391 @@
1
+ import {
2
+ logWarn,
3
+ logInfo,
4
+ isArray,
5
+ isFn,
6
+ deepAccess,
7
+ isEmpty,
8
+ contains,
9
+ timestamp,
10
+ triggerPixel,
11
+ getDNT,
12
+ getBidIdParameter
13
+ } from '../src/utils.js';
14
+ import { registerBidder } from '../src/adapters/bidderFactory.js';
15
+ import { BANNER, VIDEO } from '../src/mediaTypes.js';
16
+ import { config } from '../src/config.js';
17
+ import { getStorageManager } from '../src/storageManager.js';
18
+ import { ajax } from '../src/ajax.js';
19
+
20
+ const SUPPORTED_AD_TYPES = [BANNER, VIDEO];
21
+ const BIDDER_CODE = 'publir';
22
+ const ADAPTER_VERSION = '1.0.0';
23
+ const TTL = 360;
24
+ const CURRENCY = 'USD';
25
+ const DEFAULT_SELLER_ENDPOINT = 'https://prebid.publir.com/publirPrebidEndPoint';
26
+ const DEFAULT_IMPS_ENDPOINT = 'https://prebidimpst.publir.com/publirPrebidImpressionTracker';
27
+ const SUPPORTED_SYNC_METHODS = {
28
+ IFRAME: 'iframe',
29
+ PIXEL: 'pixel'
30
+ }
31
+
32
+ export const storage = getStorageManager({ bidderCode: BIDDER_CODE });
33
+ export const spec = {
34
+ code: BIDDER_CODE,
35
+ version: ADAPTER_VERSION,
36
+ aliases: ['plr'],
37
+ supportedMediaTypes: SUPPORTED_AD_TYPES,
38
+ isBidRequestValid: function (bidRequest) {
39
+ if (!bidRequest.params.pubId) {
40
+ logWarn('pubId is a mandatory param for Publir adapter');
41
+ return false;
42
+ }
43
+
44
+ return true;
45
+ },
46
+ buildRequests: function (validBidRequests, bidderRequest) {
47
+ const reqObj = {};
48
+ const generalObject = validBidRequests[0];
49
+ reqObj.params = generatePubGeneralsParams(generalObject, bidderRequest);
50
+ reqObj.bids = generatePubBidParams(validBidRequests, bidderRequest);
51
+ reqObj.bids.timestamp = timestamp();
52
+ let options = {
53
+ withCredentials: false
54
+ };
55
+
56
+ return {
57
+ method: 'POST',
58
+ url: DEFAULT_SELLER_ENDPOINT,
59
+ data: reqObj,
60
+ options
61
+ }
62
+ },
63
+ interpretResponse: function ({ body }) {
64
+ const bidResponses = [];
65
+ if (body.bids) {
66
+ body.bids.forEach(adUnit => {
67
+ const bidResponse = {
68
+ requestId: adUnit.requestId,
69
+ cpm: adUnit.cpm,
70
+ currency: adUnit.currency || CURRENCY,
71
+ width: adUnit.width,
72
+ height: adUnit.height,
73
+ ttl: adUnit.ttl || TTL,
74
+ creativeId: adUnit.creativeId,
75
+ netRevenue: adUnit.netRevenue || true,
76
+ nurl: adUnit.nurl,
77
+ mediaType: adUnit.mediaType,
78
+ meta: {
79
+ mediaType: adUnit.mediaType
80
+ },
81
+ };
82
+
83
+ if (adUnit.mediaType === VIDEO) {
84
+ bidResponse.vastXml = adUnit.vastXml;
85
+ } else if (adUnit.mediaType === BANNER) {
86
+ bidResponse.ad = adUnit.ad;
87
+ }
88
+
89
+ if (adUnit.adomain && adUnit.adomain.length) {
90
+ bidResponse.meta.advertiserDomains = adUnit.adomain;
91
+ } else {
92
+ bidResponse.meta.advertiserDomains = [];
93
+ }
94
+ if (adUnit?.meta?.ad_key) {
95
+ bidResponse.meta.ad_key = adUnit.meta.ad_key ?? null;
96
+ }
97
+ if (adUnit.campId) {
98
+ bidResponse.campId = adUnit.campId;
99
+ }
100
+ bidResponse.bidder = BIDDER_CODE;
101
+ bidResponses.push(bidResponse);
102
+ });
103
+ } else {
104
+ return [];
105
+ }
106
+ return bidResponses;
107
+ },
108
+ getUserSyncs: function (syncOptions, serverResponses) {
109
+ const syncs = [];
110
+ for (const response of serverResponses) {
111
+ if (response.body && response.body.params) {
112
+ if (syncOptions.iframeEnabled && response.body.params.userSyncURL) {
113
+ syncs.push({
114
+ type: 'iframe',
115
+ url: response.body.params.userSyncURL
116
+ });
117
+ }
118
+ if (syncOptions.pixelEnabled && isArray(response.body.params.userSyncPixels)) {
119
+ const pixels = response.body.params.userSyncPixels.map(pixel => {
120
+ return {
121
+ type: 'image',
122
+ url: pixel
123
+ }
124
+ })
125
+ syncs.push(...pixels)
126
+ }
127
+ }
128
+ }
129
+ return syncs;
130
+ },
131
+ onBidWon: function (bid) {
132
+ if (bid == null) {
133
+ return;
134
+ }
135
+ logInfo('onBidWon:', bid);
136
+ ajax(DEFAULT_IMPS_ENDPOINT, null, JSON.stringify(bid), { method: 'POST', mode: 'no-cors', credentials: 'include', headers: { 'Content-Type': 'application/json' } });
137
+ if (bid.hasOwnProperty('nurl') && bid.nurl.length > 0) {
138
+ triggerPixel(bid.nurl);
139
+ }
140
+ },
141
+ };
142
+
143
+ registerBidder(spec);
144
+
145
+ /**
146
+ * Get floor price
147
+ * @param bid {bid}
148
+ * @returns {Number}
149
+ */
150
+ function getFloor(bid, mediaType) {
151
+ if (!isFn(bid.getFloor)) {
152
+ return 0;
153
+ }
154
+ let floorResult = bid.getFloor({
155
+ currency: CURRENCY,
156
+ mediaType: mediaType,
157
+ size: '*'
158
+ });
159
+ return floorResult.currency === CURRENCY && floorResult.floor ? floorResult.floor : 0;
160
+ }
161
+
162
+ /**
163
+ * Get the the ad sizes array from the bid
164
+ * @param bid {bid}
165
+ * @returns {Array}
166
+ */
167
+ function getSizesArray(bid, mediaType) {
168
+ let sizesArray = []
169
+
170
+ if (deepAccess(bid, `mediaTypes.${mediaType}.sizes`)) {
171
+ sizesArray = bid.mediaTypes[mediaType].sizes;
172
+ } else if (Array.isArray(bid.sizes) && bid.sizes.length > 0) {
173
+ sizesArray = bid.sizes;
174
+ }
175
+
176
+ return sizesArray;
177
+ }
178
+
179
+ /**
180
+ * Get schain string value
181
+ * @param schainObject {Object}
182
+ * @returns {string}
183
+ */
184
+ function getSupplyChain(schainObject) {
185
+ if (isEmpty(schainObject)) {
186
+ return '';
187
+ }
188
+ let scStr = `${schainObject.ver},${schainObject.complete}`;
189
+ schainObject.nodes.forEach((node) => {
190
+ scStr += '!';
191
+ scStr += `${getEncodedValIfNotEmpty(node.asi)},`;
192
+ scStr += `${getEncodedValIfNotEmpty(node.sid)},`;
193
+ scStr += `${node.hp ? encodeURIComponent(node.hp) : ''},`;
194
+ scStr += `${getEncodedValIfNotEmpty(node.rid)},`;
195
+ scStr += `${getEncodedValIfNotEmpty(node.name)},`;
196
+ scStr += `${getEncodedValIfNotEmpty(node.domain)}`;
197
+ });
198
+ return scStr;
199
+ }
200
+
201
+ /**
202
+ * Get encoded node value
203
+ * @param val {string}
204
+ * @returns {string}
205
+ */
206
+ function getEncodedValIfNotEmpty(val) {
207
+ return !isEmpty(val) ? encodeURIComponent(val) : '';
208
+ }
209
+
210
+ function getAllowedSyncMethod(filterSettings, bidderCode) {
211
+ const iframeConfigsToCheck = ['all', 'iframe'];
212
+ const pixelConfigToCheck = 'image';
213
+ if (filterSettings && iframeConfigsToCheck.some(config => isSyncMethodAllowed(filterSettings[config], bidderCode))) {
214
+ return SUPPORTED_SYNC_METHODS.IFRAME;
215
+ }
216
+ if (!filterSettings || !filterSettings[pixelConfigToCheck] || isSyncMethodAllowed(filterSettings[pixelConfigToCheck], bidderCode)) {
217
+ return SUPPORTED_SYNC_METHODS.PIXEL;
218
+ }
219
+ }
220
+
221
+ /**
222
+ * Check if sync rule is supported
223
+ * @param syncRule {Object}
224
+ * @param bidderCode {string}
225
+ * @returns {boolean}
226
+ */
227
+ function isSyncMethodAllowed(syncRule, bidderCode) {
228
+ if (!syncRule) {
229
+ return false;
230
+ }
231
+ const isInclude = syncRule.filter === 'include';
232
+ const bidders = isArray(syncRule.bidders) ? syncRule.bidders : [bidderCode];
233
+ return isInclude && contains(bidders, bidderCode);
234
+ }
235
+
236
+ /**
237
+ * get device type
238
+ * @param ua {ua}
239
+ * @returns {string}
240
+ */
241
+ function getDeviceType(ua) {
242
+ if (/ipad|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(ua.toLowerCase())) {
243
+ return '5';
244
+ }
245
+ if (/iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile/i.test(ua.toLowerCase())) {
246
+ return '4';
247
+ }
248
+ if (/smart[-_\s]?tv|hbbtv|appletv|googletv|hdmi|netcast|viera|nettv|roku|\bdtv\b|sonydtv|inettvbrowser|\btv\b/i.test(ua.toLowerCase())) {
249
+ return '3';
250
+ }
251
+ return '1';
252
+ }
253
+
254
+ function generatePubBidParams(validBidRequests, bidderRequest) {
255
+ const bidsArray = [];
256
+
257
+ if (validBidRequests.length) {
258
+ validBidRequests.forEach(bid => {
259
+ bidsArray.push(generateBidParameters(bid, bidderRequest));
260
+ });
261
+ }
262
+ return bidsArray;
263
+ }
264
+
265
+ /**
266
+ * Generate bid specific parameters
267
+ * @param {bid} bid
268
+ * @param {bidderRequest} bidderRequest
269
+ * @returns {Object} bid specific params object
270
+ */
271
+ function generateBidParameters(bid, bidderRequest) {
272
+ const { params } = bid;
273
+ const mediaType = isBanner(bid) ? BANNER : VIDEO;
274
+ const sizesArray = getSizesArray(bid, mediaType);
275
+
276
+ // fix floor price in case of NAN
277
+ if (isNaN(params.floorPrice)) {
278
+ params.floorPrice = 0;
279
+ }
280
+
281
+ const bidObject = {
282
+ mediaType,
283
+ adUnitCode: getBidIdParameter('adUnitCode', bid),
284
+ sizes: sizesArray,
285
+ floorPrice: Math.max(getFloor(bid, mediaType), params.floorPrice),
286
+ bidId: getBidIdParameter('bidId', bid),
287
+ bidderRequestId: getBidIdParameter('bidderRequestId', bid),
288
+ loop: getBidIdParameter('bidderRequestsCount', bid),
289
+ transactionId: bid.ortb2Imp?.ext?.tid,
290
+ coppa: 0
291
+ };
292
+
293
+ const pubId = params.pubId;
294
+ if (pubId) {
295
+ bidObject.pubId = pubId;
296
+ }
297
+
298
+ const sua = deepAccess(bid, `ortb2.device.sua`);
299
+ if (sua) {
300
+ bidObject.sua = sua;
301
+ }
302
+
303
+ const coppa = deepAccess(bid, `ortb2.regs.coppa`)
304
+ if (coppa) {
305
+ bidObject.coppa = 1;
306
+ }
307
+
308
+ return bidObject;
309
+ }
310
+
311
+ function isBanner(bid) {
312
+ return bid.mediaTypes && bid.mediaTypes.banner;
313
+ }
314
+
315
+ function getLocalStorage(cookieObjName) {
316
+ if (storage.localStorageIsEnabled()) {
317
+ const lstData = storage.getDataFromLocalStorage(cookieObjName);
318
+ return lstData;
319
+ }
320
+ return '';
321
+ }
322
+
323
+ /**
324
+ * Generate params that are common between all bids
325
+ * @param generalObject
326
+ * @param {bidderRequest} bidderRequest
327
+ * @returns {object} the common params object
328
+ */
329
+ function generatePubGeneralsParams(generalObject, bidderRequest) {
330
+ const domain = bidderRequest.refererInfo;
331
+ const { syncEnabled, filterSettings } = config.getConfig('userSync') || {};
332
+ const { bidderCode } = bidderRequest;
333
+ const generalBidParams = generalObject.params;
334
+ const timeout = bidderRequest.timeout;
335
+ const generalParams = {
336
+ wrapper_type: 'prebidjs',
337
+ wrapper_vendor: '$$PREBID_GLOBAL$$',
338
+ wrapper_version: '$prebid.version$',
339
+ adapter_version: ADAPTER_VERSION,
340
+ auction_start: bidderRequest.auctionStart,
341
+ publisher_id: generalBidParams.pubId,
342
+ publisher_name: domain,
343
+ site_domain: domain,
344
+ dnt: getDNT() ? 1 : 0,
345
+ device_type: getDeviceType(navigator.userAgent),
346
+ ua: navigator.userAgent,
347
+ is_wrapper: !!generalBidParams.isWrapper,
348
+ session_id: generalBidParams.sessionId || getBidIdParameter('bidderRequestId', generalObject),
349
+ tmax: timeout,
350
+ user_cookie: getLocalStorage('_publir_prebid_creative')
351
+ };
352
+
353
+ const userIdsParam = getBidIdParameter('userId', generalObject);
354
+ if (userIdsParam) {
355
+ generalParams.userIds = JSON.stringify(userIdsParam);
356
+ }
357
+
358
+ const ortb2Metadata = bidderRequest.ortb2 || {};
359
+ if (ortb2Metadata.site) {
360
+ generalParams.site_metadata = JSON.stringify(ortb2Metadata.site);
361
+ }
362
+ if (ortb2Metadata.user) {
363
+ generalParams.user_metadata = JSON.stringify(ortb2Metadata.user);
364
+ }
365
+
366
+ if (syncEnabled) {
367
+ const allowedSyncMethod = getAllowedSyncMethod(filterSettings, bidderCode);
368
+ if (allowedSyncMethod) {
369
+ generalParams.cs_method = allowedSyncMethod;
370
+ }
371
+ }
372
+
373
+ if (bidderRequest.uspConsent) {
374
+ generalParams.us_privacy = bidderRequest.uspConsent;
375
+ }
376
+
377
+ if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies) {
378
+ generalParams.gdpr = bidderRequest.gdprConsent.gdprApplies;
379
+ generalParams.gdpr_consent = bidderRequest.gdprConsent.consentString;
380
+ }
381
+
382
+ if (generalObject.schain) {
383
+ generalParams.schain = getSupplyChain(generalObject.schain);
384
+ }
385
+
386
+ if (bidderRequest && bidderRequest.refererInfo) {
387
+ generalParams.page_url = deepAccess(bidderRequest, 'refererInfo.page') || deepAccess(window, 'location.href');
388
+ }
389
+
390
+ return generalParams;
391
+ }
@@ -0,0 +1,47 @@
1
+ # Overview
2
+
3
+ ```
4
+ Module Name: Publir Bid Adapter
5
+ Module Type: Bidder Adapter
6
+ Maintainer: info@publir.com
7
+ ```
8
+
9
+
10
+ # Description
11
+
12
+ Module that connects to Publir's demand sources.
13
+
14
+ The Publir adapter requires setup and approval from the Publir. Please reach out to info@publir.com to create an Publir account.
15
+
16
+ The adapter supports Video(instream).
17
+
18
+ # Bid Parameters
19
+ ## Video
20
+
21
+ | Name | Scope | Type | Description | Example
22
+ | ---- | ----- | ---- | ----------- | -------
23
+ | `pubId` | required | String | Publir publisher Id provided by your Publir representative | "1234567890abcdef12345678"
24
+
25
+
26
+ # Test Parameters
27
+ ```javascript
28
+ var adUnits = [
29
+ {
30
+ code: 'hre_div-hre-vcn-1',
31
+ sizes: [[1080, 1920]]],
32
+ mediaTypes: {
33
+ banner: {
34
+ sizes: [
35
+ [1080, 1920],
36
+ ],
37
+ },
38
+ },
39
+ bids: [{
40
+ bidder: 'publir',
41
+ params: {
42
+ pubId: '1234567890abcdef12345678'
43
+ }
44
+ }]
45
+ }
46
+ ];
47
+ ```
@@ -151,6 +151,7 @@ function parseBidResponse(bid) {
151
151
  'cpm', () => window.parseFloat(Number(bid.cpm).toFixed(BID_PRECISION)),
152
152
  'originalCpm', () => window.parseFloat(Number(bid.originalCpm).toFixed(BID_PRECISION)),
153
153
  'originalCurrency',
154
+ 'adserverTargeting',
154
155
  'dealChannel',
155
156
  'meta',
156
157
  'status',
@@ -278,6 +279,7 @@ function gatherPartnerBidsForAdUnitForLogger(adUnit, adUnitId, highestBid) {
278
279
  if (isOWPubmaticBid(adapterName) && isS2SBidder(bid.bidder)) {
279
280
  return;
280
281
  }
282
+ const pg = window.parseFloat(Number(bid.bidResponse?.adserverTargeting?.hb_pb || bid.bidResponse?.adserverTargeting?.pwtpb).toFixed(BID_PRECISION));
281
283
  partnerBids.push({
282
284
  'pn': adapterName,
283
285
  'bc': bid.bidderCode || bid.bidder,
@@ -303,7 +305,8 @@ function gatherPartnerBidsForAdUnitForLogger(adUnit, adUnitId, highestBid) {
303
305
  'ocry': bid.bidResponse ? (bid.bidResponse.originalCurrency || CURRENCY_USD) : CURRENCY_USD,
304
306
  'piid': bid.bidResponse ? (bid.bidResponse.partnerImpId || EMPTY_STRING) : EMPTY_STRING,
305
307
  'frv': bid.bidResponse ? bid.bidResponse.floorData?.floorRuleValue : undefined,
306
- 'md': bid.bidResponse ? getMetadata(bid.bidResponse.meta) : undefined
308
+ 'md': bid.bidResponse ? getMetadata(bid.bidResponse.meta) : undefined,
309
+ 'pb': pg || undefined
307
310
  });
308
311
  });
309
312
  return partnerBids;
@@ -457,8 +460,9 @@ function executeBidWonLoggerCall(auctionId, adUnitId) {
457
460
  let referrer = config.getConfig('pageUrl') || cache.auctions[auctionId].referer || '';
458
461
  let adv = winningBid.bidResponse ? getAdDomain(winningBid.bidResponse) || undefined : undefined;
459
462
  let fskp = floorData ? (floorData.floorRequestData ? (floorData.floorRequestData.skipped == false ? 0 : 1) : undefined) : undefined;
460
-
463
+ let pg = window.parseFloat(Number(winningBid?.bidResponse?.adserverTargeting?.hb_pb || winningBid?.bidResponse?.adserverTargeting?.pwtpb)) || undefined;
461
464
  let pixelURL = END_POINT_WIN_BID_LOGGER;
465
+
462
466
  pixelURL += 'pubid=' + publisherId;
463
467
  pixelURL += '&purl=' + enc(config.getConfig('pageUrl') || cache.auctions[auctionId].referer || '');
464
468
  pixelURL += '&tst=' + Math.round((new window.Date()).getTime() / 1000);
@@ -475,6 +479,7 @@ function executeBidWonLoggerCall(auctionId, adUnitId) {
475
479
  pixelURL += '&kgpv=' + enc(getValueForKgpv(winningBid, adUnitId));
476
480
  pixelURL += '&piid=' + enc(winningBid.bidResponse.partnerImpId || EMPTY_STRING);
477
481
  pixelURL += '&di=' + enc(winningBid?.bidResponse?.dealId || OPEN_AUCTION_DEAL_ID);
482
+ pixelURL += '&pb=' + enc(pg);
478
483
 
479
484
  pixelURL += '&plt=' + enc(getDevicePlatform());
480
485
  pixelURL += '&psz=' + enc((winningBid?.bidResponse?.dimensions?.width || '0') + 'x' +