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
@@ -1665,70 +1665,6 @@ describe('IndexexchangeAdapter', function () {
1665
1665
  expect(gpid).to.equal(GPID);
1666
1666
  });
1667
1667
 
1668
- it('should still build gpid in request if ortb2Imp.ext.gpid does not exist', function () {
1669
- const AD_UNIT_CODE = '/1111/home';
1670
- const validBids = utils.deepClone(DEFAULT_BANNER_VALID_BID);
1671
- sinon.stub(utils, 'getGptSlotInfoForAdUnitCode')
1672
- .returns({ gptSlot: AD_UNIT_CODE, divId: 'adunit-code-3-div-id' });
1673
- validBids[0].ortb2Imp = {
1674
- ext: {
1675
- data: {
1676
- adserver: {
1677
- name: 'gam',
1678
- adslot: AD_UNIT_CODE
1679
- }
1680
- }
1681
- }
1682
- }
1683
- const requests = spec.buildRequests(validBids, DEFAULT_OPTION);
1684
- const { ext: { gpid } } = JSON.parse(requests[0].data.r).imp[0];
1685
- utils.getGptSlotInfoForAdUnitCode.restore();
1686
- expect(gpid).to.equal(`${AD_UNIT_CODE}#adunit-code-3-div-id`);
1687
- });
1688
-
1689
- it('should not build gpid if divid doesnt exist when ortb2Imp.ext.gpid does not exist', function () {
1690
- const AD_UNIT_CODE = '/1111/home';
1691
- const validBids = utils.deepClone(DEFAULT_BANNER_VALID_BID);
1692
- sinon.stub(utils, 'getGptSlotInfoForAdUnitCode')
1693
- .returns({ gptSlot: AD_UNIT_CODE });
1694
- validBids[0].ortb2Imp = {
1695
- ext: {
1696
- data: {
1697
- adserver: {
1698
- name: 'gam',
1699
- adslot: AD_UNIT_CODE
1700
- }
1701
- }
1702
- }
1703
- }
1704
- const requests = spec.buildRequests(validBids, DEFAULT_OPTION);
1705
- const imp = JSON.parse(requests[0].data.r).imp[0];
1706
- utils.getGptSlotInfoForAdUnitCode.restore();
1707
- expect(imp.ext.gpid).to.be.undefined;
1708
- expect(imp.ext.dfp_ad_unit_code).to.equal(AD_UNIT_CODE)
1709
- });
1710
-
1711
- it('should not build gpid if dfp ad unit code / divid doesnt exist when ortb2Imp.ext.gpid does not exist', function () {
1712
- const AD_UNIT_CODE = '/1111/home';
1713
- const validBids = utils.deepClone(DEFAULT_BANNER_VALID_BID);
1714
- sinon.stub(utils, 'getGptSlotInfoForAdUnitCode')
1715
- .returns({});
1716
- validBids[0].ortb2Imp = {
1717
- ext: {
1718
- data: {
1719
- adserver: {
1720
- name: 'gam',
1721
- }
1722
- }
1723
- }
1724
- }
1725
- const requests = spec.buildRequests(validBids, DEFAULT_OPTION);
1726
-
1727
- const imp = JSON.parse(requests[0].data.r).imp[0];
1728
- utils.getGptSlotInfoForAdUnitCode.restore();
1729
- expect(imp.ext).to.be.undefined;
1730
- });
1731
-
1732
1668
  it('should send gpid in request if ortb2Imp.ext.gpid exists when no size present', function () {
1733
1669
  const validBids = utils.deepClone(DEFAULT_BANNER_VALID_BID_PARAM_NO_SIZE);
1734
1670
  validBids[0].ortb2Imp = {
@@ -0,0 +1,297 @@
1
+ import liAnalytics from 'modules/liveIntentAnalyticsAdapter';
2
+ import { expect } from 'chai';
3
+ import { server } from 'test/mocks/xhr.js';
4
+ import { auctionManager } from 'src/auctionManager.js';
5
+
6
+ let utils = require('src/utils');
7
+ let refererDetection = require('src/refererDetection');
8
+ let instanceId = '77abbc81-c1f1-41cd-8f25-f7149244c800';
9
+ let url = 'https://www.test.com'
10
+ let sandbox;
11
+ let clock;
12
+ let now = new Date();
13
+
14
+ let events = require('src/events');
15
+ let constants = require('src/constants.json');
16
+ let auctionId = '99abbc81-c1f1-41cd-8f25-f7149244c897'
17
+
18
+ const config = {
19
+ provider: 'liveintent',
20
+ options: {
21
+ bidWonTimeout: 2000,
22
+ sampling: 1
23
+ }
24
+ }
25
+
26
+ let args = {
27
+ auctionId: auctionId,
28
+ timestamp: 1660915379703,
29
+ auctionEnd: 1660915381635,
30
+ adUnits: [
31
+ {
32
+ code: 'ID_Bot100AdJ1',
33
+ mediaTypes: {
34
+ banner: {
35
+ sizes: [
36
+ [
37
+ 300,
38
+ 250
39
+ ],
40
+ [
41
+ 320,
42
+ 50
43
+ ]
44
+ ]
45
+ }
46
+ },
47
+ ortb2Imp: {
48
+ gpid: '/777/test/home/ID_Bot100AdJ1',
49
+ ext: {
50
+ data: {
51
+ aupName: '/777/test/home/ID_Bot100AdJ1',
52
+ adserver: {
53
+ name: 'gam',
54
+ adslot: '/777/test/home/ID_Bot100AdJ1'
55
+ },
56
+ pbadslot: '/777/test/home/ID_Bot100AdJ1'
57
+ },
58
+ gpid: '/777/test/home/ID_Bot100AdJ1'
59
+ }
60
+ },
61
+ bids: [
62
+ {
63
+ bidder: 'testBidder',
64
+ params: {
65
+ siteId: 321218,
66
+ zoneId: 1732558,
67
+ position: 'bug',
68
+ accountId: 10777
69
+ },
70
+ userIdAsEids: [
71
+ {
72
+ source: 'source1.com',
73
+ uids: [
74
+ {
75
+ id: 'ID5*yO-L9xRugTx4mkIJ9z99eYva6CZQhz8B70QOkLLSEEQWowsxvVQqMaZOt4qpBTYAFqR3y6ZtZ8qLJJBAsRqnRRalTfy8iZszQavAAkZcAjkWpxp6DnOSkF3R5LafC10OFqhwcxH699dDc_fI6RVEGBasN6zrJwgqCGelgfQLtQwWrikWRyi0l3ICFj9JUiVGFrCF8SAFaqJD9A0_I07a8xa0-jADtEj1T8w30oX--sMWvTK_I5_3zA5f3z0OMoxbFsCMFdhfGRDuw5GrpI475g',
76
+ atype: 1,
77
+ ext: {
78
+ linkType: 2
79
+ }
80
+ }
81
+ ]
82
+ },
83
+ {
84
+ source: 'source2.com',
85
+ uids: [
86
+ {
87
+ id: 'ID5*yO-L9xRugTx4mkIJ9z99eYva6CZQhz8B70QOkLLSEEQWowsxvVQqMaZOt4qpBTYAFqR3y6ZtZ8qLJJBAsRqnRRalTfy8iZszQavAAkZcAjkWpxp6DnOSkF3R5LafC10OFqhwcxH699dDc_fI6RVEGBasN6zrJwgqCGelgfQLtQwWrikWRyi0l3ICFj9JUiVGFrCF8SAFaqJD9A0_I07a8xa0-jADtEj1T8w30oX--sMWvTK_I5_3zA5f3z0OMoxbFsCMFdhfGRDuw5GrpI475g',
88
+ atype: 1,
89
+ ext: {
90
+ linkType: 2
91
+ }
92
+ }
93
+ ]
94
+ }
95
+ ]
96
+ },
97
+ {
98
+ bidder: 'testBidder2',
99
+ params: {
100
+ adSlot: '2926251',
101
+ publisherId: '159423'
102
+ },
103
+ userIdAsEids: [
104
+ {
105
+ source: 'source1.com',
106
+ uids: [
107
+ {
108
+ id: 'ID5*yO-L9xRugTx4mkIJ9z99eYva6CZQhz8B70QOkLLSEEQWowsxvVQqMaZOt4qpBTYAFqR3y6ZtZ8qLJJBAsRqnRRalTfy8iZszQavAAkZcAjkWpxp6DnOSkF3R5LafC10OFqhwcxH699dDc_fI6RVEGBasN6zrJwgqCGelgfQLtQwWrikWRyi0l3ICFj9JUiVGFrCF8SAFaqJD9A0_I07a8xa0-jADtEj1T8w30oX--sMWvTK_I5_3zA5f3z0OMoxbFsCMFdhfGRDuw5GrpI475g',
109
+ atype: 1,
110
+ ext: {
111
+ linkType: 2
112
+ }
113
+ }
114
+ ]
115
+ }
116
+ ]
117
+ }
118
+ ]
119
+ }
120
+ ],
121
+ bidderRequests: [
122
+ {
123
+ bidderCode: 'tripl_ss1',
124
+ auctionId: '8e5a5eda-a7dc-49a3-bc7f-654fc',
125
+ bidderRequestId: '953fe1ee8a1645',
126
+ uniquePbsTid: '0da1f980-8351-415d-860d-ebbdb4274179',
127
+ auctionStart: 1660915379703
128
+ },
129
+ {
130
+ bidderCode: 'tripl_ss2',
131
+ auctionId: '8e5a5eda-a7dc-49a3-bc7f-6ca682ae893c',
132
+ bidderRequestId: '953fe1ee8a164e',
133
+ uniquePbsTid: '0da1f980-8351-415d-860d-ebbdb4274180',
134
+ auctionStart: 1660915379703
135
+ }
136
+ ],
137
+ bidsReceived: [
138
+ {
139
+ adUnitCode: 'ID_Bot100AdJ1',
140
+ timeToRespond: 824,
141
+ cpm: 0.447,
142
+ currency: 'USD',
143
+ ttl: 300,
144
+ bidder: 'testBidder'
145
+ }
146
+ ],
147
+ winningBids: []
148
+ }
149
+
150
+ let winningBids = [
151
+ {
152
+ adUnitCode: 'ID_Bot100AdJ1',
153
+ timeToRespond: 824,
154
+ cpm: 0.447,
155
+ currency: 'USD',
156
+ ttl: 300,
157
+ bidder: 'testBidder'
158
+ }
159
+ ];
160
+
161
+ let expectedEvent = {
162
+ instanceId: instanceId,
163
+ url: url,
164
+ bidsReceived: [
165
+ {
166
+ adUnitCode: 'ID_Bot100AdJ1',
167
+ timeToRespond: 824,
168
+ cpm: 0.447,
169
+ currency: 'USD',
170
+ ttl: 300,
171
+ bidder: 'testBidder'
172
+ }
173
+ ],
174
+ auctionStart: 1660915379703,
175
+ auctionEnd: 1660915381635,
176
+ adUnits: [
177
+ {
178
+ code: 'ID_Bot100AdJ1',
179
+ mediaType: 'banner',
180
+ sizes: [
181
+ {
182
+ w: 300,
183
+ h: 250
184
+ },
185
+ {
186
+ w: 320,
187
+ h: 50
188
+ }
189
+ ],
190
+ ortb2Imp: {
191
+ gpid: '/777/test/home/ID_Bot100AdJ1',
192
+ ext: {
193
+ data: {
194
+ aupName: '/777/test/home/ID_Bot100AdJ1',
195
+ adserver: {
196
+ name: 'gam',
197
+ adslot: '/777/test/home/ID_Bot100AdJ1'
198
+ },
199
+ pbadslot: '/777/test/home/ID_Bot100AdJ1'
200
+ },
201
+ gpid: '/777/test/home/ID_Bot100AdJ1'
202
+ }
203
+ }
204
+ }
205
+ ],
206
+ winningBids: [
207
+ {
208
+ adUnitCode: 'ID_Bot100AdJ1',
209
+ timeToRespond: 824,
210
+ cpm: 0.447,
211
+ currency: 'USD',
212
+ ttl: 300,
213
+ bidder: 'testBidder'
214
+ }
215
+ ],
216
+ auctionId: auctionId,
217
+ userIds: [
218
+ {
219
+ source: 'source1.com',
220
+ uids: [
221
+ {
222
+ id: 'ID5*yO-L9xRugTx4mkIJ9z99eYva6CZQhz8B70QOkLLSEEQWowsxvVQqMaZOt4qpBTYAFqR3y6ZtZ8qLJJBAsRqnRRalTfy8iZszQavAAkZcAjkWpxp6DnOSkF3R5LafC10OFqhwcxH699dDc_fI6RVEGBasN6zrJwgqCGelgfQLtQwWrikWRyi0l3ICFj9JUiVGFrCF8SAFaqJD9A0_I07a8xa0-jADtEj1T8w30oX--sMWvTK_I5_3zA5f3z0OMoxbFsCMFdhfGRDuw5GrpI475g',
223
+ atype: 1,
224
+ ext: {
225
+ linkType: 2
226
+ }
227
+ }
228
+ ]
229
+ },
230
+ {
231
+ source: 'source2.com',
232
+ uids: [
233
+ {
234
+ id: 'ID5*yO-L9xRugTx4mkIJ9z99eYva6CZQhz8B70QOkLLSEEQWowsxvVQqMaZOt4qpBTYAFqR3y6ZtZ8qLJJBAsRqnRRalTfy8iZszQavAAkZcAjkWpxp6DnOSkF3R5LafC10OFqhwcxH699dDc_fI6RVEGBasN6zrJwgqCGelgfQLtQwWrikWRyi0l3ICFj9JUiVGFrCF8SAFaqJD9A0_I07a8xa0-jADtEj1T8w30oX--sMWvTK_I5_3zA5f3z0OMoxbFsCMFdhfGRDuw5GrpI475g',
235
+ atype: 1,
236
+ ext: {
237
+ linkType: 2
238
+ }
239
+ }
240
+ ]
241
+ }
242
+ ],
243
+ bidders: [
244
+ {
245
+ bidder: 'testBidder',
246
+ params: {
247
+ siteId: 321218,
248
+ zoneId: 1732558,
249
+ position: 'bug',
250
+ accountId: 10777
251
+ }
252
+ },
253
+ {
254
+ bidder: 'testBidder2',
255
+ params: {
256
+ adSlot: '2926251',
257
+ publisherId: '159423'
258
+ }
259
+ }
260
+ ]
261
+ };
262
+
263
+ describe('LiveIntent Analytics Adapter ', () => {
264
+ beforeEach(function () {
265
+ sandbox = sinon.sandbox.create();
266
+ sandbox.stub(events, 'getEvents').returns([]);
267
+ clock = sandbox.useFakeTimers(now.getTime());
268
+ });
269
+ afterEach(function () {
270
+ liAnalytics.disableAnalytics();
271
+ sandbox.restore();
272
+ clock.restore();
273
+ });
274
+
275
+ it('request is computed and sent correctly', () => {
276
+ liAnalytics.enableAnalytics(config);
277
+ sandbox.stub(utils, 'generateUUID').returns(instanceId);
278
+ sandbox.stub(refererDetection, 'getRefererInfo').returns({page: url});
279
+ sandbox.stub(auctionManager.index, 'getAuction').withArgs(auctionId).returns({ getWinningBids: () => winningBids });
280
+ events.emit(constants.EVENTS.AUCTION_END, args);
281
+ clock.tick(2000);
282
+ expect(server.requests.length).to.equal(1);
283
+
284
+ let requestBody = JSON.parse(server.requests[0].requestBody);
285
+ expect(requestBody).to.deep.equal(expectedEvent);
286
+ });
287
+
288
+ it('track is called', () => {
289
+ liAnalytics.enableAnalytics(config);
290
+ sandbox.stub(liAnalytics, 'track');
291
+ events.emit(constants.EVENTS.AUCTION_END, args);
292
+ events.emit(constants.EVENTS.AUCTION_END, args);
293
+ events.emit(constants.EVENTS.AUCTION_END, args);
294
+ clock.tick(6000);
295
+ sinon.assert.callCount(liAnalytics.track, 3)
296
+ })
297
+ });
@@ -49,6 +49,26 @@ describe('nextMillenniumBidAdapterTests', function() {
49
49
  }
50
50
  },
51
51
 
52
+ {
53
+ adUnitCode: 'test-banner-gi',
54
+ bidId: 'bid1234',
55
+ auctionId: 'b06c5141-fe8f-4cdf-9d7d-54415490a917',
56
+ bidder: 'nextMillennium',
57
+ params: { group_id: '1234' },
58
+ mediaTypes: {
59
+ banner: {
60
+ sizes: [[300, 250], [300, 300]]
61
+ }
62
+ },
63
+
64
+ sizes: [[300, 250], [300, 300]],
65
+ uspConsent: '1---',
66
+ gdprConsent: {
67
+ consentString: 'kjfdniwjnifwenrif3',
68
+ gdprApplies: true
69
+ }
70
+ },
71
+
52
72
  {
53
73
  adUnitCode: 'test-video-gi',
54
74
  bidId: 'bid1234',
@@ -94,7 +114,7 @@ describe('nextMillenniumBidAdapterTests', function() {
94
114
  const request = spec.buildRequests([test]);
95
115
  const requestData = JSON.parse(request[0].data);
96
116
  const storeRequestId = requestData.ext.prebid.storedrequest.id;
97
- const templateRE = /^g\d+;\d+x\d+;/;
117
+ const templateRE = /^g[1-9]\d*;(?:[1-9]\d*x[1-9]\d*\|)*[1-9]\d*x[1-9]\d*;/;
98
118
  expect(templateRE.test(storeRequestId)).to.be.true;
99
119
  };
100
120
  });
@@ -173,4 +193,86 @@ describe('nextMillenniumBidAdapterTests', function() {
173
193
  expect(bid.height).to.equal(250);
174
194
  expect(bid.currency).to.equal('USD');
175
195
  });
196
+
197
+ it('validate_videowrapper_response_params', function() {
198
+ const serverResponse = {
199
+ body: {
200
+ id: 'f7b3d2da-e762-410c-b069-424f92c4c4b2',
201
+ seatbid: [
202
+ {
203
+ bid: [
204
+ {
205
+ id: '7457329903666272789',
206
+ price: 0.5,
207
+ adm: 'https://some_vast_host.com/vast.xml',
208
+ adid: '96846035',
209
+ adomain: ['test.addomain.com'],
210
+ w: 300,
211
+ h: 250,
212
+ ext: {
213
+ prebid: {
214
+ type: 'video'
215
+ }
216
+ }
217
+ }
218
+ ]
219
+ }
220
+ ],
221
+ cur: 'USD'
222
+ }
223
+ };
224
+
225
+ let bids = spec.interpretResponse(serverResponse, bidRequestData[0]);
226
+ expect(bids).to.have.lengthOf(1);
227
+
228
+ let bid = bids[0];
229
+
230
+ expect(bid.creativeId).to.equal('96846035');
231
+ expect(bid.vastUrl).to.equal('https://some_vast_host.com/vast.xml');
232
+ expect(bid.cpm).to.equal(0.5);
233
+ expect(bid.width).to.equal(300);
234
+ expect(bid.height).to.equal(250);
235
+ expect(bid.currency).to.equal('USD');
236
+ });
237
+
238
+ it('validate_videoxml_response_params', function() {
239
+ const serverResponse = {
240
+ body: {
241
+ id: 'f7b3d2da-e762-410c-b069-424f92c4c4b2',
242
+ seatbid: [
243
+ {
244
+ bid: [
245
+ {
246
+ id: '7457329903666272789',
247
+ price: 0.5,
248
+ adm: '<vast><ad></ad></vast>',
249
+ adid: '96846035',
250
+ adomain: ['test.addomain.com'],
251
+ w: 300,
252
+ h: 250,
253
+ ext: {
254
+ prebid: {
255
+ type: 'video'
256
+ }
257
+ }
258
+ }
259
+ ]
260
+ }
261
+ ],
262
+ cur: 'USD'
263
+ }
264
+ };
265
+
266
+ let bids = spec.interpretResponse(serverResponse, bidRequestData[0]);
267
+ expect(bids).to.have.lengthOf(1);
268
+
269
+ let bid = bids[0];
270
+
271
+ expect(bid.creativeId).to.equal('96846035');
272
+ expect(bid.vastXml).to.equal('<vast><ad></ad></vast>');
273
+ expect(bid.cpm).to.equal(0.5);
274
+ expect(bid.width).to.equal(300);
275
+ expect(bid.height).to.equal(250);
276
+ expect(bid.currency).to.equal('USD');
277
+ });
176
278
  });
@@ -1019,6 +1019,37 @@ describe('OpenxRtbAdapter', function () {
1019
1019
  });
1020
1020
  });
1021
1021
 
1022
+ context('when no seatbid in response', function () {
1023
+ let bids;
1024
+ beforeEach(function () {
1025
+ bidRequestConfigs = [{
1026
+ bidder: 'openx',
1027
+ params: {
1028
+ unit: '12345678',
1029
+ delDomain: 'test-del-domain'
1030
+ },
1031
+ adUnitCode: 'adunit-code',
1032
+ mediaTypes: {
1033
+ banner: {
1034
+ sizes: [[300, 250], [300, 600]],
1035
+ },
1036
+ },
1037
+ bidId: 'test-bid-id',
1038
+ bidderRequestId: 'test-bidder-request-id',
1039
+ auctionId: 'test-auction-id'
1040
+ }];
1041
+
1042
+ bidRequest = spec.buildRequests(bidRequestConfigs, {refererInfo: {}})[0];
1043
+
1044
+ bidResponse = {ext: {}, id: 'test-bid-id'};
1045
+ bids = spec.interpretResponse({body: bidResponse}, bidRequest);
1046
+ });
1047
+
1048
+ it('should not return any bids', function () {
1049
+ expect(bids.length).to.equal(0);
1050
+ });
1051
+ });
1052
+
1022
1053
  context('when there is no response', function () {
1023
1054
  let bids;
1024
1055
  beforeEach(function () {
@@ -72,6 +72,7 @@ describe('sharethrough adapter spec', function () {
72
72
  {
73
73
  bidder: 'sharethrough',
74
74
  bidId: 'bidId1',
75
+ transactionId: 'transactionId1',
75
76
  sizes: [[300, 250], [300, 600]],
76
77
  params: {
77
78
  pkey: 'aaaa1111',
@@ -85,8 +86,10 @@ describe('sharethrough adapter spec', function () {
85
86
  },
86
87
  ortb2Imp: {
87
88
  ext: {
89
+ tid: 'transaction-id-1',
90
+ gpid: 'universal-id',
88
91
  data: {
89
- pbadslot: 'universal-id',
92
+ pbadslot: 'pbadslot-id',
90
93
  },
91
94
  },
92
95
  },
@@ -136,6 +139,7 @@ describe('sharethrough adapter spec', function () {
136
139
  bidder: 'sharethrough',
137
140
  bidId: 'bidId2',
138
141
  sizes: [[600, 300]],
142
+ transactionId: 'transactionId2',
139
143
  params: {
140
144
  pkey: 'bbbb2222',
141
145
  },
@@ -229,6 +233,7 @@ describe('sharethrough adapter spec', function () {
229
233
  expect(openRtbReq.device.ua).to.equal(navigator.userAgent);
230
234
  expect(openRtbReq.regs.coppa).to.equal(1);
231
235
 
236
+ expect(openRtbReq.source.tid).to.equal(bidRequests[0].transactionId);
232
237
  expect(openRtbReq.source.ext.version).not.to.be.undefined;
233
238
  expect(openRtbReq.source.ext.str).not.to.be.undefined;
234
239
  expect(openRtbReq.source.ext.schain).to.deep.equal(bidRequests[0].schain);
@@ -310,12 +315,28 @@ describe('sharethrough adapter spec', function () {
310
315
  });
311
316
  });
312
317
 
318
+ describe('transaction id at the impression level', () => {
319
+ it('should include transaction id when provided', () => {
320
+ const requests = spec.buildRequests(bidRequests, bidderRequest);
321
+
322
+ expect(requests[0].data.imp[0].ext.tid).to.equal('transaction-id-1');
323
+ expect(requests[1].data.imp[0].ext).to.be.empty;
324
+ });
325
+ });
326
+
313
327
  describe('universal id', () => {
314
328
  it('should include gpid when universal id is provided', () => {
315
329
  const requests = spec.buildRequests(bidRequests, bidderRequest);
316
330
 
317
331
  expect(requests[0].data.imp[0].ext.gpid).to.equal('universal-id');
318
- expect(requests[1].data.imp[0].ext).to.be.undefined;
332
+ expect(requests[1].data.imp[0].ext).to.be.empty;
333
+ });
334
+
335
+ it('should include gpid when pbadslot is provided without universal id', () => {
336
+ delete bidRequests[0].ortb2Imp.ext.gpid;
337
+ const requests = spec.buildRequests(bidRequests, bidderRequest);
338
+
339
+ expect(requests[0].data.imp[0].ext.gpid).to.equal('pbadslot-id');
319
340
  });
320
341
  });
321
342
 
@@ -1,6 +1,7 @@
1
1
  import {expect} from 'chai';
2
2
  import {config} from 'src/config.js';
3
3
  import {loadExternalScript} from '../../../src/adloader';
4
+ import {isRendererRequired} from '../../../src/Renderer';
4
5
  import {spec, GOOGLE_CONSENT} from 'modules/spotxBidAdapter.js';
5
6
 
6
7
  describe('the spotx adapter', function () {
@@ -568,6 +569,11 @@ describe('the spotx adapter', function () {
568
569
  renderer.render();
569
570
  expect(hasRun).to.equal(true);
570
571
  });
572
+
573
+ it('should include the url property on the renderer for Prebid Core checks', function () {
574
+ var renderer = spec.interpretResponse(serverResponse, bidderRequestObj)[0].renderer;
575
+ expect(isRendererRequired(renderer)).to.be.true;
576
+ });
571
577
  });
572
578
 
573
579
  describe('outstreamRender', function() {