prebid.js 6.0.0 → 6.4.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 (201) hide show
  1. package/.babelrc.js +1 -7
  2. package/.circleci/config.yml +1 -1
  3. package/README.md +1 -1
  4. package/browsers.json +13 -29
  5. package/gulpfile.js +88 -82
  6. package/integrationExamples/gpt/weboramaRtdProvider_example.html +23 -14
  7. package/karma.conf.maker.js +2 -2
  8. package/modules/33acrossBidAdapter.js +189 -102
  9. package/modules/adagioBidAdapter.js +1 -1
  10. package/modules/addefendBidAdapter.js +1 -0
  11. package/modules/adheseBidAdapter.js +7 -2
  12. package/modules/adkernelBidAdapter.js +147 -61
  13. package/modules/adlivetechBidAdapter.md +61 -0
  14. package/modules/adlooxAdServerVideo.js +2 -2
  15. package/modules/adlooxAnalyticsAdapter.js +4 -4
  16. package/modules/admanBidAdapter.js +1 -0
  17. package/modules/admixerBidAdapter.js +3 -2
  18. package/modules/adnuntiusBidAdapter.js +5 -2
  19. package/modules/adomikAnalyticsAdapter.js +16 -4
  20. package/modules/adplusBidAdapter.js +203 -0
  21. package/modules/adplusBidAdapter.md +39 -0
  22. package/modules/adxcgBidAdapter.js +311 -359
  23. package/modules/adxcgBidAdapter.md +22 -21
  24. package/modules/adyoulikeBidAdapter.js +7 -2
  25. package/modules/aniviewBidAdapter.js +1 -1
  26. package/modules/appnexusBidAdapter.js +23 -3
  27. package/modules/beachfrontBidAdapter.js +14 -17
  28. package/modules/beopBidAdapter.js +6 -4
  29. package/modules/bidViewability.js +3 -3
  30. package/modules/bidViewabilityIO.js +3 -3
  31. package/modules/codefuelBidAdapter.js +1 -3
  32. package/modules/codefuelBidAdapter.md +3 -3
  33. package/modules/colossussspBidAdapter.js +7 -0
  34. package/modules/compassBidAdapter.js +201 -0
  35. package/modules/compassBidAdapter.md +79 -0
  36. package/modules/craftBidAdapter.js +5 -3
  37. package/modules/criteoBidAdapter.js +1 -1
  38. package/modules/currency.js +2 -2
  39. package/modules/cwireBidAdapter.js +3 -0
  40. package/modules/dailyhuntBidAdapter.js +435 -0
  41. package/modules/dailyhuntBidAdapter.md +4 -0
  42. package/modules/datablocksBidAdapter.js +3 -3
  43. package/modules/dchain.js +149 -0
  44. package/modules/dchain.md +45 -0
  45. package/modules/deepintentBidAdapter.js +1 -1
  46. package/modules/dspxBidAdapter.js +1 -1
  47. package/modules/emx_digitalBidAdapter.js +9 -1
  48. package/modules/engageyaBidAdapter.js +68 -54
  49. package/modules/feedadBidAdapter.js +2 -2
  50. package/modules/feedadBidAdapter.md +4 -2
  51. package/modules/freewheel-sspBidAdapter.js +6 -0
  52. package/modules/futureads.md +48 -0
  53. package/modules/glimpseBidAdapter.js +44 -16
  54. package/modules/goldbachBidAdapter.js +1176 -0
  55. package/modules/goldbachBidAdapter.md +151 -0
  56. package/modules/gptPreAuction.js +11 -5
  57. package/modules/gridBidAdapter.js +5 -4
  58. package/modules/gumgumBidAdapter.js +7 -3
  59. package/modules/id5IdSystem.md +6 -6
  60. package/modules/imRtdProvider.js +31 -0
  61. package/modules/improvedigitalBidAdapter.js +19 -3
  62. package/modules/instreamTracking.js +4 -4
  63. package/modules/intersectionRtdProvider.js +114 -0
  64. package/modules/invibesBidAdapter.js +64 -14
  65. package/modules/invibesBidAdapter.md +2 -1
  66. package/modules/ipromBidAdapter.js +79 -0
  67. package/modules/ixBidAdapter.js +185 -22
  68. package/modules/kinessoIdSystem.js +1 -1
  69. package/modules/limelightDigitalBidAdapter.js +2 -1
  70. package/modules/livewrappedBidAdapter.js +8 -2
  71. package/modules/lotamePanoramaIdSystem.js +80 -8
  72. package/modules/luponmediaBidAdapter.js +570 -0
  73. package/modules/mediasquareBidAdapter.js +1 -9
  74. package/modules/merkleIdSystem.js +5 -0
  75. package/modules/missenaBidAdapter.js +89 -0
  76. package/modules/nativoBidAdapter.js +27 -1
  77. package/modules/nextMillenniumBidAdapter.js +37 -7
  78. package/modules/oguryBidAdapter.js +2 -1
  79. package/modules/openxBidAdapter.js +6 -1
  80. package/modules/prebidServerBidAdapter/index.js +19 -15
  81. package/modules/pubgeniusBidAdapter.js +1 -1
  82. package/modules/pubmaticBidAdapter.js +5 -3
  83. package/modules/pubxaiAnalyticsAdapter.js +17 -0
  84. package/modules/relaidoBidAdapter.js +86 -65
  85. package/modules/richaudienceBidAdapter.js +2 -3
  86. package/modules/rtdModule/index.js +48 -18
  87. package/modules/rubiconBidAdapter.js +31 -19
  88. package/modules/saambaaBidAdapter.js +420 -0
  89. package/modules/saambaaBidAdapter.md +65 -68
  90. package/modules/seedtagBidAdapter.js +6 -0
  91. package/modules/sharedIdSystem.js +27 -1
  92. package/modules/smaatoBidAdapter.js +9 -1
  93. package/modules/smartxBidAdapter.js +17 -1
  94. package/modules/sspBCBidAdapter.js +34 -3
  95. package/modules/tappxBidAdapter.js +3 -1
  96. package/modules/targetVideoBidAdapter.js +187 -0
  97. package/modules/targetVideoBidAdapter.md +34 -0
  98. package/modules/telariaBidAdapter.js +2 -2
  99. package/modules/trustxBidAdapter.js +18 -17
  100. package/modules/undertoneBidAdapter.js +8 -1
  101. package/modules/userId/index.js +27 -2
  102. package/modules/ventes.md +71 -0
  103. package/modules/ventesBidAdapter.js +104 -64
  104. package/modules/ventesBidAdapter.md +0 -1
  105. package/modules/vidoomyBidAdapter.js +65 -108
  106. package/modules/visxBidAdapter.js +20 -3
  107. package/modules/visxBidAdapter.md +4 -6
  108. package/modules/weboramaRtdProvider.js +288 -73
  109. package/modules/weboramaRtdProvider.md +27 -10
  110. package/modules/yahoosspBidAdapter.js +5 -1
  111. package/modules/yahoosspBidAdapter.md +1 -1
  112. package/modules/yieldlabBidAdapter.js +41 -10
  113. package/modules/yieldlabBidAdapter.md +91 -48
  114. package/modules/yieldoneBidAdapter.js +115 -11
  115. package/modules/zetaSspBidAdapter.md +33 -1
  116. package/modules/zeta_global_sspBidAdapter.js +22 -1
  117. package/package.json +6 -1
  118. package/plugins/pbjsGlobals.js +28 -1
  119. package/src/adapterManager.js +14 -8
  120. package/src/auction.js +5 -4
  121. package/src/prebid.js +1 -2
  122. package/src/targeting.js +24 -3
  123. package/src/utils.js +41 -7
  124. package/test/helpers/prebidGlobal.js +1 -0
  125. package/test/spec/integration/faker/googletag.js +6 -0
  126. package/test/spec/modules/33acrossBidAdapter_spec.js +300 -78
  127. package/test/spec/modules/adheseBidAdapter_spec.js +27 -1
  128. package/test/spec/modules/adlooxAnalyticsAdapter_spec.js +6 -6
  129. package/test/spec/modules/adnuntiusBidAdapter_spec.js +35 -0
  130. package/test/spec/modules/adomikAnalyticsAdapter_spec.js +9 -1
  131. package/test/spec/modules/adplusBidAdapter_spec.js +213 -0
  132. package/test/spec/modules/adxcgBidAdapter_spec.js +820 -571
  133. package/test/spec/modules/adyoulikeBidAdapter_spec.js +26 -0
  134. package/test/spec/modules/appnexusBidAdapter_spec.js +63 -1
  135. package/test/spec/modules/beachfrontBidAdapter_spec.js +65 -1
  136. package/test/spec/modules/beopBidAdapter_spec.js +1 -1
  137. package/test/spec/modules/bidViewabilityIO_spec.js +2 -2
  138. package/test/spec/modules/bidViewability_spec.js +4 -4
  139. package/test/spec/modules/codefuelBidAdapter_spec.js +1 -1
  140. package/test/spec/modules/colossussspBidAdapter_spec.js +9 -0
  141. package/test/spec/modules/compassBidAdapter_spec.js +397 -0
  142. package/test/spec/modules/cwireBidAdapter_spec.js +10 -8
  143. package/test/spec/modules/dailyhuntBidAdapter_spec.js +404 -0
  144. package/test/spec/modules/datablocksBidAdapter_spec.js +3 -3
  145. package/test/spec/modules/dchain_spec.js +329 -0
  146. package/test/spec/modules/emx_digitalBidAdapter_spec.js +10 -0
  147. package/test/spec/modules/engageyaBidAdapter_spec.js +231 -95
  148. package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
  149. package/test/spec/modules/feedadBidAdapter_spec.js +15 -0
  150. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
  151. package/test/spec/modules/glimpseBidAdapter_spec.js +33 -0
  152. package/test/spec/modules/goldbachBidAdapter_spec.js +1359 -0
  153. package/test/spec/modules/gptPreAuction_spec.js +58 -4
  154. package/test/spec/modules/gumgumBidAdapter_spec.js +6 -0
  155. package/test/spec/modules/imRtdProvider_spec.js +25 -0
  156. package/test/spec/modules/improvedigitalBidAdapter_spec.js +3 -1
  157. package/test/spec/modules/intersectionRtdProvider_spec.js +141 -0
  158. package/test/spec/modules/invibesBidAdapter_spec.js +148 -4
  159. package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
  160. package/test/spec/modules/ixBidAdapter_spec.js +293 -2
  161. package/test/spec/modules/konduitWrapper_spec.js +0 -1
  162. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +10 -7
  163. package/test/spec/modules/livewrappedBidAdapter_spec.js +31 -0
  164. package/test/spec/modules/lotamePanoramaIdSystem_spec.js +227 -0
  165. package/test/spec/modules/luponmediaBidAdapter_spec.js +412 -0
  166. package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -4
  167. package/test/spec/modules/merkleIdSystem_spec.js +18 -0
  168. package/test/spec/modules/missenaBidAdapter_spec.js +134 -0
  169. package/test/spec/modules/nativoBidAdapter_spec.js +35 -18
  170. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +26 -1
  171. package/test/spec/modules/oguryBidAdapter_spec.js +13 -11
  172. package/test/spec/modules/openxBidAdapter_spec.js +5 -0
  173. package/test/spec/modules/prebidServerBidAdapter_spec.js +62 -2
  174. package/test/spec/modules/pubgeniusBidAdapter_spec.js +3 -3
  175. package/test/spec/modules/pubmaticBidAdapter_spec.js +1 -1
  176. package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +11 -0
  177. package/test/spec/modules/realTimeDataModule_spec.js +135 -49
  178. package/test/spec/modules/relaidoBidAdapter_spec.js +71 -63
  179. package/test/spec/modules/richaudienceBidAdapter_spec.js +2 -2
  180. package/test/spec/modules/rubiconBidAdapter_spec.js +65 -9
  181. package/test/spec/modules/seedtagBidAdapter_spec.js +3 -0
  182. package/test/spec/modules/sharedIdSystem_spec.js +52 -6
  183. package/test/spec/modules/smaatoBidAdapter_spec.js +61 -0
  184. package/test/spec/modules/smartxBidAdapter_spec.js +9 -0
  185. package/test/spec/modules/sspBCBidAdapter_spec.js +33 -3
  186. package/test/spec/modules/tappxBidAdapter_spec.js +4 -0
  187. package/test/spec/modules/targetVideoBidAdapter_spec.js +96 -0
  188. package/test/spec/modules/trustxBidAdapter_spec.js +42 -0
  189. package/test/spec/modules/userId_spec.js +51 -0
  190. package/test/spec/modules/vidoomyBidAdapter_spec.js +32 -13
  191. package/test/spec/modules/visxBidAdapter_spec.js +121 -5
  192. package/test/spec/modules/weboramaRtdProvider_spec.js +408 -214
  193. package/test/spec/modules/yahoosspBidAdapter_spec.js +28 -1
  194. package/test/spec/modules/yieldlabBidAdapter_spec.js +81 -0
  195. package/test/spec/modules/yieldoneBidAdapter_spec.js +299 -53
  196. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +33 -1
  197. package/test/spec/unit/core/adapterManager_spec.js +24 -6
  198. package/test/spec/unit/core/targeting_spec.js +116 -0
  199. package/test/spec/utils_spec.js +38 -0
  200. package/test/test_deps.js +3 -0
  201. package/test/test_index.js +1 -3
@@ -0,0 +1,151 @@
1
+ #Overview
2
+
3
+ ```
4
+ Module Name: Goldbach Bid Adapter
5
+ Module Type: Bidder Adapter
6
+ Maintainer: dusan.veljovic@goldbach.com
7
+ ```
8
+
9
+ # Description
10
+
11
+ Connects to Xandr exchange for bids.
12
+
13
+ Goldbach bid adapter supports Banner, Video (instream and outstream) and Native.
14
+
15
+ # Test Parameters
16
+ ```
17
+ var adUnits = [
18
+ // Banner adUnit
19
+ {
20
+ code: 'banner-div',
21
+ mediaTypes: {
22
+ banner: {
23
+ sizes: [[300, 250], [300,600]]
24
+ }
25
+ },
26
+ bids: [{
27
+ bidder: 'goldbach',
28
+ params: {
29
+ placementId: 13144370
30
+ }
31
+ }]
32
+ },
33
+ // Native adUnit
34
+ {
35
+ code: 'native-div',
36
+ sizes: [[1, 1]],
37
+ mediaTypes: {
38
+ native: {
39
+ title: {
40
+ required: true
41
+ },
42
+ body: {
43
+ required: true
44
+ },
45
+ image: {
46
+ required: true
47
+ },
48
+ sponsoredBy: {
49
+ required: true
50
+ },
51
+ icon: {
52
+ required: false
53
+ }
54
+ }
55
+ },
56
+ bids: [{
57
+ bidder: 'goldbach',
58
+ params: {
59
+ placementId: 13232354,
60
+ allowSmallerSizes: true
61
+ }
62
+ }]
63
+ },
64
+ // Video instream adUnit
65
+ {
66
+ code: 'video-instream',
67
+ sizes: [[640, 480]],
68
+ mediaTypes: {
69
+ video: {
70
+ playerSize: [[640, 480]],
71
+ context: 'instream'
72
+ },
73
+ },
74
+ bids: [{
75
+ goldbach: 'goldbach',
76
+ params: {
77
+ placementId: 13232361,
78
+ video: {
79
+ skippable: true,
80
+ playback_methods: ['auto_play_sound_off']
81
+ }
82
+ }
83
+ }]
84
+ },
85
+ // Video outstream adUnit
86
+ {
87
+ code: 'video-outstream',
88
+ sizes: [[300, 250]],
89
+ mediaTypes: {
90
+ video: {
91
+ playerSize: [[300, 250]],
92
+ context: 'outstream',
93
+ // Certain ORTB 2.5 video values can be read from the mediatypes object; below are examples of supported params.
94
+ // To note - goldbach supports additional values for our system that are not part of the ORTB spec. If you want
95
+ // to use these values, they will have to be declared in the bids[].params.video object instead using the goldbach syntax.
96
+ // Between the corresponding values of the mediaTypes.video and params.video objects, the properties in params.video will
97
+ // take precedence if declared; eg in the example below, the `skippable: true` setting will be used instead of the `skip: 0`.
98
+ minduration: 1,
99
+ maxduration: 60,
100
+ skip: 0, // 1 - true, 0 - false
101
+ skipafter: 5,
102
+ playbackmethod: [2], // note - we only support options 1-4 at this time
103
+ api: [1,2,3] // note - option 6 is not supported at this time
104
+ }
105
+ },
106
+ bids: [
107
+ {
108
+ bidder: 'goldbach',
109
+ params: {
110
+ placementId: 13232385,
111
+ video: {
112
+ skippable: true,
113
+ playback_method: 'auto_play_sound_off'
114
+ }
115
+ }
116
+ }
117
+ ]
118
+ },
119
+ // Banner adUnit in a App Webview
120
+ // Only use this for situations where prebid.js is in a webview of an App
121
+ // See Prebid Mobile for displaying ads via an SDK
122
+ {
123
+ code: 'banner-div',
124
+ mediaTypes: {
125
+ banner: {
126
+ sizes: [[300, 250], [300,600]]
127
+ }
128
+ }
129
+ bids: [{
130
+ bidder: 'goldbach',
131
+ params: {
132
+ placementId: 13144370,
133
+ app: {
134
+ id: "B1O2W3M4AN.com.prebid.webview",
135
+ geo: {
136
+ lat: 40.0964439,
137
+ lng: -75.3009142
138
+ },
139
+ device_id: {
140
+ idfa: "4D12078D-3246-4DA4-AD5E-7610481E7AE", // Apple advertising identifier
141
+ aaid: "38400000-8cf0-11bd-b23e-10b96e40000d", // Android advertising identifier
142
+ md5udid: "5756ae9022b2ea1e47d84fead75220c8", // MD5 hash of the ANDROID_ID
143
+ sha1udid: "4DFAA92388699AC6539885AEF1719293879985BF", // SHA1 hash of the ANDROID_ID
144
+ windowsadid: "750c6be243f1c4b5c9912b95a5742fc5" // Windows advertising identifier
145
+ }
146
+ }
147
+ }
148
+ }]
149
+ }
150
+ ];
151
+ ```
@@ -55,15 +55,16 @@ export const appendPbAdSlot = adUnit => {
55
55
  const context = adUnit.ortb2Imp.ext.data;
56
56
  const { customPbAdSlot } = _currentConfig;
57
57
 
58
- if (customPbAdSlot) {
59
- context.pbadslot = customPbAdSlot(adUnit.code, deepAccess(context, 'adserver.adslot'));
58
+ // use context.pbAdSlot if set (if someone set it already, it will take precedence over others)
59
+ if (context.pbadslot) {
60
60
  return;
61
61
  }
62
62
 
63
- // use context.pbAdSlot if set
64
- if (context.pbadslot) {
63
+ if (customPbAdSlot) {
64
+ context.pbadslot = customPbAdSlot(adUnit.code, deepAccess(context, 'adserver.adslot'));
65
65
  return;
66
66
  }
67
+
67
68
  // use data attribute 'data-adslotid' if set
68
69
  try {
69
70
  const adUnitCodeDiv = document.getElementById(adUnit.code);
@@ -78,12 +79,17 @@ export const appendPbAdSlot = adUnit => {
78
79
  return;
79
80
  }
80
81
  context.pbadslot = adUnit.code;
82
+ return true;
81
83
  };
82
84
 
83
85
  export const makeBidRequestsHook = (fn, adUnits, ...args) => {
84
86
  appendGptSlots(adUnits);
85
87
  adUnits.forEach(adUnit => {
86
- appendPbAdSlot(adUnit);
88
+ const usedAdUnitCode = appendPbAdSlot(adUnit);
89
+ // gpid should be set to itself if already set, or to what pbadslot was (as long as it was not adUnit code)
90
+ if (!adUnit.ortb2Imp.ext.gpid && !usedAdUnitCode) {
91
+ adUnit.ortb2Imp.ext.gpid = adUnit.ortb2Imp.ext.data.pbadslot;
92
+ }
87
93
  });
88
94
  return fn.call(this, adUnits, ...args);
89
95
  };
@@ -29,7 +29,7 @@ let hasSynced = false;
29
29
 
30
30
  export const spec = {
31
31
  code: BIDDER_CODE,
32
- aliases: ['playwire'],
32
+ aliases: ['playwire', 'adlivetech'],
33
33
  supportedMediaTypes: [ BANNER, VIDEO ],
34
34
  /**
35
35
  * Determines whether or not the given bid request is valid.
@@ -291,10 +291,11 @@ export const spec = {
291
291
  if (!hasSynced && syncOptions.pixelEnabled) {
292
292
  let params = '';
293
293
 
294
- if (gdprConsent && typeof gdprConsent.consentString === 'string') {
294
+ if (gdprConsent) {
295
295
  if (typeof gdprConsent.gdprApplies === 'boolean') {
296
- params += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
297
- } else {
296
+ params += `&gdpr=${Number(gdprConsent.gdprApplies)}`;
297
+ }
298
+ if (typeof gdprConsent.consentString === 'string') {
298
299
  params += `&gdpr_consent=${gdprConsent.consentString}`;
299
300
  }
300
301
  }
@@ -286,7 +286,8 @@ function buildRequests(validBidRequests, bidderRequest) {
286
286
  schain,
287
287
  transactionId,
288
288
  userId = {},
289
- ortb2Imp
289
+ ortb2Imp,
290
+ adUnitCode = ''
290
291
  } = bidRequest;
291
292
  const { currency, floor } = _getFloor(mediaTypes, params.bidfloor, bidRequest);
292
293
  const eids = getEids(userId);
@@ -295,13 +296,16 @@ function buildRequests(validBidRequests, bidderRequest) {
295
296
  let gpid = '';
296
297
 
297
298
  const date = new Date();
298
- const lt = date && date.getTime();
299
- const to = date && date.getTimezoneOffset();
299
+ const lt = date.getTime();
300
+ const to = date.getTimezoneOffset();
300
301
  if (to) {
301
302
  lt && (data.lt = lt);
302
303
  data.to = to;
303
304
  }
304
305
 
306
+ // ADTS-169 add adUnitCode to requests
307
+ if (adUnitCode) data.aun = adUnitCode
308
+
305
309
  // ADTS-134 Retrieve ID envelopes
306
310
  for (const eid in eids) data[eid] = eids[eid];
307
311
 
@@ -1,14 +1,14 @@
1
1
  # ID5 Universal ID
2
2
 
3
- The ID5 Universal ID is a shared, neutral identifier that publishers and ad tech platforms can use to recognise users even in environments where 3rd party cookies are not available. The ID5 Universal ID is designed to respect users' privacy choices and publishers’ preferences throughout the advertising value chain. For more information about the ID5 Universal ID and detailed integration docs, please visit [our documentation](https://support.id5.io/portal/en/kb/articles/prebid-js-user-id-module). We also recommend that you sign up for our [release notes](https://id5.io/universal-id/release-notes) to stay up-to-date with any changes to the implementation of the ID5 Universal ID in Prebid.
3
+ The ID5 ID is a shared, neutral identifier that publishers and ad tech platforms can use to recognise users even in environments where 3rd party cookies are not available. The ID5 ID is designed to respect users' privacy choices and publishers’ preferences throughout the advertising value chain. For more information about the ID5 ID and detailed integration docs, please visit [our documentation](https://support.id5.io/portal/en/kb/articles/prebid-js-user-id-module).
4
4
 
5
- ## ID5 Universal ID Registration
5
+ ## ID5 ID Registration
6
6
 
7
- The ID5 Universal ID is free to use, but requires a simple registration with ID5. Please visit [id5.io/universal-id](https://id5.io/universal-id) to sign up and request your ID5 Partner Number to get started.
7
+ The ID5 ID is free to use, but requires a simple registration with ID5. Please visit [our website](https://id5.io/solutions/#publishers) to sign up and request your ID5 Partner Number to get started.
8
8
 
9
- The ID5 privacy policy is at [https://www.id5.io/platform-privacy-policy](https://www.id5.io/platform-privacy-policy).
9
+ The ID5 privacy policy is at [https://id5.io/platform-privacy-policy](https://id5.io/platform-privacy-policy).
10
10
 
11
- ## ID5 Universal ID Configuration
11
+ ## ID5 ID Configuration
12
12
 
13
13
  First, make sure to add the ID5 submodule to your Prebid.js package with:
14
14
 
@@ -46,7 +46,7 @@ pbjs.setConfig({
46
46
  | Param under userSync.userIds[] | Scope | Type | Description | Example |
47
47
  | --- | --- | --- | --- | --- |
48
48
  | name | Required | String | The name of this module: `"id5Id"` | `"id5Id"` |
49
- | params | Required | Object | Details for the ID5 Universal ID. | |
49
+ | params | Required | Object | Details for the ID5 ID. | |
50
50
  | params.partner | Required | Number | This is the ID5 Partner Number obtained from registering with ID5. | `173` |
51
51
  | params.pd | Optional | String | Partner-supplied data used for linking ID5 IDs across domains. See [our documentation](https://support.id5.io/portal/en/kb/articles/passing-partner-data-to-id5) for details on generating the string. Omit the parameter or leave as an empty string if no data to supply | `"MT1iNTBjY..."` |
52
52
  | params.provider | Optional | String | An identifier provided by ID5 to technology partners who manage Prebid setups on behalf of publishers. Reach out to [ID5](mailto:prebid@id5.io) if you have questions about this parameter | `pubmatic-identity-hub` |
@@ -37,6 +37,34 @@ function setImDataInCookie(value) {
37
37
  );
38
38
  }
39
39
 
40
+ /**
41
+ * @param {string} bidderName
42
+ */
43
+ export function getBidderFunction(bidderName) {
44
+ const biddersFunction = {
45
+ ix: function (bid, data) {
46
+ if (data.im_segments && data.im_segments.length) {
47
+ config.setConfig({
48
+ ix: {firstPartyData: {im_segments: data.im_segments}},
49
+ });
50
+ }
51
+ return bid
52
+ },
53
+ pubmatic: function (bid, data) {
54
+ if (data.im_segments && data.im_segments.length) {
55
+ const dctr = deepAccess(bid, 'params.dctr');
56
+ deepSetValue(
57
+ bid,
58
+ 'params.dctr',
59
+ `${dctr ? dctr + '|' : ''}im_segments=${data.im_segments.join(',')}`
60
+ );
61
+ }
62
+ return bid
63
+ }
64
+ }
65
+ return biddersFunction[bidderName] || null;
66
+ }
67
+
40
68
  export function getCustomBidderFunction(config, bidder) {
41
69
  const overwriteFn = deepAccess(config, `params.overwrites.${bidder}`)
42
70
 
@@ -73,9 +101,12 @@ export function setRealTimeData(bidConfig, moduleConfig, data) {
73
101
 
74
102
  adUnits.forEach(adUnit => {
75
103
  adUnit.bids.forEach(bid => {
104
+ const bidderFunction = getBidderFunction(bid.bidder);
76
105
  const overwriteFunction = getCustomBidderFunction(moduleConfig, bid.bidder);
77
106
  if (overwriteFunction) {
78
107
  overwriteFunction(bid, data, utils, config);
108
+ } else if (bidderFunction) {
109
+ bidderFunction(bid, data);
79
110
  }
80
111
  })
81
112
  });
@@ -11,7 +11,7 @@ const RENDERER_URL = 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js
11
11
  const VIDEO_TARGETING = ['skip', 'skipmin', 'skipafter'];
12
12
 
13
13
  export const spec = {
14
- version: '7.4.0',
14
+ version: '7.5.0',
15
15
  code: BIDDER_CODE,
16
16
  gvlid: 253,
17
17
  aliases: ['id'],
@@ -45,8 +45,24 @@ export const spec = {
45
45
  libVersion: this.version
46
46
  };
47
47
 
48
- if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprConsent.consentString) {
49
- requestParameters.gdpr = bidderRequest.gdprConsent.consentString;
48
+ const gdprConsent = deepAccess(bidderRequest, 'gdprConsent')
49
+ if (gdprConsent) {
50
+ // GDPR Consent String
51
+ if (gdprConsent.consentString) {
52
+ requestParameters.gdpr = gdprConsent.consentString;
53
+ }
54
+
55
+ // Additional Consent String
56
+ const additionalConsent = deepAccess(gdprConsent, 'addtlConsent');
57
+ if (additionalConsent && additionalConsent.indexOf('~') !== -1) {
58
+ // Google Ad Tech Provider IDs
59
+ const atpIds = additionalConsent.substring(additionalConsent.indexOf('~') + 1);
60
+ deepSetValue(
61
+ requestParameters,
62
+ 'user.ext.consented_providers_settings.consented_providers',
63
+ atpIds.split('.').map(id => parseInt(id, 10))
64
+ );
65
+ }
50
66
  }
51
67
 
52
68
  if (bidderRequest && bidderRequest.uspConsent) {
@@ -3,11 +3,11 @@ import { config } from '../src/config.js';
3
3
  import { auctionManager } from '../src/auctionManager.js';
4
4
  import { INSTREAM } from '../src/video.js';
5
5
  import * as events from '../src/events.js';
6
- import { BID_STATUS, EVENTS, TARGETING_KEYS } from '../src/constants.json';
6
+ import CONSTANTS from '../src/constants.json'
7
7
 
8
- const {CACHE_ID, UUID} = TARGETING_KEYS;
9
- const {BID_WON, AUCTION_END} = EVENTS;
10
- const {RENDERED} = BID_STATUS;
8
+ const {CACHE_ID, UUID} = CONSTANTS.TARGETING_KEYS;
9
+ const {BID_WON, AUCTION_END} = CONSTANTS.EVENTS;
10
+ const {RENDERED} = CONSTANTS.BID_STATUS;
11
11
 
12
12
  const INSTREAM_TRACKING_DEFAULT_CONFIG = {
13
13
  enabled: false,
@@ -0,0 +1,114 @@
1
+ import {submodule} from '../src/hook.js';
2
+ import {isFn, logError} from '../src/utils.js';
3
+ import {config} from '../src/config.js';
4
+ import {getGlobal} from '../src/prebidGlobal.js';
5
+ import includes from 'core-js-pure/features/array/includes.js';
6
+ import '../src/adapterManager.js';
7
+ let observerAvailable = true;
8
+ function getIntersectionData(requestBidsObject, onDone, providerConfig, userConsent) {
9
+ const intersectionMap = {};
10
+ const placeholdersMap = {};
11
+ let done = false;
12
+ if (!observerAvailable) return complete();
13
+ const observer = new IntersectionObserver(observerCallback, {threshold: 0.5});
14
+ const adUnitCodes = requestBidsObject.adUnitCodes || [];
15
+ const auctionDelay = config.getConfig('realTimeData.auctionDelay') || 0;
16
+ const waitForIt = providerConfig.waitForIt;
17
+ let adUnits = requestBidsObject.adUnits || getGlobal().adUnits || [];
18
+ if (adUnitCodes.length) {
19
+ adUnits = adUnits.filter(unit => includes(adUnitCodes, unit.code));
20
+ }
21
+ let checkTimeoutId;
22
+ findAndObservePlaceholders();
23
+ if (auctionDelay > 0) {
24
+ setTimeout(complete, auctionDelay);
25
+ }
26
+ function findAndObservePlaceholders() {
27
+ const observed = adUnits.filter((unit) => {
28
+ const code = unit.code;
29
+ if (placeholdersMap[code]) return true;
30
+ const ph = document.getElementById(code);
31
+ if (ph) {
32
+ placeholdersMap[code] = ph;
33
+ observer.observe(ph);
34
+ return true;
35
+ }
36
+ });
37
+ if (
38
+ observed.length === adUnits.length ||
39
+ !waitForIt ||
40
+ auctionDelay <= 0
41
+ ) {
42
+ return;
43
+ }
44
+ checkTimeoutId = setTimeout(findAndObservePlaceholders);
45
+ }
46
+ function observerCallback(entries) {
47
+ let entry = entries.pop();
48
+ while (entry) {
49
+ const target = entry.target;
50
+ const id = target.getAttribute('id');
51
+ if (id) {
52
+ const intersection = intersectionMap[id];
53
+ if (!intersection || intersection.time < entry.time) {
54
+ intersectionMap[id] = {
55
+ 'boundingClientRect': cloneRect(entry.boundingClientRect),
56
+ 'intersectionRect': cloneRect(entry.intersectionRect),
57
+ 'rootRect': cloneRect(entry.rootRect),
58
+ 'intersectionRatio': entry.intersectionRatio,
59
+ 'isIntersecting': entry.isIntersecting,
60
+ 'time': entry.time
61
+ };
62
+ if (adUnits.every(unit => !!intersectionMap[unit.code])) {
63
+ complete();
64
+ }
65
+ }
66
+ }
67
+ entry = entries.pop();
68
+ }
69
+ }
70
+ function complete() {
71
+ if (done) return;
72
+ if (checkTimeoutId) clearTimeout(checkTimeoutId);
73
+ done = true;
74
+ checkTimeoutId = null;
75
+ observer && observer.disconnect();
76
+ adUnits && adUnits.forEach((unit) => {
77
+ const intersection = intersectionMap[unit.code];
78
+ if (intersection && unit.bids) {
79
+ unit.bids.forEach(bid => bid.intersection = intersection);
80
+ }
81
+ });
82
+ onDone();
83
+ }
84
+ }
85
+ function init(moduleConfig) {
86
+ if (!isFn(window.IntersectionObserver)) {
87
+ logError('IntersectionObserver is not defined');
88
+ observerAvailable = false;
89
+ } else {
90
+ observerAvailable = true;
91
+ }
92
+ return observerAvailable;
93
+ }
94
+ function cloneRect(rect) {
95
+ return rect ? {
96
+ 'left': rect.left,
97
+ 'top': rect.top,
98
+ 'right': rect.right,
99
+ 'bottom': rect.bottom,
100
+ 'width': rect.width,
101
+ 'height': rect.height,
102
+ 'x': rect.x,
103
+ 'y': rect.y,
104
+ } : rect;
105
+ }
106
+ export const intersectionSubmodule = {
107
+ name: 'intersection',
108
+ getBidRequestData: getIntersectionData,
109
+ init: init,
110
+ };
111
+ function registerSubModule() {
112
+ submodule('realTimeData', intersectionSubmodule);
113
+ }
114
+ registerSubModule();
@@ -4,7 +4,8 @@ import {getStorageManager} from '../src/storageManager.js';
4
4
 
5
5
  const CONSTANTS = {
6
6
  BIDDER_CODE: 'invibes',
7
- BID_ENDPOINT: 'https://bid.videostep.com/Bid/VideoAdContent',
7
+ BID_ENDPOINT: '.videostep.com/Bid/VideoAdContent',
8
+ BID_SUBDOMAIN: 'https://bid',
8
9
  SYNC_ENDPOINT: 'https://k.r66net.com/GetUserSync',
9
10
  TIME_TO_LIVE: 300,
10
11
  DEFAULT_CURRENCY: 'EUR',
@@ -77,13 +78,15 @@ function isBidRequestValid(bid) {
77
78
  function buildRequest(bidRequests, bidderRequest) {
78
79
  bidderRequest = bidderRequest || {};
79
80
  const _placementIds = [];
80
- let _loginId, _customEndpoint, _userId;
81
+ const _adUnitCodes = [];
82
+ let _customEndpoint, _userId, _domainId;
81
83
  let _ivAuctionStart = bidderRequest.auctionStart || Date.now();
82
84
 
83
85
  bidRequests.forEach(function (bidRequest) {
84
86
  bidRequest.startTime = new Date().getTime();
85
87
  _placementIds.push(bidRequest.params.placementId);
86
- _loginId = _loginId || bidRequest.params.loginId;
88
+ _adUnitCodes.push(bidRequest.adUnitCode);
89
+ _domainId = _domainId || bidRequest.params.domainId;
87
90
  _customEndpoint = _customEndpoint || bidRequest.params.customEndpoint;
88
91
  _customUserSync = _customUserSync || bidRequest.params.customUserSync;
89
92
  _userId = _userId || bidRequest.userId;
@@ -99,7 +102,7 @@ function buildRequest(bidRequests, bidderRequest) {
99
102
  let userIdModel = getUserIds(_userId);
100
103
  let bidParamsJson = {
101
104
  placementIds: _placementIds,
102
- loginId: _loginId,
105
+ adUnitCodes: _adUnitCodes,
103
106
  auctionStartTime: _ivAuctionStart,
104
107
  bidVersion: CONSTANTS.PREBID_VERSION
105
108
  };
@@ -143,9 +146,11 @@ function buildRequest(bidRequests, bidderRequest) {
143
146
  }
144
147
  }
145
148
 
149
+ let endpoint = createEndpoint(_customEndpoint, _domainId, _placementIds);
150
+
146
151
  return {
147
152
  method: CONSTANTS.METHOD,
148
- url: _customEndpoint || CONSTANTS.BID_ENDPOINT,
153
+ url: endpoint,
149
154
  data: data,
150
155
  options: {withCredentials: true},
151
156
  // for POST: { contentType: 'application/json', withCredentials: true }
@@ -181,9 +186,12 @@ function handleResponse(responseObj, bidRequests) {
181
186
  const bidResponses = [];
182
187
  for (let i = 0; i < bidRequests.length; i++) {
183
188
  let bidRequest = bidRequests[i];
189
+ let usedPlacementId = responseObj.UseAdUnitCode === true
190
+ ? bidRequest.params.placementId + '_' + bidRequest.adUnitCode
191
+ : bidRequest.params.placementId;
184
192
 
185
- if (invibes.placementBids.indexOf(bidRequest.params.placementId) > -1) {
186
- logInfo('Invibes Adapter - Placement was previously bid on ' + bidRequest.params.placementId);
193
+ if (invibes.placementBids.indexOf(usedPlacementId) > -1) {
194
+ logInfo('Invibes Adapter - Placement was previously bid on ' + usedPlacementId);
187
195
  continue;
188
196
  }
189
197
 
@@ -191,21 +199,21 @@ function handleResponse(responseObj, bidRequests) {
191
199
  if (responseObj.AdPlacements != null) {
192
200
  for (let j = 0; j < responseObj.AdPlacements.length; j++) {
193
201
  let bidModel = responseObj.AdPlacements[j].BidModel;
194
- if (bidModel != null && bidModel.PlacementId == bidRequest.params.placementId) {
202
+ if (bidModel != null && bidModel.PlacementId == usedPlacementId) {
195
203
  requestPlacement = responseObj.AdPlacements[j];
196
204
  break;
197
205
  }
198
206
  }
199
207
  } else {
200
208
  let bidModel = responseObj.BidModel;
201
- if (bidModel != null && bidModel.PlacementId == bidRequest.params.placementId) {
209
+ if (bidModel != null && bidModel.PlacementId == usedPlacementId) {
202
210
  requestPlacement = responseObj;
203
211
  }
204
212
  }
205
213
 
206
- let bid = createBid(bidRequest, requestPlacement, responseObj.MultipositionEnabled);
214
+ let bid = createBid(bidRequest, requestPlacement, responseObj.MultipositionEnabled, usedPlacementId);
207
215
  if (bid !== null) {
208
- invibes.placementBids.push(bidRequest.params.placementId);
216
+ invibes.placementBids.push(usedPlacementId);
209
217
  bidResponses.push(bid);
210
218
  }
211
219
  }
@@ -213,9 +221,9 @@ function handleResponse(responseObj, bidRequests) {
213
221
  return bidResponses;
214
222
  }
215
223
 
216
- function createBid(bidRequest, requestPlacement, multipositionEnabled) {
224
+ function createBid(bidRequest, requestPlacement, multipositionEnabled, usedPlacementId) {
217
225
  if (requestPlacement === null || requestPlacement.BidModel === null) {
218
- logInfo('Invibes Adapter - Placement not configured for bidding ' + bidRequest.params.placementId);
226
+ logInfo('Invibes Adapter - Placement not configured for bidding ' + usedPlacementId);
219
227
  return null;
220
228
  }
221
229
 
@@ -274,6 +282,48 @@ function createBid(bidRequest, requestPlacement, multipositionEnabled) {
274
282
  };
275
283
  }
276
284
 
285
+ function createEndpoint(customEndpoint, domainId, placementIds) {
286
+ if (customEndpoint != null) {
287
+ return customEndpoint;
288
+ }
289
+
290
+ if (domainId != null) {
291
+ return extractEndpointFromId(domainId - 1000);
292
+ }
293
+
294
+ if (placementIds.length > 0) {
295
+ for (var i = 0; i < placementIds.length; i++) {
296
+ const id = extractFromPlacement(placementIds[i]);
297
+ if (id != null) {
298
+ return extractEndpointFromId(id);
299
+ }
300
+ }
301
+ }
302
+
303
+ return extractEndpointFromId(1);
304
+ }
305
+
306
+ function extractEndpointFromId(domainId) {
307
+ if (domainId < 2) {
308
+ return CONSTANTS.BID_SUBDOMAIN + CONSTANTS.BID_ENDPOINT;
309
+ }
310
+
311
+ return CONSTANTS.BID_SUBDOMAIN + domainId + CONSTANTS.BID_ENDPOINT;
312
+ }
313
+
314
+ function extractFromPlacement(placementId) {
315
+ if (placementId == null) { return null; }
316
+
317
+ var pattern = /_ivbs([0-9]+)/g;
318
+
319
+ var match = pattern.exec(placementId);
320
+ if (match != null && match[1] != null) {
321
+ return parseInt(match[1]);
322
+ }
323
+
324
+ return null;
325
+ }
326
+
277
327
  function addMeta(bidModelMeta) {
278
328
  var meta = {};
279
329
  if (bidModelMeta != null) {
@@ -684,7 +734,7 @@ let keywords = (function () {
684
734
  return kw;
685
735
  }());
686
736
 
687
- // =====================
737
+ // ======================
688
738
 
689
739
  export function resetInvibes() {
690
740
  invibes.optIn = undefined;
@@ -20,7 +20,8 @@ Connect to Invibes for bids.
20
20
  {
21
21
  bidder: 'invibes',
22
22
  params: {
23
- placementId: '12345'
23
+ placementId: '12345',
24
+ domainId: 1001
24
25
  }
25
26
  }
26
27
  ]