prebid.js 7.5.0 → 7.6.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 (154) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/adagioBidAdapter.js +1 -1
  3. package/dist/adbookpspBidAdapter.js +1 -1
  4. package/dist/adgenerationBidAdapter.js +1 -1
  5. package/dist/adnuntiusBidAdapter.js +1 -1
  6. package/dist/adotBidAdapter.js +1 -1
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adrinoBidAdapter.js +1 -1
  9. package/dist/adtelligentBidAdapter.js +1 -1
  10. package/dist/adxcgBidAdapter.js +1 -1
  11. package/dist/ajaBidAdapter.js +1 -1
  12. package/dist/amxBidAdapter.js +1 -1
  13. package/dist/amxIdSystem.js +1 -1
  14. package/dist/appierAnalyticsAdapter.js +1 -1
  15. package/dist/appnexusBidAdapter.js +1 -1
  16. package/dist/asoBidAdapter.js +1 -1
  17. package/dist/atsAnalyticsAdapter.js +1 -1
  18. package/dist/axonixBidAdapter.js +1 -1
  19. package/dist/bidglassBidAdapter.js +1 -1
  20. package/dist/big-richmediaBidAdapter.js +1 -1
  21. package/dist/bridgewellBidAdapter.js +1 -1
  22. package/dist/brightMountainMediaBidAdapter.js +1 -1
  23. package/dist/byDataAnalyticsAdapter.js +1 -1
  24. package/dist/concertBidAdapter.js +1 -1
  25. package/dist/connectadBidAdapter.js +1 -1
  26. package/dist/consumableBidAdapter.js +1 -1
  27. package/dist/conversantBidAdapter.js +1 -1
  28. package/dist/craftBidAdapter.js +1 -1
  29. package/dist/criteoBidAdapter.js +1 -1
  30. package/dist/dspxBidAdapter.js +1 -1
  31. package/dist/eplanningBidAdapter.js +1 -1
  32. package/dist/finativeBidAdapter.js +1 -1
  33. package/dist/glimpseBidAdapter.js +1 -1
  34. package/dist/gmosspBidAdapter.js +1 -1
  35. package/dist/goldbachBidAdapter.js +1 -1
  36. package/dist/gridBidAdapter.js +1 -1
  37. package/dist/gridNMBidAdapter.js +1 -1
  38. package/dist/gumgumBidAdapter.js +1 -1
  39. package/dist/h12mediaBidAdapter.js +1 -1
  40. package/dist/id5IdSystem.js +1 -1
  41. package/dist/imRtdProvider.js +1 -1
  42. package/dist/improvedigitalBidAdapter.js +1 -1
  43. package/dist/inmarBidAdapter.js +1 -1
  44. package/dist/insticatorBidAdapter.js +1 -1
  45. package/dist/ixBidAdapter.js +1 -1
  46. package/dist/justpremiumBidAdapter.js +1 -1
  47. package/dist/konduitAnalyticsAdapter.js +1 -1
  48. package/dist/kueezBidAdapter.js +1 -1
  49. package/dist/lassoBidAdapter.js +1 -1
  50. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  51. package/dist/logicadBidAdapter.js +1 -1
  52. package/dist/loglyliftBidAdapter.js +1 -1
  53. package/dist/malltvAnalyticsAdapter.js +1 -1
  54. package/dist/marsmediaBidAdapter.js +1 -1
  55. package/dist/mediafuseBidAdapter.js +1 -1
  56. package/dist/mediasquareBidAdapter.js +1 -1
  57. package/dist/mgidBidAdapter.js +1 -1
  58. package/dist/minutemediaBidAdapter.js +1 -1
  59. package/dist/newspassidBidAdapter.js +1 -0
  60. package/dist/nextMillenniumBidAdapter.js +1 -1
  61. package/dist/not-for-prod/prebid.js +115 -113
  62. package/dist/oguryBidAdapter.js +1 -1
  63. package/dist/onetagBidAdapter.js +1 -1
  64. package/dist/ooloAnalyticsAdapter.js +1 -1
  65. package/dist/outbrainBidAdapter.js +1 -1
  66. package/dist/parrableIdSystem.js +1 -1
  67. package/dist/pixfutureBidAdapter.js +1 -1
  68. package/dist/prebid-core.js +1 -1
  69. package/dist/priceFloors.js +1 -1
  70. package/dist/publinkIdSystem.js +1 -1
  71. package/dist/pubmaticBidAdapter.js +1 -1
  72. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  73. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  74. package/dist/pxyzBidAdapter.js +1 -1
  75. package/dist/quantcastBidAdapter.js +1 -1
  76. package/dist/rasBidAdapter.js +1 -0
  77. package/dist/readpeakBidAdapter.js +1 -1
  78. package/dist/relaidoBidAdapter.js +1 -1
  79. package/dist/rhythmoneBidAdapter.js +1 -1
  80. package/dist/riseBidAdapter.js +1 -1
  81. package/dist/rubiconAnalyticsAdapter.js +1 -1
  82. package/dist/rubiconBidAdapter.js +1 -1
  83. package/dist/seedingAllianceBidAdapter.js +1 -1
  84. package/dist/seedtagBidAdapter.js +1 -1
  85. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  86. package/dist/sharethroughBidAdapter.js +1 -1
  87. package/dist/shinezBidAdapter.js +1 -1
  88. package/dist/smaatoBidAdapter.js +1 -1
  89. package/dist/smartadserverBidAdapter.js +1 -1
  90. package/dist/smartxBidAdapter.js +1 -1
  91. package/dist/smilewantedBidAdapter.js +1 -1
  92. package/dist/sonobiBidAdapter.js +1 -1
  93. package/dist/sovrnAnalyticsAdapter.js +1 -1
  94. package/dist/sovrnBidAdapter.js +1 -1
  95. package/dist/sspBCBidAdapter.js +1 -1
  96. package/dist/sublimeBidAdapter.js +1 -1
  97. package/dist/synacormediaBidAdapter.js +1 -1
  98. package/dist/targetVideoBidAdapter.js +1 -1
  99. package/dist/teadsBidAdapter.js +1 -1
  100. package/dist/trionBidAdapter.js +1 -1
  101. package/dist/tripleliftBidAdapter.js +1 -1
  102. package/dist/ttdBidAdapter.js +1 -1
  103. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  104. package/dist/underdogmediaBidAdapter.js +1 -1
  105. package/dist/undertoneBidAdapter.js +1 -1
  106. package/dist/vidazooBidAdapter.js +1 -1
  107. package/dist/videobyteBidAdapter.js +1 -1
  108. package/dist/visxBidAdapter.js +1 -1
  109. package/dist/vuukleBidAdapter.js +1 -1
  110. package/dist/widespaceBidAdapter.js +1 -1
  111. package/dist/winrBidAdapter.js +1 -1
  112. package/dist/yahoosspBidAdapter.js +1 -1
  113. package/dist/yieldmoBidAdapter.js +1 -1
  114. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  115. package/modules/adgenerationBidAdapter.js +24 -1
  116. package/modules/adnuntiusBidAdapter.js +26 -8
  117. package/modules/adotBidAdapter.js +10 -1
  118. package/modules/adrinoBidAdapter.js +10 -2
  119. package/modules/adrinoBidAdapter.md +6 -0
  120. package/modules/adtelligentBidAdapter.js +2 -1
  121. package/modules/atsAnalyticsAdapter.js +4 -5
  122. package/modules/byDataAnalyticsAdapter.js +172 -74
  123. package/modules/byDataAnalyticsAdapter.md +5 -6
  124. package/modules/consumableBidAdapter.js +12 -1
  125. package/modules/eplanningBidAdapter.js +82 -97
  126. package/modules/gridNMBidAdapter.js +45 -4
  127. package/modules/imRtdProvider.js +0 -8
  128. package/modules/ixBidAdapter.js +5 -1
  129. package/modules/minutemediaBidAdapter.js +1 -0
  130. package/modules/newspassidBidAdapter.js +649 -0
  131. package/modules/nextMillenniumBidAdapter.js +17 -1
  132. package/modules/oguryBidAdapter.js +2 -0
  133. package/modules/priceFloors.js +1 -1
  134. package/modules/pubxaiAnalyticsAdapter.js +6 -1
  135. package/modules/rasBidAdapter.js +149 -0
  136. package/modules/rasBidAdapter.md +50 -0
  137. package/modules/seedtagBidAdapter.js +4 -0
  138. package/package.json +1 -1
  139. package/test/spec/modules/adgenerationBidAdapter_spec.js +52 -4
  140. package/test/spec/modules/adnuntiusBidAdapter_spec.js +126 -14
  141. package/test/spec/modules/adotBidAdapter_spec.js +12 -9
  142. package/test/spec/modules/adrinoBidAdapter_spec.js +22 -0
  143. package/test/spec/modules/byDataAnalyticsAdapter_spec.js +74 -24
  144. package/test/spec/modules/consumableBidAdapter_spec.js +75 -0
  145. package/test/spec/modules/eplanningBidAdapter_spec.js +58 -18
  146. package/test/spec/modules/gridNMBidAdapter_spec.js +32 -0
  147. package/test/spec/modules/imRtdProvider_spec.js +0 -1
  148. package/test/spec/modules/ixBidAdapter_spec.js +41 -0
  149. package/test/spec/modules/minutemediaBidAdapter_spec.js +3 -0
  150. package/test/spec/modules/newspassidBidAdapter_spec.js +1793 -0
  151. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +20 -0
  152. package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +5 -0
  153. package/test/spec/modules/rasBidAdapter_spec.js +190 -0
  154. package/test/spec/modules/seedtagBidAdapter_spec.js +25 -0
@@ -28,7 +28,7 @@ describe('Adot Adapter', function () {
28
28
  it('should build request (banner)', function () {
29
29
  const bidderRequestId = 'bidderRequestId';
30
30
  const validBidRequests = [{ bidderRequestId, mediaTypes: {} }, { bidderRequestId, bidId: 'bidId', mediaTypes: { banner: { sizes: [[300, 250]] } }, params: { placementId: 'placementId', adUnitCode: 200 } }];
31
- const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true } };
31
+ const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true }, userId: { pubProvidedId: 'userId' }, schain: { ver: '1.0' } };
32
32
 
33
33
  const request = spec.buildRequests(validBidRequests, bidderRequest);
34
34
  const buildBidRequestResponse = {
@@ -54,10 +54,11 @@ describe('Adot Adapter', function () {
54
54
  publisher: {
55
55
  // id: 'adot'
56
56
  id: undefined
57
- }
57
+ },
58
+ ext: { schain: { ver: '1.0' } }
58
59
  },
59
60
  device: { ua: navigator.userAgent, language: navigator.language },
60
- user: { ext: { consent: bidderRequest.gdprConsent.consentString } },
61
+ user: { ext: { consent: bidderRequest.gdprConsent.consentString, pubProvidedId: 'userId' } },
61
62
  regs: { ext: { gdpr: bidderRequest.gdprConsent.gdprApplies } },
62
63
  ext: {
63
64
  adot: { adapter_version: 'v2.0.0' },
@@ -76,7 +77,7 @@ describe('Adot Adapter', function () {
76
77
  it('should build request (native)', function () {
77
78
  const bidderRequestId = 'bidderRequestId';
78
79
  const validBidRequests = [{ bidderRequestId, mediaTypes: {} }, { bidderRequestId, bidId: 'bidId', mediaTypes: { native: { title: { required: true, len: 50, sizes: [[300, 250]] }, wrong: {}, image: {} } }, params: { placementId: 'placementId', adUnitCode: 200 } }];
79
- const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true } };
80
+ const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true }, userId: { pubProvidedId: 'userId' }, schain: { ver: '1.0' } };
80
81
 
81
82
  const request = spec.buildRequests(validBidRequests, bidderRequest);
82
83
  const buildBidRequestResponse = {
@@ -101,10 +102,11 @@ describe('Adot Adapter', function () {
101
102
  publisher: {
102
103
  // id: 'adot'
103
104
  id: undefined
104
- }
105
+ },
106
+ ext: { schain: { ver: '1.0' } }
105
107
  },
106
108
  device: { ua: navigator.userAgent, language: navigator.language },
107
- user: { ext: { consent: bidderRequest.gdprConsent.consentString } },
109
+ user: { ext: { consent: bidderRequest.gdprConsent.consentString, pubProvidedId: 'userId' } },
108
110
  regs: { ext: { gdpr: bidderRequest.gdprConsent.gdprApplies } },
109
111
  ext: {
110
112
  adot: { adapter_version: 'v2.0.0' },
@@ -123,7 +125,7 @@ describe('Adot Adapter', function () {
123
125
  it('should build request (video)', function () {
124
126
  const bidderRequestId = 'bidderRequestId';
125
127
  const validBidRequests = [{ bidderRequestId, mediaTypes: {} }, { bidderRequestId, bidId: 'bidId', mediaTypes: { video: { playerSize: [[300, 250]], minduration: 1, maxduration: 2, api: 'api', linearity: 'linearity', mimes: [], placement: 'placement', playbackmethod: 'playbackmethod', protocols: 'protocol', startdelay: 'startdelay' } }, params: { placementId: 'placementId', adUnitCode: 200 } }];
126
- const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true } };
128
+ const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true }, userId: { pubProvidedId: 'userId' }, schain: { ver: '1.0' } };
127
129
 
128
130
  const request = spec.buildRequests(validBidRequests, bidderRequest);
129
131
  const buildBidRequestResponse = {
@@ -160,10 +162,11 @@ describe('Adot Adapter', function () {
160
162
  publisher: {
161
163
  // id: 'adot'
162
164
  id: undefined
163
- }
165
+ },
166
+ ext: { schain: { ver: '1.0' } }
164
167
  },
165
168
  device: { ua: navigator.userAgent, language: navigator.language },
166
- user: { ext: { consent: bidderRequest.gdprConsent.consentString } },
169
+ user: { ext: { consent: bidderRequest.gdprConsent.consentString, pubProvidedId: 'userId' } },
167
170
  regs: { ext: { gdpr: bidderRequest.gdprConsent.gdprApplies } },
168
171
  ext: {
169
172
  adot: { adapter_version: 'v2.0.0' },
@@ -1,8 +1,13 @@
1
1
  import { expect } from 'chai';
2
2
  import { spec } from 'modules/adrinoBidAdapter.js';
3
+ import {config} from '../../../src/config.js';
3
4
  import * as utils from '../../../src/utils';
4
5
 
5
6
  describe('adrinoBidAdapter', function () {
7
+ afterEach(() => {
8
+ config.resetConfig();
9
+ });
10
+
6
11
  describe('isBidRequestValid', function () {
7
12
  const validBid = {
8
13
  bidder: 'adrino',
@@ -72,6 +77,23 @@ describe('adrinoBidAdapter', function () {
72
77
  auctionId: '01234567891234',
73
78
  };
74
79
 
80
+ it('should build the request correctly with custom domain', function () {
81
+ config.setConfig({adrino: { host: 'https://stg-prebid-bidder.adrino.io' }});
82
+ const result = spec.buildRequests(
83
+ [ bidRequest ],
84
+ { refererInfo: { page: 'http://example.com/' } }
85
+ );
86
+ expect(result.length).to.equal(1);
87
+ expect(result[0].method).to.equal('POST');
88
+ expect(result[0].url).to.equal('https://stg-prebid-bidder.adrino.io/bidder/bid/');
89
+ expect(result[0].data.bidId).to.equal('12345678901234');
90
+ expect(result[0].data.placementHash).to.equal('abcdef123456');
91
+ expect(result[0].data.referer).to.equal('http://example.com/');
92
+ expect(result[0].data.userAgent).to.equal(navigator.userAgent);
93
+ expect(result[0].data).to.have.property('nativeParams');
94
+ expect(result[0].data).not.to.have.property('gdprConsent');
95
+ });
96
+
75
97
  it('should build the request correctly with gdpr', function () {
76
98
  const result = spec.buildRequests(
77
99
  [ bidRequest ],
@@ -9,18 +9,19 @@ const initOptions = {
9
9
  logFrequency: 1,
10
10
  };
11
11
  let userData = {
12
- userId: '5da77-ec87-277b-8e7a5',
13
- client_id: 'asc00000',
14
- plateform_name: 'Macintosh',
15
- os_version: 10.157,
16
- browser_name: 'Chrome',
17
- browser_version: 92.04515107,
18
- screen_size: {
19
- width: 1440,
20
- height: 900
12
+ 'uid': '271a8-2b86-f4a4-f59bc',
13
+ 'cid': 'asc00000',
14
+ 'pid': 'www.letsrun.com',
15
+ 'os': 'Macintosh',
16
+ 'osv': 10.157,
17
+ 'br': 'Chrome',
18
+ 'brv': 103,
19
+ 'ss': {
20
+ 'width': 1792,
21
+ 'height': 1120
21
22
  },
22
- device_type: 'Desktop',
23
- time_zone: 'Asia/Calcutta'
23
+ 'de': 'Desktop',
24
+ 'tz': 'Asia/Calcutta'
24
25
  };
25
26
  let bidTimeoutArgs = [{
26
27
  auctionId,
@@ -39,6 +40,18 @@ let noBidArgs = {
39
40
  src: 'client',
40
41
  transactionId: 'c8ee3914-1ee0-4ce6-9126-748d5692188c'
41
42
  }
43
+ let bidWonArgs = {
44
+ auctionId,
45
+ adUnitCode: 'div-gpt-ad-mrec1',
46
+ size: '300x250',
47
+ requestId: '15c86b6c10d3746',
48
+ bidder: 'appnexus',
49
+ timeToRespond: 114,
50
+ currency: 'USD',
51
+ mediaType: 'display',
52
+ cpm: 0.50
53
+ }
54
+
42
55
  let auctionEndArgs = {
43
56
  adUnitCodes: ['div-gpt-ad-mrec1'],
44
57
  adUnits: [{
@@ -74,21 +87,54 @@ let auctionEndArgs = {
74
87
  }]
75
88
  }
76
89
  let expectedDataArgs = {
77
- visitor_data: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1ZGE3Ny1lYzg3LTI3N2ItOGU3YTUiLCJjbGllbnRfaWQiOiJhc2MwMDAwMCIsInBsYXRlZm9ybV9uYW1lIjoiTWFjaW50b3NoIiwib3NfdmVyc2lvbiI6MTAuMTU3LCJicm93c2VyX25hbWUiOiJDaHJvbWUiLCJicm93c2VyX3ZlcnNpb24iOjkyLjA0NTE1MTA3LCJzY3JlZW5fc2l6ZSI6eyJ3aWR0aCI6MTQ0MCwiaGVpZ2h0Ijo5MDB9LCJkZXZpY2VfdHlwZSI6IkRlc2t0b3AiLCJ0aW1lX3pvbmUiOiJBc2lhL0NhbGN1dHRhIn0.jNKjsb3Q-ZjkVMcbss_dQFOmu_GdkGqd7t9MbRmqlG4YEMorcJHhUVmUuPi-9pKvC9_t4XlgjED90UieCvdxCQ',
78
- auction_id: auctionId,
79
- auction_start: 1627973484504,
90
+ visitor_data: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIyNzFhOC0yYjg2LWY0YTQtZjU5YmMiLCJjaWQiOiJhc2MwMDAwMCIsInBpZCI6Ind3dy5sZXRzcnVuLmNvbSIsIm9zIjoiTWFjaW50b3NoIiwib3N2IjoxMC4xNTcsImJyIjoiQ2hyb21lIiwiYnJ2IjoxMDMsInNzIjp7IndpZHRoIjoxNzkyLCJoZWlnaHQiOjExMjB9LCJkZSI6IkRlc2t0b3AiLCJ0eiI6IkFzaWEvQ2FsY3V0dGEifQ.Oj3qnh--t06XO-foVmrMJCGqFfOBed09A-f7LZX5rtfBf4w1_RNRZ4F3on4TMPLonSa7GgzbcEfJS9G_amnleQ',
91
+ aid: auctionId,
92
+ as: 1627973484504,
80
93
  auctionData: [ {
81
- 'adUnit': 'div-gpt-ad-mrec1',
82
- 'size': '300x250',
83
- 'media_type': 'display',
84
- 'bids_bidder': 'appnexus',
85
- 'bids_bid_id': '14480e9832f2d2b'
94
+ au: 'div-gpt-ad-mrec1',
95
+ auc: 'div-gpt-ad-mrec1',
96
+ aus: '300x250',
97
+ bidadv: 'appnexus',
98
+ bid: '14480e9832f2d2b',
99
+ inb: 0,
100
+ ito: 0,
101
+ ipwb: 0,
102
+ iwb: 0,
103
+ mt: 'display',
86
104
  }, {
87
- 'adUnit': 'div-gpt-ad-mrec1',
88
- 'size': '250x250',
89
- 'media_type': 'display',
90
- 'bids_bidder': 'appnexus',
91
- 'bids_bid_id': '14480e9832f2d2b'
105
+ au: 'div-gpt-ad-mrec1',
106
+ auc: 'div-gpt-ad-mrec1',
107
+ aus: '250x250',
108
+ bidadv: 'appnexus',
109
+ bid: '14480e9832f2d2b',
110
+ inb: 0,
111
+ ito: 0,
112
+ ipwb: 0,
113
+ iwb: 0,
114
+ mt: 'display',
115
+ }]
116
+ }
117
+ let expectedBidWonArgs = {
118
+ visitor_data: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIyNzFhOC0yYjg2LWY0YTQtZjU5YmMiLCJjaWQiOiJhc2MwMDAwMCIsInBpZCI6Ind3dy5sZXRzcnVuLmNvbSIsIm9zIjoiTWFjaW50b3NoIiwib3N2IjoxMC4xNTcsImJyIjoiQ2hyb21lIiwiYnJ2IjoxMDMsInNzIjp7IndpZHRoIjoxNzkyLCJoZWlnaHQiOjExMjB9LCJkZSI6IkRlc2t0b3AiLCJ0eiI6IkFzaWEvQ2FsY3V0dGEifQ.Oj3qnh--t06XO-foVmrMJCGqFfOBed09A-f7LZX5rtfBf4w1_RNRZ4F3on4TMPLonSa7GgzbcEfJS9G_amnleQ',
119
+ aid: auctionId,
120
+ as: '',
121
+ auctionData: [{
122
+ au: 'div-gpt-ad-mrec1',
123
+ auc: 'div-gpt-ad-mrec1',
124
+ aus: '300x250',
125
+ bid: '15c86b6c10d3746',
126
+ bidadv: 'appnexus',
127
+ br_pb_mg: 0.50,
128
+ br_tr: 114,
129
+ bradv: 'appnexus',
130
+ brid: '15c86b6c10d3746',
131
+ brs: '300x250',
132
+ cur: 'USD',
133
+ inb: 0,
134
+ ito: 0,
135
+ ipwb: 1,
136
+ iwb: 1,
137
+ mt: 'display',
92
138
  }]
93
139
  }
94
140
 
@@ -130,10 +176,14 @@ describe('byData Analytics Adapter ', () => {
130
176
  it('sends and formatted auction data ', function () {
131
177
  events.emit(constants.EVENTS.BID_TIMEOUT, bidTimeoutArgs);
132
178
  events.emit(constants.EVENTS.NO_BID, noBidArgs);
179
+ events.emit(constants.EVENTS.BID_WON, bidWonArgs)
133
180
  var userToken = ascAdapter.getVisitorData(userData);
134
181
  var newAuData = ascAdapter.dataProcess(auctionEndArgs);
182
+ var newBwData = ascAdapter.getBidWonData(bidWonArgs);
135
183
  newAuData['visitor_data'] = userToken;
184
+ newBwData['visitor_data'] = userToken;
136
185
  expect(newAuData).to.deep.equal(expectedDataArgs);
186
+ expect(newBwData).to.deep.equal(expectedBidWonArgs);
137
187
  });
138
188
  });
139
189
  });
@@ -1,6 +1,9 @@
1
1
  import {expect} from 'chai';
2
2
  import {spec} from 'modules/consumableBidAdapter.js';
3
3
  import {createBid} from 'src/bidfactory.js';
4
+ import {config} from 'src/config.js';
5
+ import {deepClone} from 'src/utils.js';
6
+ import { createEidsArray } from 'modules/userId/eids.js';
4
7
 
5
8
  const ENDPOINT = 'https://e.serverbid.com/api/v2';
6
9
  const SMARTSYNC_CALLBACK = 'serverbidCallBids';
@@ -425,4 +428,76 @@ describe('Consumable BidAdapter', function () {
425
428
  expect(opts.length).to.equal(1);
426
429
  });
427
430
  });
431
+ describe('unifiedId from userId module', function() {
432
+ let sandbox, bidderRequest;
433
+ beforeEach(() => {
434
+ sandbox = sinon.sandbox.create();
435
+ bidderRequest = deepClone(BIDDER_REQUEST_1);
436
+ });
437
+
438
+ afterEach(() => {
439
+ sandbox.restore();
440
+ });
441
+
442
+ it('Request should have unifiedId config params', function() {
443
+ bidderRequest.bidRequest[0].userId = {};
444
+ bidderRequest.bidRequest[0].userId.tdid = 'TTD_ID';
445
+ bidderRequest.bidRequest[0].userIdAsEids = createEidsArray(bidderRequest.bidRequest[0].userId);
446
+ let request = spec.buildRequests(bidderRequest.bidRequest, BIDDER_REQUEST_1);
447
+ let data = JSON.parse(request.data);
448
+ expect(data.user.eids).to.deep.equal([{
449
+ 'source': 'adserver.org',
450
+ 'uids': [{
451
+ 'id': 'TTD_ID',
452
+ 'atype': 1,
453
+ 'ext': {
454
+ 'rtiPartner': 'TDID'
455
+ }
456
+ }]
457
+ }]);
458
+ });
459
+
460
+ it('Request should have adsrvrOrgId from UserId Module if config and userId module both have TTD ID', function() {
461
+ sandbox.stub(config, 'getConfig').callsFake((key) => {
462
+ var config = {
463
+ adsrvrOrgId: {
464
+ 'TDID': 'TTD_ID_FROM_CONFIG',
465
+ 'TDID_LOOKUP': 'TRUE',
466
+ 'TDID_CREATED_AT': '2022-06-21T09:47:00'
467
+ }
468
+ };
469
+ return config[key];
470
+ });
471
+ bidderRequest.bidRequest[0].userId = {};
472
+ bidderRequest.bidRequest[0].userId.tdid = 'TTD_ID';
473
+ bidderRequest.bidRequest[0].userIdAsEids = createEidsArray(bidderRequest.bidRequest[0].userId);
474
+ let request = spec.buildRequests(bidderRequest.bidRequest, BIDDER_REQUEST_1);
475
+ let data = JSON.parse(request.data);
476
+ expect(data.user.eids).to.deep.equal([{
477
+ 'source': 'adserver.org',
478
+ 'uids': [{
479
+ 'id': 'TTD_ID',
480
+ 'atype': 1,
481
+ 'ext': {
482
+ 'rtiPartner': 'TDID'
483
+ }
484
+ }]
485
+ }]);
486
+ });
487
+
488
+ it('Request should NOT have adsrvrOrgId params if userId is NOT object', function() {
489
+ let request = spec.buildRequests(bidderRequest.bidRequest, BIDDER_REQUEST_1);
490
+ let data = JSON.parse(request.data);
491
+ expect(data.user.eids).to.deep.equal(undefined);
492
+ });
493
+
494
+ it('Request should NOT have adsrvrOrgId params if userId.tdid is NOT string', function() {
495
+ bidderRequest.bidRequest[0].userId = {
496
+ tdid: 1234
497
+ };
498
+ let request = spec.buildRequests(bidderRequest.bidRequest, BIDDER_REQUEST_1);
499
+ let data = JSON.parse(request.data);
500
+ expect(data.user.eids).to.deep.equal(undefined);
501
+ });
502
+ });
428
503
  });
@@ -6,6 +6,7 @@ import {init, getIds} from 'modules/userId/index.js';
6
6
  import * as utils from 'src/utils.js';
7
7
  import {hook} from '../../../src/hook.js';
8
8
  import {getGlobal} from '../../../src/prebidGlobal.js';
9
+ import { makeSlot } from '../integration/faker/googletag.js';
9
10
 
10
11
  describe('E-Planning Adapter', function () {
11
12
  const adapter = newBidder('spec');
@@ -649,7 +650,24 @@ describe('E-Planning Adapter', function () {
649
650
  let element;
650
651
  let getBoundingClientRectStub;
651
652
  let sandbox = sinon.sandbox.create();
652
- let focusStub;
653
+ let intersectionObserverStub;
654
+ let intersectionCallback;
655
+
656
+ function setIntersectionObserverMock(params) {
657
+ let fakeIntersectionObserver = (stateChange, options) => {
658
+ intersectionCallback = stateChange;
659
+ return {
660
+ unobserve: (element) => {
661
+ return element;
662
+ },
663
+ observe: (element) => {
664
+ intersectionCallback([{'target': {'id': element.id}, 'isIntersecting': params[element.id].isIntersecting, 'intersectionRatio': params[element.id].ratio, 'boundingClientRect': {'width': params[element.id].width, 'height': params[element.id].height}}]);
665
+ },
666
+ };
667
+ };
668
+
669
+ intersectionObserverStub = sandbox.stub(window, 'IntersectionObserver').callsFake(fakeIntersectionObserver);
670
+ }
653
671
  function createElement(id) {
654
672
  element = document.createElement('div');
655
673
  element.id = id || ADUNIT_CODE_VIEW;
@@ -741,9 +759,6 @@ describe('E-Planning Adapter', function () {
741
759
  hasLocalStorageStub.returns(true);
742
760
 
743
761
  clock = sandbox.useFakeTimers();
744
-
745
- focusStub = sandbox.stub(window.top.document, 'hasFocus');
746
- focusStub.returns(true);
747
762
  });
748
763
  afterEach(function () {
749
764
  $$PREBID_GLOBAL$$.bidderSettings = {};
@@ -786,6 +801,7 @@ describe('E-Planning Adapter', function () {
786
801
  let respuesta;
787
802
  beforeEach(function () {
788
803
  createElementVisible();
804
+ setIntersectionObserverMock({[ADUNIT_CODE_VIEW]: {'ratio': 1, 'isIntersecting': true, 'width': 200, 'height': 200}});
789
805
  });
790
806
  it('when you have a render', function() {
791
807
  respuesta = spec.buildRequests(bidRequests, bidderRequest);
@@ -823,6 +839,7 @@ describe('E-Planning Adapter', function () {
823
839
  let respuesta;
824
840
  beforeEach(function () {
825
841
  createElementOutOfView();
842
+ setIntersectionObserverMock({[ADUNIT_CODE_VIEW]: {'ratio': 0, 'isIntersecting': false, 'width': 200, 'height': 200}});
826
843
  });
827
844
 
828
845
  it('when you have a render', function() {
@@ -848,6 +865,7 @@ describe('E-Planning Adapter', function () {
848
865
  let respuesta;
849
866
  it('should register visibility with more than 50%', function() {
850
867
  createPartiallyVisibleElement();
868
+ setIntersectionObserverMock({[ADUNIT_CODE_VIEW]: {'ratio': 0.6, 'isIntersecting': true, 'width': 200, 'height': 200}});
851
869
  respuesta = spec.buildRequests(bidRequests, bidderRequest);
852
870
  clock.tick(1005);
853
871
 
@@ -856,6 +874,7 @@ describe('E-Planning Adapter', function () {
856
874
  });
857
875
  it('you should not register visibility with less than 50%', function() {
858
876
  createPartiallyInvisibleElement();
877
+ setIntersectionObserverMock({[ADUNIT_CODE_VIEW]: {'ratio': 0.4, 'isIntersecting': true, 'width': 200, 'height': 200}});
859
878
  respuesta = spec.buildRequests(bidRequests, bidderRequest);
860
879
  clock.tick(1005);
861
880
 
@@ -863,12 +882,29 @@ describe('E-Planning Adapter', function () {
863
882
  expect(storage.getDataFromLocalStorage(storageIdView)).to.equal(null);
864
883
  });
865
884
  });
885
+ context('when element id is not equal to adunitcode', function() {
886
+ let respuesta;
887
+ it('should register visibility with more than 50%', function() {
888
+ const code = ADUNIT_CODE_VIEW;
889
+ const divId = 'div-gpt-ad-123';
890
+ createPartiallyVisibleElement(divId);
891
+ window.googletag.pubads().setSlots([makeSlot({ code, divId })]);
892
+ setIntersectionObserverMock({[divId]: {'ratio': 0.6, 'isIntersecting': true, 'width': 200, 'height': 200}});
893
+
894
+ respuesta = spec.buildRequests(bidRequests, bidderRequest);
895
+ clock.tick(1005);
896
+
897
+ expect(storage.getDataFromLocalStorage(storageIdRender)).to.equal('1');
898
+ expect(storage.getDataFromLocalStorage(storageIdView)).to.equal('1');
899
+ });
900
+ });
866
901
  context('when width or height of the element is zero', function() {
867
902
  beforeEach(function () {
868
903
  createElementVisible();
869
904
  });
870
905
  it('if the width is zero but the height is within the range', function() {
871
906
  element.style.width = '0px';
907
+ setIntersectionObserverMock({[ADUNIT_CODE_VIEW]: {'ratio': 0.4, 'isIntersecting': true, 'width': 200, 'height': 200}});
872
908
  spec.buildRequests(bidRequests, bidderRequest)
873
909
  clock.tick(1005);
874
910
 
@@ -877,6 +913,7 @@ describe('E-Planning Adapter', function () {
877
913
  });
878
914
  it('if the height is zero but the width is within the range', function() {
879
915
  element.style.height = '0px';
916
+ setIntersectionObserverMock({[ADUNIT_CODE_VIEW]: {'ratio': 1, 'isIntersecting': true, 'width': 500, 'height': 0}});
880
917
  spec.buildRequests(bidRequests, bidderRequest)
881
918
  clock.tick(1005);
882
919
 
@@ -886,6 +923,7 @@ describe('E-Planning Adapter', function () {
886
923
  it('if both are zero', function() {
887
924
  element.style.height = '0px';
888
925
  element.style.width = '0px';
926
+ setIntersectionObserverMock({[ADUNIT_CODE_VIEW]: {'ratio': 1, 'isIntersecting': true, 'width': 0, 'height': 0}});
889
927
  spec.buildRequests(bidRequests, bidderRequest)
890
928
  clock.tick(1005);
891
929
 
@@ -893,16 +931,6 @@ describe('E-Planning Adapter', function () {
893
931
  expect(storage.getDataFromLocalStorage(storageIdView)).to.equal(null);
894
932
  });
895
933
  });
896
- context('when tab is inactive', function() {
897
- it('I should not register if it is not in focus', function() {
898
- createElementVisible();
899
- focusStub.returns(false);
900
- spec.buildRequests(bidRequests, bidderRequest);
901
- clock.tick(1005);
902
- expect(storage.getDataFromLocalStorage(storageIdRender)).to.equal('1');
903
- expect(storage.getDataFromLocalStorage(storageIdView)).to.equal(null);
904
- });
905
- });
906
934
  context('segmentBeginsBeforeTheVisibleRange', function() {
907
935
  it('segmentBeginsBeforeTheVisibleRange', function() {
908
936
  createElementOutOfRange();
@@ -933,7 +961,11 @@ describe('E-Planning Adapter', function () {
933
961
  createElementVisible(ADUNIT_CODE_VIEW);
934
962
  createElementVisible(ADUNIT_CODE_VIEW2);
935
963
  createElementVisible(ADUNIT_CODE_VIEW3);
936
-
964
+ setIntersectionObserverMock({
965
+ [ADUNIT_CODE_VIEW]: {'ratio': 1, 'isIntersecting': true, 'width': 200, 'height': 200},
966
+ [ADUNIT_CODE_VIEW2]: {'ratio': 1, 'isIntersecting': true, 'width': 200, 'height': 200},
967
+ [ADUNIT_CODE_VIEW3]: {'ratio': 1, 'isIntersecting': true, 'width': 200, 'height': 200}
968
+ });
937
969
  respuesta = spec.buildRequests(bidRequestMultiple, bidderRequest);
938
970
  clock.tick(1005);
939
971
  [ADUNIT_CODE_VIEW, ADUNIT_CODE_VIEW2, ADUNIT_CODE_VIEW3].forEach(ac => {
@@ -946,7 +978,11 @@ describe('E-Planning Adapter', function () {
946
978
  createElementOutOfView(ADUNIT_CODE_VIEW);
947
979
  createElementOutOfView(ADUNIT_CODE_VIEW2);
948
980
  createElementOutOfView(ADUNIT_CODE_VIEW3);
949
-
981
+ setIntersectionObserverMock({
982
+ [ADUNIT_CODE_VIEW]: {'ratio': 0, 'isIntersecting': false, 'width': 200, 'height': 200},
983
+ [ADUNIT_CODE_VIEW2]: {'ratio': 0, 'isIntersecting': false, 'width': 200, 'height': 200},
984
+ [ADUNIT_CODE_VIEW3]: {'ratio': 0, 'isIntersecting': false, 'width': 200, 'height': 200}
985
+ });
950
986
  respuesta = spec.buildRequests(bidRequestMultiple, bidderRequest);
951
987
  clock.tick(1005);
952
988
  [ADUNIT_CODE_VIEW, ADUNIT_CODE_VIEW2, ADUNIT_CODE_VIEW3].forEach(ac => {
@@ -960,7 +996,11 @@ describe('E-Planning Adapter', function () {
960
996
  createElementVisible(ADUNIT_CODE_VIEW);
961
997
  createElementOutOfView(ADUNIT_CODE_VIEW2);
962
998
  createElementOutOfView(ADUNIT_CODE_VIEW3);
963
-
999
+ setIntersectionObserverMock({
1000
+ [ADUNIT_CODE_VIEW]: {'ratio': 1, 'isIntersecting': true, 'width': 200, 'height': 200},
1001
+ [ADUNIT_CODE_VIEW2]: {'ratio': 0.3, 'isIntersecting': true, 'width': 200, 'height': 200},
1002
+ [ADUNIT_CODE_VIEW3]: {'ratio': 0, 'isIntersecting': false, 'width': 200, 'height': 200}
1003
+ });
964
1004
  respuesta = spec.buildRequests(bidRequestMultiple, bidderRequest);
965
1005
  clock.tick(1005);
966
1006
  expect(storage.getDataFromLocalStorage('pbsr_' + ADUNIT_CODE_VIEW)).to.equal('6');
@@ -989,7 +1029,7 @@ describe('E-Planning Adapter', function () {
989
1029
  sandbox.restore();
990
1030
  })
991
1031
 
992
- it('should add eids to the request', function() {
1032
+ it('should add eids to the request ', function() {
993
1033
  let bidRequests = [validBidView];
994
1034
  const expected_id5id = encodeURIComponent(JSON.stringify({ uid: 'ID5-ZHMOL_IfFSt7_lVYX8rBZc6GH3XMWyPQOBUfr4bm0g!', ext: { linkType: 1 } }));
995
1035
  const request = spec.buildRequests(bidRequests, bidderRequest);
@@ -226,6 +226,38 @@ describe('TheMediaGridNM Adapter', function () {
226
226
  }
227
227
  ];
228
228
 
229
+ it('if content and segment is present in jwTargeting, payload must have right params', function () {
230
+ const jsContent = {id: 'test_jw_content_id'};
231
+ const jsSegments = ['test_seg_1', 'test_seg_2'];
232
+ const bidRequestsWithJwTargeting = bidRequests.map((bid) => {
233
+ return Object.assign({
234
+ rtd: {
235
+ jwplayer: {
236
+ targeting: {
237
+ segments: jsSegments,
238
+ content: jsContent
239
+ }
240
+ }
241
+ }
242
+ }, bid);
243
+ });
244
+ const requests = spec.buildRequests(bidRequestsWithJwTargeting, bidderRequest);
245
+ requests.forEach((req, i) => {
246
+ const payload = req.data;
247
+ expect(req).to.have.property('data');
248
+ expect(payload).to.have.property('user');
249
+ expect(payload.user.data).to.deep.equal([{
250
+ name: 'iow_labs_pub_data',
251
+ segment: [
252
+ {name: 'jwpseg', value: jsSegments[0]},
253
+ {name: 'jwpseg', value: jsSegments[1]}
254
+ ]
255
+ }]);
256
+ expect(payload).to.have.property('site');
257
+ expect(payload.site.content).to.deep.equal(jsContent);
258
+ });
259
+ });
260
+
229
261
  it('should attach valid params to the tag', function () {
230
262
  const requests = spec.buildRequests(bidRequests, bidderRequest);
231
263
  const requestsSizes = ['300x250,300x600', '728x90'];
@@ -50,7 +50,6 @@ describe('imRtdProvider', function () {
50
50
 
51
51
  describe('getBidderFunction', function () {
52
52
  const assumedBidder = [
53
- 'ix',
54
53
  'pubmatic',
55
54
  'fluct'
56
55
  ];
@@ -121,6 +121,11 @@ describe('IndexexchangeAdapter', function () {
121
121
  playerSize: [[400, 100]]
122
122
  }
123
123
  },
124
+ ortb2Imp: {
125
+ ext: {
126
+ tid: '173f49a8-7549-4218-a23c-e7ba59b47230'
127
+ }
128
+ },
124
129
  adUnitCode: 'div-gpt-ad-1460505748562-0',
125
130
  transactionId: '173f49a8-7549-4218-a23c-e7ba59b47230',
126
131
  bidId: '1a2b3c4e',
@@ -143,6 +148,11 @@ describe('IndexexchangeAdapter', function () {
143
148
  sizes: [[300, 250]]
144
149
  }
145
150
  },
151
+ ortb2Imp: {
152
+ ext: {
153
+ tid: '173f49a8-7549-4218-a23c-e7ba59b47229'
154
+ }
155
+ },
146
156
  adUnitCode: 'div-gpt-ad-1460505748561-0',
147
157
  transactionId: '173f49a8-7549-4218-a23c-e7ba59b47229',
148
158
  bidId: '1a2b3c4d',
@@ -165,6 +175,11 @@ describe('IndexexchangeAdapter', function () {
165
175
  sizes: [[300, 250], [300, 600]]
166
176
  }
167
177
  },
178
+ ortb2Imp: {
179
+ ext: {
180
+ tid: '173f49a8-7549-4218-a23c-e7ba59b47229'
181
+ }
182
+ },
168
183
  adUnitCode: 'div-gpt-ad-1460505748561-0',
169
184
  transactionId: '173f49a8-7549-4218-a23c-e7ba59b47229',
170
185
  bidId: '1a2b3c4d',
@@ -185,6 +200,11 @@ describe('IndexexchangeAdapter', function () {
185
200
  sizes: [[300, 250], [300, 600]]
186
201
  }
187
202
  },
203
+ ortb2Imp: {
204
+ ext: {
205
+ tid: '173f49a8-7549-4218-a23c-e7ba59b47229'
206
+ }
207
+ },
188
208
  adUnitCode: 'div-gpt-ad-1460505748561-0',
189
209
  transactionId: '173f49a8-7549-4218-a23c-e7ba59b47229',
190
210
  bidId: '1a2b3c4d',
@@ -214,6 +234,11 @@ describe('IndexexchangeAdapter', function () {
214
234
  protocols: [2]
215
235
  }
216
236
  },
237
+ ortb2Imp: {
238
+ ext: {
239
+ tid: '173f49a8-7549-4218-a23c-e7ba59b47230'
240
+ }
241
+ },
217
242
  adUnitCode: 'div-gpt-ad-1460505748562-0',
218
243
  transactionId: '173f49a8-7549-4218-a23c-e7ba59b47230',
219
244
  bidId: '1a2b3c4e',
@@ -247,6 +272,11 @@ describe('IndexexchangeAdapter', function () {
247
272
  playerSize: [[400, 100], [200, 400]]
248
273
  }
249
274
  },
275
+ ortb2Imp: {
276
+ ext: {
277
+ tid: '173f49a8-7549-4218-a23c-e7ba59b47230'
278
+ }
279
+ },
250
280
  adUnitCode: 'div-gpt-ad-1460505748562-0',
251
281
  transactionId: '173f49a8-7549-4218-a23c-e7ba59b47230',
252
282
  bidId: '1a2b3c4e',
@@ -272,6 +302,11 @@ describe('IndexexchangeAdapter', function () {
272
302
  sizes: [[300, 250], [300, 600], [400, 500]]
273
303
  }
274
304
  },
305
+ ortb2Imp: {
306
+ ext: {
307
+ tid: '173f49a8-7549-4218-a23c-e7ba59b47230'
308
+ }
309
+ },
275
310
  adUnitCode: 'div-gpt-ad-1460505748562-0',
276
311
  transactionId: '173f49a8-7549-4218-a23c-e7ba59b47230',
277
312
  bidId: '1a2b3c4e',
@@ -307,6 +342,11 @@ describe('IndexexchangeAdapter', function () {
307
342
  sizes: [[300, 250], [300, 600]]
308
343
  }
309
344
  },
345
+ ortb2Imp: {
346
+ ext: {
347
+ tid: '173f49a8-7549-4218-a23c-e7ba59b47230'
348
+ }
349
+ },
310
350
  adUnitCode: 'div-gpt-ad-1460505748562-0',
311
351
  transactionId: '273f49a8-7549-4218-a23c-e7ba59b47230',
312
352
  bidId: '1a2b3c4e',
@@ -1720,6 +1760,7 @@ describe('IndexexchangeAdapter', function () {
1720
1760
  expect(impression.id).to.equal(DEFAULT_BANNER_VALID_BID[0].bidId);
1721
1761
  expect(impression.banner.format).to.be.length(2);
1722
1762
  expect(impression.banner.topframe).to.be.oneOf([0, 1]);
1763
+ expect(impression.ext.tid).to.equal(DEFAULT_BANNER_VALID_BID[0].transactionId);
1723
1764
 
1724
1765
  impression.banner.format.map(({ w, h, ext }, index) => {
1725
1766
  const size = DEFAULT_BANNER_VALID_BID[0].mediaTypes.banner.sizes[index];