prebid.js 7.14.0 → 7.16.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 (239) hide show
  1. package/.circleci/config.yml +3 -0
  2. package/dist/1plusXRtdProvider.js +1 -1
  3. package/dist/33acrossBidAdapter.js +1 -1
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adfBidAdapter.js +1 -1
  7. package/dist/adgenerationBidAdapter.js +1 -1
  8. package/dist/adkernelAdnBidAdapter.js +1 -1
  9. package/dist/adkernelBidAdapter.js +1 -1
  10. package/dist/adlooxAdServerVideo.js +1 -1
  11. package/dist/adlooxRtdProvider.js +1 -1
  12. package/dist/adrelevantisBidAdapter.js +1 -1
  13. package/dist/adtrgtmeBidAdapter.js +1 -1
  14. package/dist/adtrueBidAdapter.js +1 -1
  15. package/dist/adxcgBidAdapter.js +1 -1
  16. package/dist/airgridRtdProvider.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/aolBidAdapter.js +1 -1
  21. package/dist/appierAnalyticsAdapter.js +1 -1
  22. package/dist/appnexusBidAdapter.js +1 -1
  23. package/dist/asoBidAdapter.js +1 -1
  24. package/dist/axonixBidAdapter.js +1 -1
  25. package/dist/beachfrontBidAdapter.js +1 -1
  26. package/dist/bidglassBidAdapter.js +1 -1
  27. package/dist/big-richmediaBidAdapter.js +1 -1
  28. package/dist/bizzclickBidAdapter.js +1 -1
  29. package/dist/bliinkBidAdapter.js +1 -1
  30. package/dist/bluebillywigBidAdapter.js +1 -1
  31. package/dist/brandmetricsRtdProvider.js +1 -1
  32. package/dist/bridgewellBidAdapter.js +1 -1
  33. package/dist/brightMountainMediaBidAdapter.js +1 -1
  34. package/dist/brightcomBidAdapter.js +1 -1
  35. package/dist/browsiRtdProvider.js +1 -1
  36. package/dist/categoryTranslation.js +1 -1
  37. package/dist/concertBidAdapter.js +1 -1
  38. package/dist/connectadBidAdapter.js +1 -1
  39. package/dist/consentManagement.js +1 -1
  40. package/dist/consentManagementUsp.js +1 -1
  41. package/dist/consumableBidAdapter.js +1 -1
  42. package/dist/conversantBidAdapter.js +1 -1
  43. package/dist/cpmstarBidAdapter.js +1 -1
  44. package/dist/craftBidAdapter.js +1 -1
  45. package/dist/criteoBidAdapter.js +1 -1
  46. package/dist/currency.js +1 -1
  47. package/dist/dataControllerModule.js +1 -1
  48. package/dist/dchain.js +1 -1
  49. package/dist/deepintentBidAdapter.js +1 -1
  50. package/dist/dependencies.json +3 -0
  51. package/dist/dgkeywordRtdProvider.js +1 -1
  52. package/dist/dianomiBidAdapter.js +1 -1
  53. package/dist/distroscaleBidAdapter.js +1 -1
  54. package/dist/dspxBidAdapter.js +1 -1
  55. package/dist/eplanningBidAdapter.js +1 -1
  56. package/dist/etargetBidAdapter.js +1 -1
  57. package/dist/feedadBidAdapter.js +1 -1
  58. package/dist/finativeBidAdapter.js +1 -1
  59. package/dist/fpdModule.js +1 -1
  60. package/dist/gamoshiBidAdapter.js +1 -1
  61. package/dist/glimpseBidAdapter.js +1 -1
  62. package/dist/gmosspBidAdapter.js +1 -1
  63. package/dist/goldbachBidAdapter.js +1 -1
  64. package/dist/gothamadsBidAdapter.js +1 -1
  65. package/dist/gridBidAdapter.js +1 -1
  66. package/dist/gridNMBidAdapter.js +1 -1
  67. package/dist/gumgumBidAdapter.js +1 -1
  68. package/dist/h12mediaBidAdapter.js +1 -1
  69. package/dist/iasRtdProvider.js +1 -1
  70. package/dist/id5IdSystem.js +1 -1
  71. package/dist/imRtdProvider.js +1 -1
  72. package/dist/impactifyBidAdapter.js +1 -1
  73. package/dist/improvedigitalBidAdapter.js +1 -1
  74. package/dist/inmarBidAdapter.js +1 -1
  75. package/dist/insticatorBidAdapter.js +1 -1
  76. package/dist/ixBidAdapter.js +1 -1
  77. package/dist/justpremiumBidAdapter.js +1 -1
  78. package/dist/konduitAnalyticsAdapter.js +1 -1
  79. package/dist/kueezBidAdapter.js +1 -1
  80. package/dist/lassoBidAdapter.js +1 -1
  81. package/dist/lifestreetBidAdapter.js +1 -1
  82. package/dist/liveIntentAnalyticsAdapter.js +1 -0
  83. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  84. package/dist/logicadBidAdapter.js +1 -1
  85. package/dist/loglyliftBidAdapter.js +1 -1
  86. package/dist/luponmediaBidAdapter.js +1 -1
  87. package/dist/malltvAnalyticsAdapter.js +1 -1
  88. package/dist/marsmediaBidAdapter.js +1 -1
  89. package/dist/mass.js +1 -1
  90. package/dist/mediafuseBidAdapter.js +1 -1
  91. package/dist/mediakeysBidAdapter.js +1 -1
  92. package/dist/mediasniperBidAdapter.js +1 -1
  93. package/dist/mediasquareBidAdapter.js +1 -1
  94. package/dist/mgidBidAdapter.js +1 -1
  95. package/dist/minutemediaBidAdapter.js +1 -1
  96. package/dist/multibid.js +1 -1
  97. package/dist/naveggIdSystem.js +1 -1
  98. package/dist/newspassidBidAdapter.js +1 -1
  99. package/dist/nextMillenniumBidAdapter.js +1 -1
  100. package/dist/not-for-prod/prebid.js +172 -171
  101. package/dist/oguryBidAdapter.js +1 -1
  102. package/dist/oneKeyRtdProvider.js +1 -1
  103. package/dist/onetagBidAdapter.js +1 -1
  104. package/dist/ooloAnalyticsAdapter.js +1 -1
  105. package/dist/openxBidAdapter.js +1 -1
  106. package/dist/openxOrtbBidAdapter.js +1 -1
  107. package/dist/operaadsBidAdapter.js +1 -1
  108. package/dist/outbrainBidAdapter.js +1 -1
  109. package/dist/ozoneBidAdapter.js +1 -1
  110. package/dist/parrableIdSystem.js +1 -1
  111. package/dist/permutiveRtdProvider.js +1 -1
  112. package/dist/pixfutureBidAdapter.js +1 -1
  113. package/dist/prebid-core.js +2 -2
  114. package/dist/prebidServerBidAdapter.js +1 -1
  115. package/dist/priceFloors.js +1 -1
  116. package/dist/pubCommonId.js +1 -1
  117. package/dist/pubgeniusBidAdapter.js +1 -1
  118. package/dist/publinkIdSystem.js +1 -1
  119. package/dist/pubmaticBidAdapter.js +1 -1
  120. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  121. package/dist/pubwiseBidAdapter.js +1 -1
  122. package/dist/pubxBidAdapter.js +1 -1
  123. package/dist/pxyzBidAdapter.js +1 -1
  124. package/dist/quantcastBidAdapter.js +1 -1
  125. package/dist/readpeakBidAdapter.js +1 -1
  126. package/dist/relaidoBidAdapter.js +1 -1
  127. package/dist/rhythmoneBidAdapter.js +1 -1
  128. package/dist/riseBidAdapter.js +1 -1
  129. package/dist/rtdModule.js +1 -1
  130. package/dist/rubiconAnalyticsAdapter.js +1 -1
  131. package/dist/rubiconBidAdapter.js +1 -1
  132. package/dist/seedingAllianceBidAdapter.js +1 -1
  133. package/dist/seedtagBidAdapter.js +1 -1
  134. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  135. package/dist/sharethroughBidAdapter.js +1 -1
  136. package/dist/shinezBidAdapter.js +1 -1
  137. package/dist/sirdataRtdProvider.js +1 -1
  138. package/dist/smaatoBidAdapter.js +1 -1
  139. package/dist/smartadserverBidAdapter.js +1 -1
  140. package/dist/smartxBidAdapter.js +1 -1
  141. package/dist/smilewantedBidAdapter.js +1 -1
  142. package/dist/sonobiBidAdapter.js +1 -1
  143. package/dist/sovrnAnalyticsAdapter.js +1 -1
  144. package/dist/sovrnBidAdapter.js +1 -1
  145. package/dist/spotxBidAdapter.js +1 -1
  146. package/dist/sspBCBidAdapter.js +1 -1
  147. package/dist/stroeerCoreBidAdapter.js +1 -1
  148. package/dist/sublimeBidAdapter.js +1 -1
  149. package/dist/synacormediaBidAdapter.js +1 -1
  150. package/dist/targetVideoBidAdapter.js +1 -1
  151. package/dist/teadsBidAdapter.js +1 -1
  152. package/dist/trionBidAdapter.js +1 -1
  153. package/dist/tripleliftBidAdapter.js +1 -1
  154. package/dist/ttdBidAdapter.js +1 -1
  155. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  156. package/dist/ucfunnelBidAdapter.js +1 -1
  157. package/dist/underdogmediaBidAdapter.js +1 -1
  158. package/dist/undertoneBidAdapter.js +1 -1
  159. package/dist/userId.js +1 -1
  160. package/dist/vidazooBidAdapter.js +1 -1
  161. package/dist/videobyteBidAdapter.js +1 -1
  162. package/dist/viewability.js +1 -1
  163. package/dist/visxBidAdapter.js +1 -1
  164. package/dist/vuukleBidAdapter.js +1 -1
  165. package/dist/weboramaRtdProvider.js +1 -1
  166. package/dist/widespaceBidAdapter.js +1 -1
  167. package/dist/winrBidAdapter.js +1 -1
  168. package/dist/yahoosspBidAdapter.js +1 -1
  169. package/dist/yieldliftBidAdapter.js +1 -1
  170. package/dist/yieldmoBidAdapter.js +1 -1
  171. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  172. package/dist/zeta_global_sspBidAdapter.js +1 -1
  173. package/modules/amxBidAdapter.js +98 -78
  174. package/modules/appnexusBidAdapter.js +73 -12
  175. package/modules/categoryTranslation.js +9 -8
  176. package/modules/consentManagement.js +4 -2
  177. package/modules/consentManagementUsp.js +17 -14
  178. package/modules/cpmstarBidAdapter.js +2 -1
  179. package/modules/currency.js +4 -3
  180. package/modules/dataControllerModule/index.js +4 -3
  181. package/modules/dchain.js +3 -2
  182. package/modules/dianomiBidAdapter.js +17 -14
  183. package/modules/dianomiBidAdapter.md +1 -1
  184. package/modules/feedadBidAdapter.js +40 -8
  185. package/modules/fpdModule/index.js +3 -2
  186. package/modules/iasRtdProvider.js +17 -3
  187. package/modules/ixBidAdapter.js +2 -5
  188. package/modules/liveIntentAnalyticsAdapter.js +148 -0
  189. package/modules/liveIntentAnalyticsAdapter.md +22 -0
  190. package/modules/mass.js +5 -3
  191. package/modules/multibid/index.js +4 -2
  192. package/modules/naveggIdSystem.js +53 -22
  193. package/modules/nextMillenniumBidAdapter.js +168 -55
  194. package/modules/openxOrtbBidAdapter.js +1 -1
  195. package/modules/prebidServerBidAdapter/index.js +18 -4
  196. package/modules/priceFloors.js +5 -4
  197. package/modules/pubCommonId.js +3 -2
  198. package/modules/rtdModule/index.js +3 -2
  199. package/modules/sharethroughBidAdapter.js +8 -6
  200. package/modules/spotxBidAdapter.js +1 -0
  201. package/modules/stroeerCoreBidAdapter.js +129 -92
  202. package/modules/stroeerCoreBidAdapter.md +52 -14
  203. package/modules/teadsBidAdapter.js +32 -10
  204. package/modules/ucfunnelBidAdapter.js +9 -10
  205. package/modules/userId/index.js +73 -48
  206. package/modules/viewability.js +2 -170
  207. package/package.json +3 -3
  208. package/src/adapterManager.js +21 -13
  209. package/src/adapters/bidderFactory.js +28 -6
  210. package/src/auction.js +17 -4
  211. package/src/auctionManager.js +5 -0
  212. package/src/constants.json +2 -0
  213. package/src/native.js +5 -2
  214. package/src/prebid.js +52 -23
  215. package/src/secureCreatives.js +1 -1
  216. package/src/utils/perfMetrics.js +386 -0
  217. package/src/utils.js +1 -1
  218. package/test/helpers/testing-utils.js +4 -3
  219. package/test/spec/modules/adriverIdSystem_spec.js +7 -3
  220. package/test/spec/modules/amxBidAdapter_spec.js +250 -192
  221. package/test/spec/modules/appnexusBidAdapter_spec.js +61 -6
  222. package/test/spec/modules/consentManagementUsp_spec.js +6 -2
  223. package/test/spec/modules/dianomiBidAdapter_spec.js +326 -6
  224. package/test/spec/modules/feedadBidAdapter_spec.js +147 -11
  225. package/test/spec/modules/iasRtdProvider_spec.js +3 -1
  226. package/test/spec/modules/ixBidAdapter_spec.js +0 -64
  227. package/test/spec/modules/liveIntentAnalyticsAdapter_spec.js +297 -0
  228. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +103 -1
  229. package/test/spec/modules/openxOrtbBidAdapter_spec.js +31 -0
  230. package/test/spec/modules/sharethroughBidAdapter_spec.js +23 -2
  231. package/test/spec/modules/spotxBidAdapter_spec.js +6 -0
  232. package/test/spec/modules/stroeerCoreBidAdapter_spec.js +315 -33
  233. package/test/spec/modules/teadsBidAdapter_spec.js +65 -11
  234. package/test/spec/modules/ucfunnelBidAdapter_spec.js +24 -10
  235. package/test/spec/native_spec.js +11 -0
  236. package/test/spec/unit/utils/perfMetrics_spec.js +394 -0
  237. package/wdio.conf.js +1 -0
  238. package/modules/viewability.md +0 -87
  239. package/test/spec/modules/viewability_spec.js +0 -280
@@ -1,6 +1,6 @@
1
- import { getWindowSelf, getWindowTop, buildUrl, logError, isStr, isEmpty, deepAccess } from '../src/utils.js';
1
+ import {buildUrl, deepAccess, getWindowSelf, getWindowTop, isEmpty, isStr, logWarn} from '../src/utils.js';
2
2
  import {registerBidder} from '../src/adapters/bidderFactory.js';
3
- import {BANNER} from '../src/mediaTypes.js';
3
+ import {BANNER, VIDEO} from '../src/mediaTypes.js';
4
4
 
5
5
  const GVL_ID = 136;
6
6
  const BIDDER_CODE = 'stroeerCore';
@@ -10,98 +10,33 @@ const DEFAULT_PORT = '';
10
10
  const FIVE_MINUTES_IN_SECONDS = 300;
11
11
  const USER_SYNC_IFRAME_URL = 'https://js.adscale.de/pbsync.html';
12
12
 
13
- const isSecureWindow = () => getWindowSelf().location.protocol === 'https:';
14
- const isMainPageAccessible = () => getMostAccessibleTopWindow() === getWindowTop();
15
-
16
- function getMostAccessibleTopWindow() {
17
- let res = getWindowSelf();
18
-
19
- try {
20
- while (getWindowTop().top !== res && res.parent.location.href.length) {
21
- res = res.parent;
22
- }
23
- } catch (ignore) {
24
- }
25
-
26
- return res;
27
- }
28
-
29
- function elementInView(elementId) {
30
- const resolveElement = (elId) => {
31
- const win = getWindowSelf();
32
-
33
- return win.document.getElementById(elId);
34
- };
35
-
36
- const visibleInWindow = (el, win) => {
37
- const rect = el.getBoundingClientRect();
38
- const inView = (rect.top + rect.height >= 0) && (rect.top <= win.innerHeight);
39
-
40
- if (win !== win.parent) {
41
- return inView && visibleInWindow(win.frameElement, win.parent);
42
- }
43
-
44
- return inView;
45
- };
46
-
47
- try {
48
- return visibleInWindow(resolveElement(elementId), getWindowSelf());
49
- } catch (e) {
50
- // old browser, element not found, cross-origin etc.
51
- }
52
- return undefined;
53
- }
54
-
55
- function _buildUrl({host: hostname = DEFAULT_HOST, port = DEFAULT_PORT, securePort, path: pathname = DEFAULT_PATH}) {
56
- if (securePort) {
57
- port = securePort;
58
- }
59
-
60
- return buildUrl({protocol: 'https', hostname, port, pathname});
61
- }
62
-
63
- function getGdprParams(gdprConsent) {
64
- if (gdprConsent) {
65
- const consentString = encodeURIComponent(gdprConsent.consentString || '')
66
- const isGdpr = gdprConsent.gdprApplies ? 1 : 0;
67
-
68
- return `?gdpr=${isGdpr}&gdpr_consent=${consentString}`
69
- } else {
70
- return '';
71
- }
72
- }
73
-
74
13
  export const spec = {
75
14
  code: BIDDER_CODE,
76
15
  gvlid: GVL_ID,
77
- supportedMediaTypes: [BANNER],
16
+ supportedMediaTypes: [BANNER, VIDEO],
78
17
 
79
18
  isBidRequestValid: (function () {
80
19
  const validators = [];
81
20
 
82
- const createValidator = (checkFn, errorMsgFn) => {
21
+ const createValidator = (checkFn, msg) => {
83
22
  return (bidRequest) => {
84
23
  if (checkFn(bidRequest)) {
85
24
  return true;
86
25
  } else {
87
- logError(`invalid bid: ${errorMsgFn(bidRequest)}`, 'ERROR');
26
+ logWarn(`${BIDDER_CODE}: Bid setup for ${bidRequest.adUnitCode} is invalid: ${msg}`);
88
27
  return false;
89
28
  }
90
29
  }
91
30
  };
92
31
 
93
- function isBanner(bidReq) {
94
- return (!bidReq.mediaTypes && !bidReq.mediaType) ||
95
- (bidReq.mediaTypes && bidReq.mediaTypes.banner) ||
96
- bidReq.mediaType === BANNER;
97
- }
32
+ const hasValidMediaType = bidReq => hasBanner(bidReq) || hasVideo(bidReq);
98
33
 
99
- validators.push(createValidator((bidReq) => isBanner(bidReq),
100
- bidReq => `bid request ${bidReq.bidId} is not a banner`));
34
+ validators.push(createValidator((bidReq) => hasValidMediaType(bidReq),
35
+ 'the media type is invalid'));
101
36
  validators.push(createValidator((bidReq) => typeof bidReq.params === 'object',
102
- bidReq => `bid request ${bidReq.bidId} does not have custom params`));
37
+ 'the custom params does not exist'));
103
38
  validators.push(createValidator((bidReq) => isStr(bidReq.params.sid),
104
- bidReq => `bid request ${bidReq.bidId} does not have a sid string field`));
39
+ 'the sid field must be a string'));
105
40
 
106
41
  return function (bidRequest) {
107
42
  return validators.every(f => f(bidRequest));
@@ -113,9 +48,8 @@ export const spec = {
113
48
 
114
49
  const refererInfo = bidderRequest.refererInfo;
115
50
 
116
- const payload = {
51
+ const basePayload = {
117
52
  id: bidderRequest.auctionId,
118
- bids: [],
119
53
  ref: refererInfo.ref,
120
54
  ssl: isSecureWindow(),
121
55
  mpa: isMainPageAccessible(),
@@ -127,7 +61,7 @@ export const spec = {
127
61
  const userIds = anyBid.userId;
128
62
 
129
63
  if (!isEmpty(userIds)) {
130
- payload.user = {
64
+ basePayload.user = {
131
65
  euids: userIds
132
66
  };
133
67
  }
@@ -135,24 +69,24 @@ export const spec = {
135
69
  const gdprConsent = bidderRequest.gdprConsent;
136
70
 
137
71
  if (gdprConsent && gdprConsent.consentString != null && gdprConsent.gdprApplies != null) {
138
- payload.gdpr = {
72
+ basePayload.gdpr = {
139
73
  consent: bidderRequest.gdprConsent.consentString, applies: bidderRequest.gdprConsent.gdprApplies
140
74
  };
141
75
  }
142
76
 
143
- function bidSizes(bid) {
144
- return deepAccess(bid, 'mediaTypes.banner.sizes') || bid.sizes /* for prebid < 3 */ || [];
145
- }
77
+ const bannerBids = validBidRequests
78
+ .filter(hasBanner)
79
+ .map(mapToPayloadBannerBid);
146
80
 
147
- validBidRequests.forEach(bid => {
148
- payload.bids.push({
149
- bid: bid.bidId, sid: bid.params.sid, siz: bidSizes(bid), viz: elementInView(bid.adUnitCode)
150
- });
151
- });
81
+ const videoBids = validBidRequests
82
+ .filter(hasVideo)
83
+ .map(mapToPayloadVideoBid);
152
84
 
153
85
  return {
154
- method: 'POST', url: _buildUrl(anyBid.params), data: payload
155
- }
86
+ method: 'POST',
87
+ url: buildEndpointUrl(anyBid.params),
88
+ data: {...basePayload, bids: [...bannerBids, ...videoBids]}
89
+ };
156
90
  },
157
91
 
158
92
  interpretResponse: function (serverResponse) {
@@ -160,12 +94,13 @@ export const spec = {
160
94
 
161
95
  if (serverResponse.body && typeof serverResponse.body === 'object') {
162
96
  serverResponse.body.bids.forEach(bidResponse => {
163
- bids.push({
97
+ const mediaType = bidResponse.vastXml != null ? VIDEO : BANNER;
98
+
99
+ const bid = {
164
100
  requestId: bidResponse.bidId,
165
101
  cpm: bidResponse.cpm || 0,
166
102
  width: bidResponse.width || 0,
167
103
  height: bidResponse.height || 0,
168
- ad: bidResponse.ad,
169
104
  ttl: FIVE_MINUTES_IN_SECONDS,
170
105
  currency: 'EUR',
171
106
  netRevenue: true,
@@ -173,7 +108,16 @@ export const spec = {
173
108
  meta: {
174
109
  advertiserDomains: bidResponse.adomain
175
110
  },
176
- });
111
+ mediaType,
112
+ };
113
+
114
+ if (mediaType === VIDEO) {
115
+ bid.vastXml = bidResponse.vastXml;
116
+ } else {
117
+ bid.ad = bidResponse.ad;
118
+ }
119
+
120
+ bids.push(bid);
177
121
  });
178
122
  }
179
123
 
@@ -192,4 +136,97 @@ export const spec = {
192
136
  }
193
137
  };
194
138
 
139
+ const isSecureWindow = () => getWindowSelf().location.protocol === 'https:';
140
+
141
+ const isMainPageAccessible = () => {
142
+ try {
143
+ return !!getWindowTop().location.href;
144
+ } catch (ignore) {
145
+ return false;
146
+ }
147
+ }
148
+
149
+ const elementInView = (elementId) => {
150
+ const resolveElement = (elId) => {
151
+ const win = getWindowSelf();
152
+
153
+ return win.document.getElementById(elId);
154
+ };
155
+
156
+ const visibleInWindow = (el, win) => {
157
+ const rect = el.getBoundingClientRect();
158
+ const inView = (rect.top + rect.height >= 0) && (rect.top <= win.innerHeight);
159
+
160
+ if (win !== win.parent) {
161
+ return inView && visibleInWindow(win.frameElement, win.parent);
162
+ }
163
+
164
+ return inView;
165
+ };
166
+
167
+ try {
168
+ return visibleInWindow(resolveElement(elementId), getWindowSelf());
169
+ } catch (e) {
170
+ // old browser, element not found, cross-origin etc.
171
+ }
172
+ return undefined;
173
+ }
174
+
175
+ const buildEndpointUrl = ({host: hostname = DEFAULT_HOST, port = DEFAULT_PORT, securePort, path: pathname = DEFAULT_PATH}) => {
176
+ if (securePort) {
177
+ port = securePort;
178
+ }
179
+
180
+ return buildUrl({protocol: 'https', hostname, port, pathname});
181
+ }
182
+
183
+ const getGdprParams = gdprConsent => {
184
+ if (gdprConsent) {
185
+ const consentString = encodeURIComponent(gdprConsent.consentString || '')
186
+ const isGdpr = gdprConsent.gdprApplies ? 1 : 0;
187
+
188
+ return `?gdpr=${isGdpr}&gdpr_consent=${consentString}`
189
+ } else {
190
+ return '';
191
+ }
192
+ }
193
+
194
+ const hasBanner = bidReq => {
195
+ return (!bidReq.mediaTypes && !bidReq.mediaType) ||
196
+ (bidReq.mediaTypes && bidReq.mediaTypes.banner) ||
197
+ bidReq.mediaType === BANNER;
198
+ }
199
+
200
+ const hasVideo = bidReq => {
201
+ const mediaTypes = bidReq.mediaTypes;
202
+ return mediaTypes &&
203
+ mediaTypes.video &&
204
+ ['instream', 'outstream'].indexOf(mediaTypes.video.context) > -1;
205
+ };
206
+
207
+ const mapToPayloadBaseBid = (bidRequest) => ({
208
+ bid: bidRequest.bidId,
209
+ sid: bidRequest.params.sid,
210
+ viz: elementInView(bidRequest.adUnitCode),
211
+ });
212
+
213
+ const mapToPayloadBannerBid = (bidRequest) => ({
214
+ ban: {
215
+ siz: deepAccess(bidRequest, 'mediaTypes.banner.sizes') || [],
216
+ },
217
+ ...mapToPayloadBaseBid(bidRequest)
218
+ });
219
+
220
+ const mapToPayloadVideoBid = (bidRequest) => {
221
+ const video = deepAccess(bidRequest, 'mediaTypes.video') || {};
222
+ return {
223
+ vid: {
224
+ ctx: video.context,
225
+ siz: video.playerSize,
226
+ mim: video.mimes,
227
+ },
228
+ ...mapToPayloadBaseBid(bidRequest)
229
+ };
230
+ };
231
+
195
232
  registerBidder(spec);
@@ -6,26 +6,64 @@ Module Type: Bidder Adapter
6
6
  Maintainer: help@cz.stroeer-labs.com
7
7
  ```
8
8
 
9
+ ### Bid Params
9
10
 
10
- ## Ad unit configuration for publishers
11
+ | Name | Scope | Description | Example | Type |
12
+ |---------------|----------|--------------------|-----------------------------------------|----------|
13
+ | `sid` | required | Slot ID | `'06b782cc-091b-4f53-9cd2-0291679aa1ac'`| `string` |
14
+
15
+ ### Ad Unit Configuration
16
+
17
+ #### Banner
18
+
19
+ * The server will ignore sizes that are not supported by the slot or by the platform (such as 987x123).
20
+
21
+ ##### Example
11
22
 
12
23
  ```javascript
13
- const adUnits = [{
14
- code: 'div-gpt-ad-1460505748561-0',
24
+ var adUnits = [
25
+ {
26
+ code: 'your-banner-adunit-code',
15
27
  mediaTypes: {
16
- banner: {
17
- sizes: [[300, 250]],
18
- }
28
+ banner: {
29
+ sizes: [[300, 250]],
30
+ }
19
31
  },
20
32
  bids: [{
21
- bidder: 'stroeerCore',
22
- params: {
23
- sid: "06b782cc-091b-4f53-9cd2-0291679aa1ac"
24
- }
33
+ bidder: 'stroeerCore',
34
+ params: {
35
+ sid: '06b782cc-091b-4f53-9cd2-0291679aa1ac'
36
+ }
25
37
  }]
26
- }];
38
+ }
39
+ ];
27
40
  ```
28
- ### Config Notes
29
41
 
30
- * Slot id (`sid`) is required. The adapter will ignore bid requests from prebid if `sid` is not provided. This must be in the decoded form. For example, "1234" as opposed to "MTM0ODA=".
31
- * The server ignores dimensions that are not supported by the slot or by the platform (such as 987x123).
42
+ #### Video
43
+
44
+ * Both instream and outstream contexts are supported.
45
+ * We do not provide an outstream renderer. You will need to set up your own. See [Show Outstream Video Ads](https://docs.prebid.org/dev-docs/show-outstream-video-ads.html) for more information.
46
+ * On `mediaTypes.video`, the fields `context` and `mediaTypes` are required.
47
+
48
+ ##### Example
49
+
50
+ ```javascript
51
+ var adUnits = [
52
+ {
53
+ code: 'your-video-adunit-code',
54
+ mediaTypes: {
55
+ video: {
56
+ context: 'instream',
57
+ playerSize: [640, 480],
58
+ mimes: ['video/mp4', 'video/quicktime', 'video/x-ms-wmv']
59
+ }
60
+ },
61
+ bids: [{
62
+ bidder: 'stroeerCore',
63
+ params: {
64
+ sid: '35d4225e-f8e3-4f45-b1ea-77913afd00d1'
65
+ }
66
+ }]
67
+ }
68
+ ];
69
+ ```
@@ -54,7 +54,7 @@ export const spec = {
54
54
  data: bids,
55
55
  deviceWidth: screen.width,
56
56
  hb_version: '$prebid.version$',
57
- ...getUnifiedId2Parameter(deepAccess(validBidRequests, '0.userId.uid2')),
57
+ ...getSharedViewerIdParameters(validBidRequests),
58
58
  ...getFirstPartyTeadsIdParameter()
59
59
  };
60
60
 
@@ -124,6 +124,37 @@ export const spec = {
124
124
  }
125
125
  };
126
126
 
127
+ /**
128
+ *
129
+ * @param validBidRequests an array of bids
130
+ * @returns {{sharedViewerIdKey : 'sharedViewerIdValue'}} object with all sharedviewerids
131
+ */
132
+ function getSharedViewerIdParameters(validBidRequests) {
133
+ const sharedViewerIdMapping = {
134
+ unifiedId2: 'uid2.id', // uid2IdSystem
135
+ liveRampId: 'idl_env', // identityLinkIdSystem
136
+ lotamePanoramaId: 'lotamePanoramaId', // lotamePanoramaIdSystem
137
+ id5Id: 'id5id.uid', // id5IdSystem
138
+ criteoId: 'criteoId', // criteoIdSystem
139
+ yahooConnectId: 'connectId', // connectIdSystem
140
+ quantcastId: 'quantcastId', // quantcastIdSystem
141
+ epsilonPublisherLinkId: 'publinkId', // publinkIdSystem
142
+ publisherFirstPartyViewerId: 'pubcid', // sharedIdSystem
143
+ merkleId: 'merkleId.id', // merkleIdSystem
144
+ kinessoId: 'kpuid' // kinessoIdSystem
145
+ }
146
+
147
+ let sharedViewerIdObject = {};
148
+ for (const sharedViewerId in sharedViewerIdMapping) {
149
+ const key = sharedViewerIdMapping[sharedViewerId];
150
+ const value = deepAccess(validBidRequests, `0.userId.${key}`);
151
+ if (value) {
152
+ sharedViewerIdObject[sharedViewerId] = value;
153
+ }
154
+ }
155
+ return sharedViewerIdObject;
156
+ }
157
+
127
158
  function getReferrerInfo(bidderRequest) {
128
159
  let ref = '';
129
160
  if (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.page) {
@@ -228,15 +259,6 @@ function _validateId(id) {
228
259
  return (parseInt(id) > 0);
229
260
  }
230
261
 
231
- /**
232
- * Get unified ID v2 parameter to be sent in bid request.
233
- * @param `{id: string} | undefined` optionalUid2 uid2 user ID object available if "uid2IdSystem" module is enabled.
234
- * @returns `{} | {unifiedId2: string}`
235
- */
236
- function getUnifiedId2Parameter(optionalUid2) {
237
- return optionalUid2 ? { unifiedId2: optionalUid2.id } : {};
238
- }
239
-
240
262
  /**
241
263
  * Get the first-party cookie Teads ID parameter to be sent in bid request.
242
264
  * @returns `{} | {firstPartyCookieTeadsId: string}`
@@ -1,4 +1,4 @@
1
- import { generateUUID, _each } from '../src/utils.js';
1
+ import { generateUUID, _each, deepAccess } from '../src/utils.js';
2
2
  import {registerBidder} from '../src/adapters/bidderFactory.js';
3
3
  import {BANNER, VIDEO, NATIVE} from '../src/mediaTypes.js';
4
4
  import { getStorageManager } from '../src/storageManager.js';
@@ -251,6 +251,7 @@ function getRequestData(bid, bidderRequest) {
251
251
  const userIdTdid = (bid.userId && bid.userId.tdid) ? bid.userId.tdid : '';
252
252
  const supplyChain = getSupplyChain(bid.schain);
253
253
  const bidFloor = getFloor(bid, size, bid.mediaTypes);
254
+ const gpid = deepAccess(bid, 'ortb2Imp.ext.gpid');
254
255
  // general bid data
255
256
  let bidData = {
256
257
  ver: VER,
@@ -267,17 +268,15 @@ function getRequestData(bid, bidderRequest) {
267
268
  bidData.fp = bidFloor;
268
269
  }
269
270
 
270
- addUserId(bidData, bid.userId);
271
- // TODO: is 'page' the right value here? does the fallback make sense?
272
- bidData.u = bidderRequest?.refererInfo?.page || bidderRequest?.refererInfo?.topmostLocation;
273
- try {
274
- bidData.host = window.top.location.hostname;
275
- bidData.xr = 0;
276
- } catch (e) {
277
- bidData.host = window.location.hostname;
278
- bidData.xr = 1;
271
+ if (gpid) {
272
+ bidData.gpid = gpid;
279
273
  }
280
274
 
275
+ addUserId(bidData, bid.userId);
276
+
277
+ bidData.u = bidderRequest.refererInfo.page || bidderRequest.refererInfo.topmostLocation;
278
+ bidData.host = bidderRequest.refererInfo.domain;
279
+
281
280
  if (window.location.ancestorOrigins && window.location.ancestorOrigins.length > 0) {
282
281
  bidData.ao = window.location.ancestorOrigins[window.location.ancestorOrigins.length - 1];
283
282
  }