prebid.js 7.35.0 → 7.37.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 (229) hide show
  1. package/.devcontainer/Dockerfile +2 -0
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/admaruBidAdapter.js +1 -1
  8. package/dist/adrelevantisBidAdapter.js +1 -1
  9. package/dist/adtrgtmeBidAdapter.js +1 -1
  10. package/dist/adxcgBidAdapter.js +1 -1
  11. package/dist/adyoulikeBidAdapter.js +1 -1
  12. package/dist/aidemBidAdapter.js +1 -1
  13. package/dist/ajaBidAdapter.js +1 -1
  14. package/dist/amxBidAdapter.js +1 -1
  15. package/dist/amxIdSystem.js +1 -1
  16. package/dist/aolBidAdapter.js +1 -1
  17. package/dist/appierAnalyticsAdapter.js +1 -1
  18. package/dist/appnexusBidAdapter.js +1 -1
  19. package/dist/asoBidAdapter.js +1 -1
  20. package/dist/audiencerunBidAdapter.js +1 -1
  21. package/dist/axonixBidAdapter.js +1 -1
  22. package/dist/bidglassBidAdapter.js +1 -1
  23. package/dist/big-richmediaBidAdapter.js +1 -1
  24. package/dist/bluebillywigBidAdapter.js +1 -1
  25. package/dist/bridgewellBidAdapter.js +1 -1
  26. package/dist/brightMountainMediaBidAdapter.js +1 -1
  27. package/dist/brightcomBidAdapter.js +1 -1
  28. package/dist/brightcomSSPBidAdapter.js +1 -0
  29. package/dist/carodaBidAdapter.js +1 -1
  30. package/dist/chtnwBidAdapter.js +1 -1
  31. package/dist/concertBidAdapter.js +1 -1
  32. package/dist/connectadBidAdapter.js +1 -1
  33. package/dist/consumableBidAdapter.js +1 -1
  34. package/dist/conversantBidAdapter.js +1 -1
  35. package/dist/craftBidAdapter.js +1 -1
  36. package/dist/criteoBidAdapter.js +1 -1
  37. package/dist/cwireBidAdapter.js +1 -1
  38. package/dist/dependencies.json +3 -0
  39. package/dist/discoveryBidAdapter.js +1 -1
  40. package/dist/dspxBidAdapter.js +1 -1
  41. package/dist/eplanningBidAdapter.js +1 -1
  42. package/dist/feedadBidAdapter.js +1 -1
  43. package/dist/finativeBidAdapter.js +1 -1
  44. package/dist/freewheel-sspBidAdapter.js +1 -1
  45. package/dist/glimpseBidAdapter.js +1 -1
  46. package/dist/gmosspBidAdapter.js +1 -1
  47. package/dist/goldbachBidAdapter.js +1 -1
  48. package/dist/gridBidAdapter.js +1 -1
  49. package/dist/gridNMBidAdapter.js +1 -1
  50. package/dist/gumgumBidAdapter.js +1 -1
  51. package/dist/h12mediaBidAdapter.js +1 -1
  52. package/dist/id5IdSystem.js +1 -1
  53. package/dist/impactifyBidAdapter.js +1 -1
  54. package/dist/improvedigitalBidAdapter.js +1 -1
  55. package/dist/incrxBidAdapter.js +1 -1
  56. package/dist/inmarBidAdapter.js +1 -1
  57. package/dist/insticatorBidAdapter.js +1 -1
  58. package/dist/ixBidAdapter.js +1 -1
  59. package/dist/jixieBidAdapter.js +1 -1
  60. package/dist/justpremiumBidAdapter.js +1 -1
  61. package/dist/konduitAnalyticsAdapter.js +1 -1
  62. package/dist/kueezBidAdapter.js +1 -1
  63. package/dist/kueezRtbBidAdapter.js +1 -1
  64. package/dist/lassoBidAdapter.js +1 -1
  65. package/dist/lifestreetBidAdapter.js +1 -1
  66. package/dist/limelightDigitalBidAdapter.js +1 -1
  67. package/dist/liveIntentIdSystem.js +1 -1
  68. package/dist/livewrappedBidAdapter.js +1 -1
  69. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  70. package/dist/logicadBidAdapter.js +1 -1
  71. package/dist/loglyliftBidAdapter.js +1 -1
  72. package/dist/magniteAnalyticsAdapter.js +1 -1
  73. package/dist/malltvAnalyticsAdapter.js +1 -1
  74. package/dist/marsmediaBidAdapter.js +1 -1
  75. package/dist/mediafuseBidAdapter.js +1 -1
  76. package/dist/mediagoBidAdapter.js +1 -1
  77. package/dist/mediakeysBidAdapter.js +1 -1
  78. package/dist/mediasquareBidAdapter.js +1 -1
  79. package/dist/mgidBidAdapter.js +1 -1
  80. package/dist/minutemediaBidAdapter.js +1 -1
  81. package/dist/minutemediaplusBidAdapter.js +1 -0
  82. package/dist/neuwoRtdProvider.js +1 -0
  83. package/dist/nextMillenniumBidAdapter.js +1 -1
  84. package/dist/nexx360BidAdapter.js +1 -1
  85. package/dist/not-for-prod/prebid.js +141 -137
  86. package/dist/oguryBidAdapter.js +1 -1
  87. package/dist/onetagBidAdapter.js +1 -1
  88. package/dist/ooloAnalyticsAdapter.js +1 -1
  89. package/dist/outbrainBidAdapter.js +1 -1
  90. package/dist/parrableIdSystem.js +1 -1
  91. package/dist/pixfutureBidAdapter.js +1 -1
  92. package/dist/prebid-core.js +1 -1
  93. package/dist/prebidServerBidAdapter.js +1 -1
  94. package/dist/proxistoreBidAdapter.js +1 -1
  95. package/dist/publinkIdSystem.js +1 -1
  96. package/dist/pubmaticBidAdapter.js +1 -1
  97. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  98. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  99. package/dist/pxyzBidAdapter.js +1 -1
  100. package/dist/quantcastBidAdapter.js +1 -1
  101. package/dist/readpeakBidAdapter.js +1 -1
  102. package/dist/relaidoBidAdapter.js +1 -1
  103. package/dist/rhythmoneBidAdapter.js +1 -1
  104. package/dist/riseBidAdapter.js +1 -1
  105. package/dist/rubiconAnalyticsAdapter.js +1 -1
  106. package/dist/rubiconBidAdapter.js +1 -1
  107. package/dist/scatteredBidAdapter.js +1 -0
  108. package/dist/seedingAllianceBidAdapter.js +1 -1
  109. package/dist/seedtagBidAdapter.js +1 -1
  110. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  111. package/dist/sharethroughBidAdapter.js +1 -1
  112. package/dist/shinezBidAdapter.js +1 -1
  113. package/dist/sirdataRtdProvider.js +1 -1
  114. package/dist/smaatoBidAdapter.js +1 -1
  115. package/dist/smartadserverBidAdapter.js +1 -1
  116. package/dist/smartxBidAdapter.js +1 -1
  117. package/dist/smilewantedBidAdapter.js +1 -1
  118. package/dist/sonobiBidAdapter.js +1 -1
  119. package/dist/sovrnAnalyticsAdapter.js +1 -1
  120. package/dist/sovrnBidAdapter.js +1 -1
  121. package/dist/sspBCBidAdapter.js +1 -1
  122. package/dist/sublimeBidAdapter.js +1 -1
  123. package/dist/synacormediaBidAdapter.js +1 -1
  124. package/dist/targetVideoBidAdapter.js +1 -1
  125. package/dist/teadsBidAdapter.js +1 -1
  126. package/dist/trionBidAdapter.js +1 -1
  127. package/dist/tripleliftBidAdapter.js +1 -1
  128. package/dist/ttdBidAdapter.js +1 -1
  129. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  130. package/dist/uid2IdSystem.js +1 -1
  131. package/dist/underdogmediaBidAdapter.js +1 -1
  132. package/dist/undertoneBidAdapter.js +1 -1
  133. package/dist/userId.js +1 -1
  134. package/dist/vidazooBidAdapter.js +1 -1
  135. package/dist/videobyteBidAdapter.js +1 -1
  136. package/dist/visxBidAdapter.js +1 -1
  137. package/dist/vuukleBidAdapter.js +1 -1
  138. package/dist/widespaceBidAdapter.js +1 -1
  139. package/dist/winrBidAdapter.js +1 -1
  140. package/dist/yahoosspBidAdapter.js +1 -1
  141. package/dist/yieldmoBidAdapter.js +1 -1
  142. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  143. package/integrationExamples/gpt/neuwoRtdProvider_example.html +190 -0
  144. package/modules/33acrossBidAdapter.js +13 -4
  145. package/modules/adagioBidAdapter.js +14 -14
  146. package/modules/adagioBidAdapter.md +3 -1
  147. package/modules/admaruBidAdapter.js +19 -1
  148. package/modules/aidemBidAdapter.js +90 -65
  149. package/modules/aidemBidAdapter.md +10 -7
  150. package/modules/ajaBidAdapter.js +6 -1
  151. package/modules/amxIdSystem.md +2 -10
  152. package/modules/aolBidAdapter.js +1 -1
  153. package/modules/appnexusBidAdapter.js +45 -48
  154. package/modules/brightcomBidAdapter.js +1 -0
  155. package/modules/brightcomSSPBidAdapter.js +323 -0
  156. package/modules/brightcomSSPBidAdapter.md +46 -0
  157. package/modules/criteoBidAdapter.js +4 -5
  158. package/modules/cwireBidAdapter.md +9 -3
  159. package/modules/discoveryBidAdapter.js +22 -12
  160. package/modules/feedadBidAdapter.js +35 -15
  161. package/modules/fpdModule/index.md +5 -2
  162. package/modules/freewheel-sspBidAdapter.js +5 -1
  163. package/modules/gridBidAdapter.js +3 -1
  164. package/modules/incrxBidAdapter.js +2 -0
  165. package/modules/ixBidAdapter.js +318 -175
  166. package/modules/kueezRtbBidAdapter.js +54 -20
  167. package/modules/limelightDigitalBidAdapter.js +6 -1
  168. package/modules/limelightDigitalBidAdapter.md +12 -2
  169. package/modules/liveIntentIdSystem.js +1 -1
  170. package/modules/livewrappedBidAdapter.js +28 -16
  171. package/modules/mediagoBidAdapter.js +22 -17
  172. package/modules/minutemediaplusBidAdapter.js +291 -0
  173. package/modules/minutemediaplusBidAdapter.md +35 -0
  174. package/modules/neuwoRtdProvider.js +171 -0
  175. package/modules/neuwoRtdProvider.md +40 -0
  176. package/modules/nextMillenniumBidAdapter.js +9 -1
  177. package/modules/nexx360BidAdapter.js +1 -1
  178. package/modules/prebidServerBidAdapter/ortbConverter.js +6 -0
  179. package/modules/proxistoreBidAdapter.js +2 -2
  180. package/modules/pubmaticBidAdapter.js +4 -0
  181. package/modules/pubxaiAnalyticsAdapter.js +2 -2
  182. package/modules/scatteredBidAdapter.js +72 -0
  183. package/modules/scatteredBidAdapter.md +36 -0
  184. package/modules/sirdataRtdProvider.js +262 -284
  185. package/modules/smartxBidAdapter.js +2 -0
  186. package/modules/smilewantedBidAdapter.js +5 -0
  187. package/modules/sonobiBidAdapter.js +1 -10
  188. package/modules/topicsFpdModule.md +62 -0
  189. package/modules/tripleliftBidAdapter.js +4 -0
  190. package/modules/userId/eids.js +1 -1
  191. package/modules/vidazooBidAdapter.js +3 -1
  192. package/modules/yahoosspBidAdapter.js +1 -1
  193. package/modules/yieldmoBidAdapter.js +1 -0
  194. package/package.json +2 -2
  195. package/src/adapterManager.js +30 -14
  196. package/src/utils.js +1 -1
  197. package/test/spec/modules/33acrossBidAdapter_spec.js +51 -18
  198. package/test/spec/modules/adagioBidAdapter_spec.js +2 -2
  199. package/test/spec/modules/admaruBidAdapter_spec.js +48 -0
  200. package/test/spec/modules/aidemBidAdapter_spec.js +77 -10
  201. package/test/spec/modules/ajaBidAdapter_spec.js +21 -1
  202. package/test/spec/modules/aolBidAdapter_spec.js +2 -2
  203. package/test/spec/modules/appnexusBidAdapter_spec.js +123 -16
  204. package/test/spec/modules/brightcomSSPBidAdapter_spec.js +411 -0
  205. package/test/spec/modules/criteoBidAdapter_spec.js +24 -1
  206. package/test/spec/modules/eids_spec.js +1 -1
  207. package/test/spec/modules/feedadBidAdapter_spec.js +47 -77
  208. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +1 -1
  209. package/test/spec/modules/incrxBidAdapter_spec.js +4 -0
  210. package/test/spec/modules/ixBidAdapter_spec.js +24 -54
  211. package/test/spec/modules/kueezRtbBidAdapter_spec.js +63 -22
  212. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +35 -5
  213. package/test/spec/modules/livewrappedBidAdapter_spec.js +267 -2
  214. package/test/spec/modules/minutemediaplusBidAdapter_spec.js +519 -0
  215. package/test/spec/modules/neuwoRtdProvider_spec.js +123 -0
  216. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +11 -0
  217. package/test/spec/modules/prebidServerBidAdapter_spec.js +56 -0
  218. package/test/spec/modules/proxistoreBidAdapter_spec.js +2 -2
  219. package/test/spec/modules/pubmaticBidAdapter_spec.js +15 -0
  220. package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +3 -1
  221. package/test/spec/modules/scatteredBidAdapter_spec.js +210 -0
  222. package/test/spec/modules/sirdataRtdProvider_spec.js +116 -22
  223. package/test/spec/modules/smilewantedBidAdapter_spec.js +54 -3
  224. package/test/spec/modules/sonobiBidAdapter_spec.js +3 -25
  225. package/test/spec/modules/tripleliftBidAdapter_spec.js +9 -2
  226. package/test/spec/modules/userId_spec.js +1 -1
  227. package/test/spec/modules/vidazooBidAdapter_spec.js +4 -1
  228. package/test/spec/modules/yahoosspBidAdapter_spec.js +1 -1
  229. package/test/spec/unit/core/adapterManager_spec.js +147 -0
@@ -2660,6 +2660,62 @@ describe('S2S Adapter', function () {
2660
2660
  });
2661
2661
  });
2662
2662
 
2663
+ describe('Bidder-level ortb2Imp', () => {
2664
+ beforeEach(() => {
2665
+ config.setConfig({
2666
+ s2sConfig: {
2667
+ ...CONFIG,
2668
+ bidders: ['A', 'B']
2669
+ }
2670
+ })
2671
+ })
2672
+ it('should be set on imp.ext.prebid.imp', () => {
2673
+ const s2sReq = utils.deepClone(REQUEST);
2674
+ s2sReq.ad_units[0].ortb2Imp = {l0: 'adUnit'};
2675
+ s2sReq.ad_units[0].bids = [
2676
+ {
2677
+ bidder: 'A',
2678
+ bid_id: 1,
2679
+ ortb2Imp: {
2680
+ l2: 'A'
2681
+ }
2682
+ },
2683
+ {
2684
+ bidder: 'B',
2685
+ bid_id: 2,
2686
+ ortb2Imp: {
2687
+ l2: 'B'
2688
+ }
2689
+ }
2690
+ ];
2691
+ const bidderReqs = [
2692
+ {
2693
+ ...BID_REQUESTS[0],
2694
+ bidderCode: 'A',
2695
+ bids: [{
2696
+ bidId: 1,
2697
+ bidder: 'A'
2698
+ }]
2699
+ },
2700
+ {
2701
+ ...BID_REQUESTS[0],
2702
+ bidderCode: 'B',
2703
+ bids: [{
2704
+ bidId: 2,
2705
+ bidder: 'B'
2706
+ }]
2707
+ }
2708
+ ]
2709
+ adapter.callBids(s2sReq, bidderReqs, addBidResponse, done, ajax);
2710
+ const req = JSON.parse(server.requests[0].requestBody);
2711
+ expect(req.imp[0].l0).to.eql('adUnit');
2712
+ expect(req.imp[0].ext.prebid.imp).to.eql({
2713
+ A: {l2: 'A'},
2714
+ B: {l2: 'B'}
2715
+ });
2716
+ });
2717
+ });
2718
+
2663
2719
  describe('ext.prebid config', function () {
2664
2720
  it('should send \"imp.ext.prebid.storedrequest.id\" if \"ortb2Imp.ext.prebid.storedrequest.id\" is set', function () {
2665
2721
  const consentConfig = { s2sConfig: CONFIG };
@@ -55,9 +55,9 @@ describe('ProxistoreBidAdapter', function () {
55
55
  });
56
56
  describe('buildRequests', function () {
57
57
  const url = {
58
- cookieBase: 'https://abs.proxistore.com/v3/rtb/prebid/multi',
58
+ cookieBase: 'https://api.proxistore.com/v3/rtb/prebid/multi',
59
59
  cookieLess:
60
- 'https://abs.cookieless-proxistore.com/v3/rtb/prebid/multi',
60
+ 'https://api.cookieless-proxistore.com/v3/rtb/prebid/multi',
61
61
  };
62
62
 
63
63
  let request = spec.buildRequests([bid], bidderRequest);
@@ -2607,6 +2607,21 @@ describe('PubMatic adapter', function () {
2607
2607
  expect(data.imp[1]['video']['h']).to.equal(multipleMediaRequests[1].mediaTypes.video.playerSize[1]);
2608
2608
  });
2609
2609
 
2610
+ it('should pass device.sua if present in bidderRequest fpd ortb2 object', function () {
2611
+ const suaObject = {'source': 2, 'platform': {'brand': 'macOS', 'version': ['12', '4', '0']}, 'browsers': [{'brand': 'Not_A Brand', 'version': ['99', '0', '0', '0']}, {'brand': 'Google Chrome', 'version': ['109', '0', '5414', '119']}, {'brand': 'Chromium', 'version': ['109', '0', '5414', '119']}], 'mobile': 0, 'model': '', 'bitness': '64', 'architecture': 'x86'};
2612
+ let request = spec.buildRequests(multipleMediaRequests, {
2613
+ auctionId: 'new-auction-id',
2614
+ ortb2: {
2615
+ device: {
2616
+ sua: suaObject
2617
+ }
2618
+ }
2619
+ });
2620
+ let data = JSON.parse(request.data);
2621
+ expect(data.device.sua).to.exist.and.to.be.an('object');
2622
+ expect(data.device.sua).to.deep.equal(suaObject);
2623
+ });
2624
+
2610
2625
  it('Request params should have valid native bid request for all valid params', function () {
2611
2626
  let request = spec.buildRequests(nativeBidRequests, {
2612
2627
  auctionId: 'new-auction-id'
@@ -567,7 +567,9 @@ describe('pubxai analytics adapter', function() {
567
567
  'host': location.host,
568
568
  'path': location.pathname,
569
569
  'search': location.search,
570
- 'adUnitCount': 1
570
+ 'adUnits': [
571
+ '/19968336/header-bid-tag-1'
572
+ ]
571
573
  },
572
574
  'floorDetail': {
573
575
  'fetchStatus': 'success',
@@ -0,0 +1,210 @@
1
+ import { spec, converter } from 'modules/scatteredBidAdapter.js';
2
+ import { assert } from 'chai';
3
+ import { config } from 'src/config.js';
4
+ import { deepClone, mergeDeep } from '../../../src/utils';
5
+ describe('Scattered adapter', function () {
6
+ describe('isBidRequestValid', function () {
7
+ // A valid bid
8
+ let validBid = {
9
+ bidder: 'scattered',
10
+ mediaTypes: {
11
+ banner: {
12
+ sizes: [[300, 250], [760, 400]]
13
+ }
14
+ },
15
+ params: {
16
+ bidderDomain: 'https://prebid.scattered.eu',
17
+ test: 0
18
+ }
19
+ };
20
+
21
+ // Because this valid bid is modified to create invalid bids in following tests we first check it.
22
+ // We must be sure it is a valid one, not to get false negatives.
23
+ it('should accept a valid bid', function () {
24
+ assert.isTrue(spec.isBidRequestValid(validBid));
25
+ });
26
+
27
+ it('should skip if bidderDomain info is missing', function () {
28
+ let bid = deepClone(validBid);
29
+
30
+ delete bid.params.bidderDomain;
31
+ assert.isFalse(spec.isBidRequestValid(bid));
32
+ });
33
+
34
+ it('should expect at least one banner size', function () {
35
+ let bid = deepClone(validBid);
36
+
37
+ delete bid.mediaTypes.banner;
38
+ assert.isFalse(spec.isBidRequestValid(bid));
39
+
40
+ // empty sizes array
41
+ bid.mediaTypes = {
42
+ banner: {
43
+ sizes: []
44
+ }
45
+ };
46
+ assert.isFalse(spec.isBidRequestValid(bid));
47
+ });
48
+ });
49
+
50
+ describe('buildRequests', function () {
51
+ let arrayOfValidBidRequests, validBidderRequest;
52
+
53
+ beforeEach(function () {
54
+ arrayOfValidBidRequests = [{
55
+ bidder: 'scattered',
56
+ params: {
57
+ bidderDomain: 'https://prebid.scattered.eu',
58
+ test: 0
59
+ },
60
+ mediaTypes: {
61
+ banner: {
62
+ sizes: [[300, 250], [760, 400]]
63
+ },
64
+ adUnitCode: 'test-div',
65
+ transactionId: '32d09c47-c6b8-40b0-9605-2e251a472ea4',
66
+ bidId: '21adc5d8765aa1',
67
+ bidderRequestId: '130728f7662afc',
68
+ auctionId: 'b4a45a23-8371-4d87-9308-39146b29ca32',
69
+ },
70
+ }];
71
+
72
+ validBidderRequest = {
73
+ bidderCode: 'scattered',
74
+ auctionId: 'b4a45a23-8371-4d87-9308-39146b29ca32',
75
+ gdprConsent: { consentString: 'BOtmiBKOtmiBKABABAENAFAAAAACeAAA', gdprApplies: true },
76
+ refererInfo: {
77
+ domain: 'localhost',
78
+ page: 'http://localhost:9999/integrationExamples/gpt/hello_world.html?pbjs_debug=true',
79
+ },
80
+ ortb2: {
81
+ site: {
82
+ publisher: {
83
+ name: 'publisher1 INC.'
84
+ }
85
+ }
86
+ }
87
+ };
88
+ });
89
+
90
+ it('should validate request format', function () {
91
+ let request = spec.buildRequests(arrayOfValidBidRequests, validBidderRequest);
92
+ assert.equal(request.method, 'POST');
93
+ assert.deepEqual(request.options, { contentType: 'application/json' });
94
+ assert.ok(request.data);
95
+ });
96
+
97
+ it('has the right fields filled', function () {
98
+ let request = spec.buildRequests(arrayOfValidBidRequests, validBidderRequest);
99
+ const bidderRequest = request.data;
100
+ assert.equal(bidderRequest.id, validBidderRequest.auctionId);
101
+ assert.ok(bidderRequest.site);
102
+ assert.ok(bidderRequest.source);
103
+ assert.lengthOf(bidderRequest.imp, 1);
104
+ });
105
+
106
+ it('should configure the site object', function () {
107
+ let request = spec.buildRequests(arrayOfValidBidRequests, validBidderRequest);
108
+ const site = request.data.site;
109
+ assert.equal(site.publisher.name, validBidderRequest.ortb2.site.publisher.name)
110
+ });
111
+
112
+ it('should configure site with ortb2', function () {
113
+ const req = mergeDeep({}, validBidderRequest, {
114
+ ortb2: {
115
+ site: {
116
+ id: '876',
117
+ publisher: {
118
+ domain: 'publisher1.eu'
119
+ }
120
+ }
121
+ }
122
+ });
123
+
124
+ let request = spec.buildRequests(arrayOfValidBidRequests, req);
125
+ const site = request.data.site;
126
+ assert.deepEqual(site, {
127
+ id: '876',
128
+ publisher: {
129
+ domain: 'publisher1.eu',
130
+ name: 'publisher1 INC.'
131
+ }
132
+ });
133
+ });
134
+
135
+ it('should send device info', function () {
136
+ it('should send info about device', function () {
137
+ config.setConfig({
138
+ device: { w: 375, h: 273 }
139
+ });
140
+
141
+ let request = spec.buildRequests(arrayOfValidBidRequests, validBidderRequest);
142
+
143
+ assert.equal(request.device.ua, navigator.userAgent);
144
+ assert.equal(request.device.w, 375);
145
+ assert.equal(request.device.h, 273);
146
+ });
147
+ })
148
+ })
149
+ })
150
+
151
+ describe('interpretResponse', function () {
152
+ const serverResponse = {
153
+ body: {
154
+ id: 'b4a45a23-8371-4d87-9308-39146b29ca32',
155
+ bidid: '11111111-2222-2222-2222-333333333333',
156
+ cur: 'PLN',
157
+ seatbid: [{
158
+ bid: [
159
+ {
160
+ id: '234234-234234-234234', // bidder generated
161
+ impid: '123',
162
+ price: '34.2',
163
+ nurl: 'https://scattered.eu/nurl',
164
+ adm: '<html><img src="https://some_banner.jpeg></img></html>',
165
+ cid: '99877',
166
+ crid: '2345-2345-23',
167
+ w: 345,
168
+ h: 456
169
+ }
170
+ ]
171
+ }],
172
+ }
173
+ };
174
+
175
+ let bidderRequest = {
176
+ bids: [
177
+ {
178
+ bidId: '123',
179
+ netRevenue: 'net',
180
+ }
181
+ ]
182
+
183
+ };
184
+
185
+ let request;
186
+ beforeEach(() => {
187
+ request = { data: converter.toORTB({ bidderRequest }) };
188
+ });
189
+
190
+ it('should return if no body in response', function () {
191
+ assert.ok(!spec.interpretResponse({}, request));
192
+ });
193
+
194
+ it('should set proper values', function () {
195
+ const results = spec.interpretResponse(serverResponse, request);
196
+ const expected = {
197
+ ad: '<html><img src="https://some_banner.jpeg></img></html><div style="position:absolute;left:0px;top:0px;visibility:hidden;"><img src="https://scattered.eu/nurl"></div>',
198
+ cpm: '34.2',
199
+ creativeId: '2345-2345-23',
200
+ currency: 'PLN',
201
+ height: 456,
202
+ width: 345,
203
+ mediaType: 'banner',
204
+ requestId: '123',
205
+ ttl: 360,
206
+ };
207
+ expect(results.length).to.equal(1);
208
+ sinon.assert.match(results[0], expected);
209
+ });
210
+ });
@@ -1,17 +1,17 @@
1
- import { addSegmentData, getSegmentsAndCategories, sirdataSubmodule } from 'modules/sirdataRtdProvider.js';
2
- import { server } from 'test/mocks/xhr.js';
1
+ import {addSegmentData, getSegmentsAndCategories, sirdataSubmodule} from 'modules/sirdataRtdProvider.js';
2
+ import {server} from 'test/mocks/xhr.js';
3
3
 
4
4
  const responseHeader = {'Content-Type': 'application/json'};
5
5
 
6
- describe('sirdataRtdProvider', function() {
7
- describe('sirdataSubmodule', function() {
6
+ describe('sirdataRtdProvider', function () {
7
+ describe('sirdataSubmodule', function () {
8
8
  it('successfully instantiates', function () {
9
- expect(sirdataSubmodule.init()).to.equal(true);
9
+ expect(sirdataSubmodule.init()).to.equal(true);
10
10
  });
11
11
  });
12
12
 
13
- describe('Add Segment Data', function() {
14
- it('adds segment data', function() {
13
+ describe('Add Segment Data', function () {
14
+ it('adds segment data', function () {
15
15
  const config = {
16
16
  params: {
17
17
  setGptKeyValues: false,
@@ -42,23 +42,34 @@ describe('sirdataRtdProvider', function() {
42
42
  contextual_categories: {'333333': 100}
43
43
  };
44
44
 
45
- addSegmentData({adUnits}, data, config, () => {});
45
+ addSegmentData({adUnits}, data, config, () => {
46
+ });
46
47
  expect(adUnits[0].bids[0].params.keywords).to.have.deep.property('sd_rtd', ['111111', '222222', '333333']);
47
- expect(adUnits[0].bids[1].ortb2.site.ext.data).to.have.deep.property('sd_rtd', ['333333']);
48
- expect(adUnits[0].bids[1].ortb2.user.ext.data).to.have.deep.property('sd_rtd', ['111111', '222222']);
49
48
  });
50
49
  });
51
50
 
52
- describe('Get Segments And Categories', function() {
53
- it('gets data from async request and adds segment data', function() {
51
+ describe('Get Segments And Categories', function () {
52
+ it('gets data from async request and adds segment data', function () {
53
+ const overrideAppnexus = function (adUnit, list, data, bid) {
54
+ deepSetValue(bid, 'params.keywords.custom', list);
55
+ }
56
+
54
57
  const config = {
55
58
  params: {
56
59
  setGptKeyValues: false,
57
60
  contextualMinRelevancyScore: 50,
58
61
  bidders: [{
59
- bidder: 'appnexus'
62
+ bidder: 'appnexus',
63
+ customFunction: overrideAppnexus
60
64
  }, {
61
- bidder: 'other'
65
+ bidder: 'smartadserver'
66
+ }, {
67
+ bidder: 'ix',
68
+ sizeLimit: 1200,
69
+ }, {
70
+ bidder: 'rubicon',
71
+ }, {
72
+ bidder: 'proxistore',
62
73
  }]
63
74
  }
64
75
  };
@@ -71,24 +82,107 @@ describe('sirdataRtdProvider', function() {
71
82
  placementId: 13144370
72
83
  }
73
84
  }, {
74
- bidder: 'other'
85
+ bidder: 'smartadserver',
86
+ params: {
87
+ siteId: 207435,
88
+ pageId: 896536,
89
+ formatId: 62913
90
+ }
91
+ }, {
92
+ bidder: 'proxistore',
93
+ params: {website: 'demo.sirdata.com', language: 'fr'},
94
+ adUnitCode: 'HALFPAGE_CENTER_LOADER',
95
+ transactionId: '92ac333a-a569-4827-abf1-01fc9d19278a',
96
+ sizes: [[300, 600]],
97
+ mediaTypes: {
98
+ banner: {
99
+ filteredSizeConfig: [
100
+ {minViewPort: [1600, 0], sizes: [[300, 600]]},
101
+ ],
102
+ sizeConfig: [
103
+ {minViewPort: [0, 0], sizes: [[300, 600]]},
104
+ {minViewPort: [768, 0], sizes: [[300, 600]]},
105
+ {minViewPort: [1200, 0], sizes: [[300, 600]]},
106
+ {minViewPort: [1600, 0], sizes: [[300, 600]]},
107
+ ],
108
+ sizes: [[300, 600]],
109
+ },
110
+ },
111
+ bidId: '190bab495bc5f6e',
112
+ bidderRequestId: '18c0b0f0c91cd88',
113
+ auctionId: '9bdd917b-908d-4d9f-8f2f-d443277a62fc',
114
+ src: 'client',
115
+ bidRequestsCount: 1,
116
+ bidderRequestsCount: 1,
117
+ bidderWinsCount: 0,
118
+ }, {
119
+ bidder: 'ix',
120
+ params: {
121
+ siteId: '12345',
122
+ size: [300, 600]
123
+ }
124
+ }, {
125
+ bidder: 'rubicon',
126
+ params: {
127
+ accountId: 14062,
128
+ siteId: 70608,
129
+ zoneId: 498816
130
+ }
75
131
  }]
76
- }]
132
+ }],
133
+ ortb2Fragments: {
134
+ global: {}
135
+ }
77
136
  };
78
137
 
79
138
  let data = {
80
- segments: [111111, 222222],
81
- contextual_categories: {'333333': 100}
139
+ 'segments': [111111, 222222],
140
+ 'segtaxid': null,
141
+ 'cattaxid': null,
142
+ 'contextual_categories': {'333333': 100},
143
+ 'shared_taxonomy': {
144
+ '27440': {
145
+ 'segments': [444444, 555555],
146
+ 'segtaxid': 552,
147
+ 'cattaxid': 553,
148
+ 'contextual_categories': {'666666': 100}
149
+ }
150
+ },
151
+ 'global_taxonomy': {
152
+ '9998': {
153
+ 'segments': [123, 234],
154
+ 'segtaxid': 4,
155
+ 'cattaxid': 7,
156
+ 'contextual_categories': {'345': 100, '456': 100}
157
+ }
158
+ }
82
159
  };
83
160
 
84
- getSegmentsAndCategories(reqBidsConfigObj, () => {}, config, {});
161
+ getSegmentsAndCategories(reqBidsConfigObj, () => {
162
+ }, config, {});
85
163
 
86
164
  let request = server.requests[0];
87
165
  request.respond(200, responseHeader, JSON.stringify(data));
88
166
 
89
- expect(reqBidsConfigObj.adUnits[0].bids[0].params.keywords).to.have.deep.property('sd_rtd', ['111111', '222222', '333333']);
90
- expect(reqBidsConfigObj.adUnits[0].bids[1].ortb2.site.ext.data).to.have.deep.property('sd_rtd', ['333333']);
91
- expect(reqBidsConfigObj.adUnits[0].bids[1].ortb2.user.ext.data).to.have.deep.property('sd_rtd', ['111111', '222222']);
167
+ expect(reqBidsConfigObj.adUnits[0].bids[1].params).to.have.deep.property('target', 'sd_rtd=111111;sd_rtd=222222;sd_rtd=333333;sd_rtd=444444;sd_rtd=555555;sd_rtd=666666');
168
+
169
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.content.data[0].name).to.equal(
170
+ 'sirdata.com'
171
+ );
172
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.content.data[0].segment).to.eql([
173
+ {id: '345'},
174
+ {id: '456'}
175
+ ]);
176
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.content.data[0].ext.segtax).to.equal(7);
177
+
178
+ expect(reqBidsConfigObj.ortb2Fragments.global.user.data[0].name).to.equal(
179
+ 'sirdata.com'
180
+ );
181
+ expect(reqBidsConfigObj.ortb2Fragments.global.user.data[0].segment).to.eql([
182
+ {id: '123'},
183
+ {id: '234'}
184
+ ]);
185
+ expect(reqBidsConfigObj.ortb2Fragments.global.user.data[0].ext.segtax).to.equal(4);
92
186
  });
93
187
  });
94
188
  });
@@ -1,9 +1,6 @@
1
1
  import { expect } from 'chai';
2
2
  import { spec } from 'modules/smilewantedBidAdapter.js';
3
- import { newBidder } from 'src/adapters/bidderFactory.js';
4
3
  import { config } from 'src/config.js';
5
- import * as utils from 'src/utils.js';
6
- import { requestBidsHook } from 'modules/consentManagement.js';
7
4
 
8
5
  const DISPLAY_REQUEST = [{
9
6
  adUnitCode: 'sw_300x250',
@@ -20,6 +17,37 @@ const DISPLAY_REQUEST = [{
20
17
  transactionId: 'trans_abcd1234'
21
18
  }];
22
19
 
20
+ const DISPLAY_REQUEST_WITH_EIDS = [{
21
+ adUnitCode: 'sw_300x250',
22
+ bidId: '12345',
23
+ sizes: [
24
+ [300, 250],
25
+ [300, 200]
26
+ ],
27
+ bidder: 'smilewanted',
28
+ params: {
29
+ zoneId: 1
30
+ },
31
+ requestId: 'request_abcd1234',
32
+ transactionId: 'trans_abcd1234',
33
+ userIdAsEids: [{
34
+ source: 'pubcid.org',
35
+ uids: [{
36
+ id: 'some-random-id-value',
37
+ atype: 1
38
+ }]
39
+ }, {
40
+ source: 'adserver.org',
41
+ uids: [{
42
+ id: 'some-random-id-value',
43
+ atype: 1,
44
+ ext: {
45
+ rtiPartner: 'TDID'
46
+ }
47
+ }]
48
+ }]
49
+ }];
50
+
23
51
  const DISPLAY_REQUEST_WITH_POSITION_TYPE = [{
24
52
  adUnitCode: 'sw_300x250',
25
53
  bidId: '12345',
@@ -170,6 +198,29 @@ describe('smilewantedBidAdapterTests', function () {
170
198
  expect(requestContent).to.have.property('pageDomain').and.to.equal('https://localhost/Prebid.js/integrationExamples/gpt/hello_world.html');
171
199
  });
172
200
 
201
+ it('Verify external ids in request and ids found', function () {
202
+ config.setConfig({
203
+ 'currency': {
204
+ 'adServerCurrency': 'EUR'
205
+ }
206
+ });
207
+ const request = spec.buildRequests(DISPLAY_REQUEST_WITH_EIDS, {});
208
+ const requestContent = JSON.parse(request[0].data);
209
+
210
+ expect(requestContent).to.have.property('eids');
211
+ expect(requestContent.eids).to.not.equal(null).and.to.not.be.undefined;
212
+ expect(requestContent.eids.length).to.greaterThan(0);
213
+ for (let index in requestContent.eids) {
214
+ let eid = requestContent.eids[index];
215
+ expect(eid.source).to.not.equal(null).and.to.not.be.undefined;
216
+ expect(eid.uids).to.not.equal(null).and.to.not.be.undefined;
217
+ for (let uidsIndex in eid.uids) {
218
+ let uid = eid.uids[uidsIndex];
219
+ expect(uid.id).to.not.equal(null).and.to.not.be.undefined;
220
+ }
221
+ }
222
+ });
223
+
173
224
  describe('gdpr tests', function () {
174
225
  afterEach(function () {
175
226
  config.resetConfig();
@@ -371,7 +371,7 @@ describe('SonobiBidAdapter', function () {
371
371
  }
372
372
  }
373
373
  };
374
- const bidRequests = spec.buildRequests(bidRequest, {...bidderRequests, ortb2});
374
+ const bidRequests = spec.buildRequests(bidRequest, { ...bidderRequests, ortb2 });
375
375
  expect(bidRequests.data.fpd).to.equal(JSON.stringify(ortb2));
376
376
  });
377
377
 
@@ -540,7 +540,7 @@ describe('SonobiBidAdapter', function () {
540
540
  ]);
541
541
  });
542
542
 
543
- it('should return a properly formatted request with userid as a JSON-encoded set of User ID results', function () {
543
+ it('should return a properly formatted request with the userid value omitted when the userId object is present on the bidRequest. ', function () {
544
544
  bidRequest[0].userId = { 'pubcid': 'abcd-efg-0101', 'tdid': 'td-abcd-efg-0101', 'id5id': { 'uid': 'ID5-ZHMOrVeUVTUKgrZ-a2YGxeh5eS_pLzHCQGYOEAiTBQ', 'ext': { 'linkType': 2 } } };
545
545
  bidRequest[1].userId = { 'pubcid': 'abcd-efg-0101', 'tdid': 'td-abcd-efg-0101', 'id5id': { 'uid': 'ID5-ZHMOrVeUVTUKgrZ-a2YGxeh5eS_pLzHCQGYOEAiTBQ', 'ext': { 'linkType': 2 } } };
546
546
  const bidRequests = spec.buildRequests(bidRequest, bidderRequests);
@@ -548,29 +548,7 @@ describe('SonobiBidAdapter', function () {
548
548
  expect(bidRequests.method).to.equal('GET');
549
549
  expect(bidRequests.data.ref).not.to.be.empty;
550
550
  expect(bidRequests.data.s).not.to.be.empty;
551
- expect(JSON.parse(bidRequests.data.userid)).to.eql({ 'pubcid': 'abcd-efg-0101', 'tdid': 'td-abcd-efg-0101', 'id5id': 'ID5-ZHMOrVeUVTUKgrZ-a2YGxeh5eS_pLzHCQGYOEAiTBQ' });
552
- });
553
-
554
- it('should return a properly formatted request with userid omitted if there are no userIds', function () {
555
- bidRequest[0].userId = {};
556
- bidRequest[1].userId = {};
557
- const bidRequests = spec.buildRequests(bidRequest, bidderRequests);
558
- expect(bidRequests.url).to.equal('https://apex.go.sonobi.com/trinity.json');
559
- expect(bidRequests.method).to.equal('GET');
560
- expect(bidRequests.data.ref).not.to.be.empty;
561
- expect(bidRequests.data.s).not.to.be.empty;
562
- expect(bidRequests.data.userid).to.equal(undefined);
563
- });
564
-
565
- it('should return a properly formatted request with userid omitted', function () {
566
- bidRequest[0].userId = undefined;
567
- bidRequest[1].userId = undefined;
568
- const bidRequests = spec.buildRequests(bidRequest, bidderRequests);
569
- expect(bidRequests.url).to.equal('https://apex.go.sonobi.com/trinity.json');
570
- expect(bidRequests.method).to.equal('GET');
571
- expect(bidRequests.data.ref).not.to.be.empty;
572
- expect(bidRequests.data.s).not.to.be.empty;
573
- expect(bidRequests.data.userid).to.equal(undefined);
551
+ expect(bidRequests.data.userid).to.be.undefined;
574
552
  });
575
553
 
576
554
  it('should return a properly formatted request with keywrods included as a csv of strings', function () {
@@ -725,11 +725,11 @@ describe('triplelift adapter', function () {
725
725
 
726
726
  it('should add amxRtbId to the payload if included', function () {
727
727
  const id = 'Ok9JQkBM-UFlAXEZQ-UUNBQlZOQzgrUFhW-UUNBQkRQTUBPQVpVWVxNXlZUUF9AUFhAUF9PXFY/';
728
- bidRequests[0].userIdAsEids = [{ source: 'amxrtb.com', uids: [{ id }] }];
728
+ bidRequests[0].userIdAsEids = [{ source: 'amxdt.net', uids: [{ id }] }];
729
729
  const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
730
730
  const payload = request.data;
731
731
  expect(payload).to.exist;
732
- expect(payload.user).to.deep.equal({ext: {eids: [{source: 'amxrtb.com', uids: [{id, ext: {rtiPartner: 'amxrtb.com'}}]}]}});
732
+ expect(payload.user).to.deep.equal({ext: {eids: [{source: 'amxdt.net', uids: [{id, ext: {rtiPartner: 'amxdt.net'}}]}]}});
733
733
  });
734
734
 
735
735
  it('should add tdid, idl_env and criteoId to the payload if both are included', function () {
@@ -1437,6 +1437,13 @@ describe('triplelift adapter', function () {
1437
1437
  expect(result[0].meta.advertiserDomains[1]).to.equal('internetalerts.org');
1438
1438
  expect(result[1].meta).to.not.have.key('advertiserDomains');
1439
1439
  });
1440
+
1441
+ it('should include networkId in the meta field if available', function () {
1442
+ let result = tripleliftAdapterSpec.interpretResponse(response, {bidderRequest});
1443
+ expect(result[1].meta.networkId).to.equal('10092');
1444
+ expect(result[2].meta.networkId).to.equal('5989');
1445
+ expect(result[3].meta.networkId).to.equal('5989');
1446
+ });
1440
1447
  });
1441
1448
 
1442
1449
  describe('getUserSyncs', function() {
@@ -1298,7 +1298,7 @@ describe('User ID', function () {
1298
1298
  expect(bid).to.have.deep.nested.property('userId.amxId');
1299
1299
  expect(bid.userId.amxId).to.equal('test_amxid_id');
1300
1300
  expect(bid.userIdAsEids[0]).to.deep.equal({
1301
- source: 'amxrtb.com',
1301
+ source: 'amxdt.net',
1302
1302
  uids: [{
1303
1303
  id: 'test_amxid_id',
1304
1304
  atype: 1,