prebid.js 5.19.0 → 5.20.3

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 (67) hide show
  1. package/.circleci/config.yml +4 -5
  2. package/modules/adxcgBidAdapter.js +311 -359
  3. package/modules/airgridRtdProvider.js +1 -1
  4. package/modules/appnexusBidAdapter.js +9 -3
  5. package/modules/atsAnalyticsAdapter.js +67 -46
  6. package/modules/atsAnalyticsAdapter.md +1 -0
  7. package/modules/betweenBidAdapter.js +2 -1
  8. package/modules/browsiRtdProvider.js +106 -18
  9. package/modules/cleanioRtdProvider.js +192 -0
  10. package/modules/cleanioRtdProvider.md +59 -0
  11. package/modules/deltaprojectsBidAdapter.js +252 -0
  12. package/modules/deltaprojectsBidAdapter.md +32 -0
  13. package/modules/gridBidAdapter.js +1 -0
  14. package/modules/ipromBidAdapter.js +79 -0
  15. package/modules/ixBidAdapter.js +7 -1
  16. package/modules/jixieBidAdapter.js +8 -2
  17. package/modules/justpremiumBidAdapter.js +6 -1
  18. package/modules/kinessoIdSystem.js +1 -1
  19. package/modules/livewrappedAnalyticsAdapter.js +5 -0
  20. package/modules/multibid/index.js +3 -3
  21. package/modules/nativoBidAdapter.js +5 -1
  22. package/modules/openxBidAdapter.js +1 -1
  23. package/modules/operaadsBidAdapter.js +21 -1
  24. package/modules/otmBidAdapter.js +146 -0
  25. package/modules/otmBidAdapter.md +27 -26
  26. package/modules/outbrainBidAdapter.js +5 -0
  27. package/modules/playwireBidAdapter.md +61 -0
  28. package/modules/pubmaticBidAdapter.js +1 -1
  29. package/modules/rtdModule/index.js +2 -2
  30. package/modules/sonobiBidAdapter.js +7 -0
  31. package/modules/sortableBidAdapter.js +1 -0
  32. package/modules/teadsBidAdapter.js +3 -0
  33. package/modules/trustxBidAdapter.js +8 -6
  34. package/modules/ventesBidAdapter.js +370 -0
  35. package/modules/ventesBidAdapter.md +94 -0
  36. package/modules/yahoosspBidAdapter.js +6 -6
  37. package/package.json +1 -1
  38. package/src/auction.js +11 -11
  39. package/src/prebid.js +20 -4
  40. package/src/targeting.js +8 -0
  41. package/test/fixtures/fixtures.js +2 -1
  42. package/test/spec/modules/adxcgBidAdapter_spec.js +827 -571
  43. package/test/spec/modules/appnexusBidAdapter_spec.js +16 -1
  44. package/test/spec/modules/atsAnalyticsAdapter_spec.js +42 -9
  45. package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
  46. package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
  47. package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
  48. package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
  49. package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
  50. package/test/spec/modules/ixBidAdapter_spec.js +3 -3
  51. package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
  52. package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
  53. package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +23 -4
  54. package/test/spec/modules/multibid_spec.js +31 -31
  55. package/test/spec/modules/openxBidAdapter_spec.js +0 -26
  56. package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
  57. package/test/spec/modules/otmBidAdapter_spec.js +67 -0
  58. package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
  59. package/test/spec/modules/pubmaticBidAdapter_spec.js +40 -0
  60. package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
  61. package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
  62. package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
  63. package/test/spec/modules/trustxBidAdapter_spec.js +3 -3
  64. package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
  65. package/test/spec/unit/core/adapterManager_spec.js +7 -3
  66. package/test/spec/unit/core/targeting_spec.js +93 -0
  67. package/test/spec/unit/pbjs_api_spec.js +3 -1
@@ -9,6 +9,7 @@ describe('jixie Adapter', function () {
9
9
  const device_ = 'desktop';
10
10
  const timeout_ = 1000;
11
11
  const currency_ = 'USD';
12
+ const keywords_ = '';
12
13
 
13
14
  /**
14
15
  * Basic
@@ -212,7 +213,7 @@ describe('jixie Adapter', function () {
212
213
  );
213
214
  let miscDimsStub = sinon.stub(jixieaux, 'getMiscDims');
214
215
  miscDimsStub
215
- .returns({ device: device_, pageurl: pageurl_, domain: domain_ });
216
+ .returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ });
216
217
 
217
218
  // actual api call:
218
219
  const request = spec.buildRequests(bidRequests_, bidderRequest_);
@@ -229,6 +230,7 @@ describe('jixie Adapter', function () {
229
230
  expect(payload).to.have.property('device', device_);
230
231
  expect(payload).to.have.property('domain', domain_);
231
232
  expect(payload).to.have.property('pageurl', pageurl_);
233
+ expect(payload).to.have.property('mkeywords', keywords_);
232
234
  expect(payload).to.have.property('timeout', timeout_);
233
235
  expect(payload).to.have.property('currency', currency_);
234
236
  expect(payload).to.have.property('bids').that.deep.equals(refBids_);
@@ -243,15 +245,15 @@ describe('jixie Adapter', function () {
243
245
  /**
244
246
  * interpretResponse:
245
247
  */
246
- const JX_OTHER_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.io/dummyscript.js';
247
- const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.io/jxhboutstream.js';
248
+ const JX_OTHER_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.media/dummyscript.js';
249
+ const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.media/jxhbrenderer.1.1.min.js';
248
250
 
249
- const mockVastXml_ = `<?xml version="1.0" encoding="UTF-8"?><VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd" version="3.0"><Ad id="JXAD521"><InLine><AdSystem>JXADSERVER</AdSystem><AdTitle>Alway%20Live%20Prebid%20Creative</AdTitle><Description>Hybrid in-stream</Description><Error><![CDATA[https://demo.com?action=error&errorcode=[ERRORCODE]&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Error><Impression><![CDATA[https://demo.com?action=impression&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Impression><Creatives><Creative id="JXAD521" sequence="1"><Linear><Duration>00:00:10</Duration><TrackingEvents><Tracking event="start"><![CDATA[https://demo.com?action=start&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="firstQuartile"><![CDATA[https://demo.com?action=firstQuartile&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="midpoint"><![CDATA[https://demo.com?action=midpoint&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="thirdQuartile"><![CDATA[https://demo.com?action=thirdQuartile&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="complete"><![CDATA[https://demo.com?action=complete&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="mute"><![CDATA[https://demo.com?action=mute&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="unmute"><![CDATA[https://demo.com?action=unmute&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="rewind"><![CDATA[https://demo.com?action=rewind&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="pause"><![CDATA[https://demo.com?action=pause&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="resume"><![CDATA[https://demo.com?action=resume&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="fullscreen"><![CDATA[https://demo.com?action=fullscreen&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="creativeView"><![CDATA[https://demo.com?action=creativeView&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking></TrackingEvents><VideoClicks><ClickThrough><![CDATA[https://toko-iot.com/search/?q=Sonos&utm_source=ivs&utm_medium=video&utm_campaign=promo&utm_content=sonos_category]]></ClickThrough><ClickTracking id="521"><![CDATA[https://demo.com?action=click&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></ClickTracking></VideoClicks><MediaFiles><MediaFile apiFramework="VPAID" type="application/javascript"><![CDATA[https://creatives.b-cdn.net/js/jxvpaid_1_0.min.js]]></MediaFile></MediaFiles><AdParameters><![CDATA[{"embed":true,"videos":[{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_240.mp4","bitrate":186,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_360.mp4","bitrate":229,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_480.mp4","bitrate":279,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_720.mp4","bitrate":325,"mimetype":"video/mp4"}],"countpos":"left","hotspots":[{"type":"direct_url","start":0,"duration":10,"position":"top-right","direct_url":"https://toko-iot.com/catalogue/category/audio_8/?utm_source=ivs&utm_medium=banner&utm_campaign=promo&utm_content=audio_category","thumbnail_url":"https://creatives.ivideosmart.com/hotspots/TokoIOT_1.gif","thumbnail_style":"full-height"}],"clickthru":"https://toko-iot.com/search/?q=Sonos&utm_source=ivs&utm_medium=video&utm_campaign=promo&utm_content=sonos_category","reporting":{},"skipoffset":5}]]></AdParameters><Icons><Icon program="AdChoices" width="20" height="20" xPosition="right" yPosition="top" offset="00:00:02"><StaticResource creativeType="image/png"><![CDATA[https://creatives.jixie.io/jxadchoice.png]]></StaticResource><IconClicks><IconClickThrough><![CDATA[https://www.jixie.io/privacy-policy]]></IconClickThrough></IconClicks></Icon></Icons></Linear></Creative><Creative sequence="1"/></Creatives></InLine></Ad></VAST>`;
251
+ const mockVastXml_ = `<?xml version="1.0" encoding="UTF-8"?><VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd" version="3.0"><Ad id="JXAD521"><InLine><AdSystem>JXADSERVER</AdSystem><AdTitle>Alway%20Live%20Prebid%20Creative</AdTitle><Description>Hybrid in-stream</Description><Error><![CDATA[https://demo.com?action=error&errorcode=[ERRORCODE]&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Error><Impression><![CDATA[https://demo.com?action=impression&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Impression><Creatives><Creative id="JXAD521" sequence="1"><Linear><Duration>00:00:10</Duration><TrackingEvents><Tracking event="start"><![CDATA[https://demo.com?action=start&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="firstQuartile"><![CDATA[https://demo.com?action=firstQuartile&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="midpoint"><![CDATA[https://demo.com?action=midpoint&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="thirdQuartile"><![CDATA[https://demo.com?action=thirdQuartile&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="complete"><![CDATA[https://demo.com?action=complete&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="mute"><![CDATA[https://demo.com?action=mute&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="unmute"><![CDATA[https://demo.com?action=unmute&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="rewind"><![CDATA[https://demo.com?action=rewind&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="pause"><![CDATA[https://demo.com?action=pause&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="resume"><![CDATA[https://demo.com?action=resume&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="fullscreen"><![CDATA[https://demo.com?action=fullscreen&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="creativeView"><![CDATA[https://demo.com?action=creativeView&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking></TrackingEvents><VideoClicks><ClickThrough><![CDATA[https://toko-iot.com/search/?q=Sonos&utm_source=ivs&utm_medium=video&utm_campaign=promo&utm_content=sonos_category]]></ClickThrough><ClickTracking id="521"><![CDATA[https://demo.com?action=click&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></ClickTracking></VideoClicks><MediaFiles><MediaFile apiFramework="VPAID" type="application/javascript"><![CDATA[https://creatives.b-cdn.net/js/jxvpaid_1_0.min.js]]></MediaFile></MediaFiles><AdParameters><![CDATA[{"embed":true,"videos":[{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_240.mp4","bitrate":186,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_360.mp4","bitrate":229,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_480.mp4","bitrate":279,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_720.mp4","bitrate":325,"mimetype":"video/mp4"}],"countpos":"left","hotspots":[{"type":"direct_url","start":0,"duration":10,"position":"top-right","direct_url":"https://toko-iot.com/catalogue/category/audio_8/?utm_source=ivs&utm_medium=banner&utm_campaign=promo&utm_content=audio_category","thumbnail_url":"https://creatives.ivideosmart.com/hotspots/TokoIOT_1.gif","thumbnail_style":"full-height"}],"clickthru":"https://toko-iot.com/search/?q=Sonos&utm_source=ivs&utm_medium=video&utm_campaign=promo&utm_content=sonos_category","reporting":{},"skipoffset":5}]]></AdParameters><Icons><Icon program="AdChoices" width="20" height="20" xPosition="right" yPosition="top" offset="00:00:02"><StaticResource creativeType="image/png"><![CDATA[https://creatives.jixie.media/jxadchoice.png]]></StaticResource><IconClicks><IconClickThrough><![CDATA[https://www.jixie.io/privacy-policy]]></IconClickThrough></IconClicks></Icon></Icons></Linear></Creative><Creative sequence="1"/></Creatives></InLine></Ad></VAST>`;
250
252
  const responseBody_ = {
251
253
  'bids': [
252
254
  // video (vast tag url) returned here
253
255
  {
254
- 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?',
256
+ 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?',
255
257
  'jxBidId': '62847e4c696edcb-028d5dee-2c83-44e3-bed1-b75002475cdf',
256
258
  'requestId': '62847e4c696edcb',
257
259
  'cpm': 2.19,
@@ -284,7 +286,7 @@ describe('jixie Adapter', function () {
284
286
  // display ad returned here: This one there is advertiserDomains
285
287
  // in the response . Will be checked in the unit tests below
286
288
  {
287
- 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?',
289
+ 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?',
288
290
  'jxBidId': '600c9ae6fda1acb-028d5dee-2c83-44e3-bed1-b75002475cdf',
289
291
  'requestId': '600c9ae6fda1acb',
290
292
  'cpm': 1.999,
@@ -317,11 +319,11 @@ describe('jixie Adapter', function () {
317
319
  ],
318
320
  'mediaType': 'BANNER'
319
321
  },
320
- 'ad': '<div id="jxoutstream" style="width: 100%;"> <script type="text/javascript" src="https://scripts.jixie.io/jxfriendly.1.3.min.js" defer=""></script> <script> var p ={ responsive: 1, nested: 1, maxwidth: 640, container: "jxoutstream", creativeid: 520}; function jxdefer(p) { if (window.jxuniversal) { window.jxuniversal.init(p); } else { setTimeout(function() { jxdefer(p) }, 100); } } jxdefer(p); </script> </div>'
322
+ 'ad': '<div id="jxoutstream" style="width: 100%;"> <script type="text/javascript" src="https://scripts.jixie.media/jxfriendly.1.3.min.js" defer=""></script> <script> var p ={ responsive: 1, nested: 1, maxwidth: 640, container: "jxoutstream", creativeid: 520}; function jxdefer(p) { if (window.jxuniversal) { window.jxuniversal.init(p); } else { setTimeout(function() { jxdefer(p) }, 100); } } jxdefer(p); </script> </div>'
321
323
  },
322
324
  // outstream, jx non-default renderer specified:
323
325
  {
324
- 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?',
326
+ 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?',
325
327
  'jxBidId': '99bc539c81b00ce-028d5dee-2c83-44e3-bed1-b75002475cdf',
326
328
  'requestId': '99bc539c81b00ce',
327
329
  'cpm': 2.99,
@@ -340,7 +342,7 @@ describe('jixie Adapter', function () {
340
342
  },
341
343
  // outstream, jx default renderer:
342
344
  {
343
- 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?',
345
+ 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?',
344
346
  'jxBidId': '61bc539c81b00ce-028d5dee-2c83-44e3-bed1-b75002475cdf',
345
347
  'requestId': '61bc539c81b00ce',
346
348
  'cpm': 1.99,
@@ -475,7 +477,7 @@ describe('jixie Adapter', function () {
475
477
  ajaxStub = sinon.stub(jixieaux, 'ajax');
476
478
 
477
479
  miscDimsStub
478
- .returns({ device: device_, pageurl: pageurl_, domain: domain_ });
480
+ .returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ });
479
481
  })
480
482
 
481
483
  afterEach(function() {
@@ -537,7 +539,7 @@ describe('jixie Adapter', function () {
537
539
  ajaxStub = sinon.stub(jixieaux, 'ajax');
538
540
  miscDimsStub = sinon.stub(jixieaux, 'getMiscDims');
539
541
  miscDimsStub
540
- .returns({ device: device_, pageurl: pageurl_, domain: domain_ });
542
+ .returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ });
541
543
  })
542
544
 
543
545
  afterEach(function() {
@@ -97,7 +97,7 @@ describe('justpremium adapter', function () {
97
97
  expect(jpxRequest.id).to.equal(adUnits[0].params.zone)
98
98
  expect(jpxRequest.mediaTypes && jpxRequest.mediaTypes.banner && jpxRequest.mediaTypes.banner.sizes).to.not.equal('undefined')
99
99
  expect(jpxRequest.version.prebid).to.equal('$prebid.version$')
100
- expect(jpxRequest.version.jp_adapter).to.equal('1.8')
100
+ expect(jpxRequest.version.jp_adapter).to.equal('1.8.1')
101
101
  expect(jpxRequest.pubcid).to.equal('0000000')
102
102
  expect(jpxRequest.uids.tdid).to.equal('1111111')
103
103
  expect(jpxRequest.uids.id5id.uid).to.equal('2222222')
@@ -118,7 +118,10 @@ describe('justpremium adapter', function () {
118
118
  'price': 0.52,
119
119
  'format': 'lb',
120
120
  'adm': 'creative code',
121
- 'adomain': ['justpremium.com']
121
+ 'adomain': ['justpremium.com'],
122
+ 'ext': {
123
+ 'pg': true
124
+ }
122
125
  }]
123
126
  },
124
127
  'pass': {
@@ -142,6 +145,9 @@ describe('justpremium adapter', function () {
142
145
  meta: {
143
146
  advertiserDomains: ['justpremium.com']
144
147
  },
148
+ adserverTargeting: {
149
+ 'hb_deal_justpremium': 'jp_pg'
150
+ }
145
151
  }
146
152
  ]
147
153
 
@@ -159,6 +165,7 @@ describe('justpremium adapter', function () {
159
165
  expect(result[0].netRevenue).to.equal(true)
160
166
  expect(result[0].format).to.equal('lb')
161
167
  expect(result[0].meta.advertiserDomains[0]).to.equal('justpremium.com')
168
+ expect(result[0].adserverTargeting).to.deep.equal({'hb_deal_justpremium': 'jp_pg'})
162
169
  })
163
170
 
164
171
  it('Verify wrong server response', function () {
@@ -2,6 +2,7 @@ import livewrappedAnalyticsAdapter, { BID_WON_TIMEOUT } from 'modules/livewrappe
2
2
  import CONSTANTS from 'src/constants.json';
3
3
  import { config } from 'src/config.js';
4
4
  import { server } from 'test/mocks/xhr.js';
5
+ import { setConfig } from 'modules/currency.js';
5
6
 
6
7
  let events = require('src/events');
7
8
  let utils = require('src/utils');
@@ -28,6 +29,9 @@ const BID1 = {
28
29
  width: 980,
29
30
  height: 240,
30
31
  cpm: 1.1,
32
+ originalCpm: 12.0,
33
+ currency: 'USD',
34
+ originalCurrency: 'FOO',
31
35
  timeToRespond: 200,
32
36
  bidId: '2ecff0db240757',
33
37
  requestId: '2ecff0db240757',
@@ -43,6 +47,9 @@ const BID2 = Object.assign({}, BID1, {
43
47
  width: 300,
44
48
  height: 250,
45
49
  cpm: 2.2,
50
+ originalCpm: 23.0,
51
+ currency: 'USD',
52
+ originalCurrency: 'FOO',
46
53
  timeToRespond: 300,
47
54
  bidId: '3ecff0db240757',
48
55
  requestId: '3ecff0db240757',
@@ -178,6 +185,7 @@ const ANALYTICS_MESSAGE = {
178
185
  width: 980,
179
186
  height: 240,
180
187
  cpm: 1.1,
188
+ orgCpm: 120,
181
189
  ttr: 200,
182
190
  IsBid: true,
183
191
  mediaType: 1,
@@ -192,6 +200,7 @@ const ANALYTICS_MESSAGE = {
192
200
  width: 300,
193
201
  height: 250,
194
202
  cpm: 2.2,
203
+ orgCpm: 230,
195
204
  ttr: 300,
196
205
  IsBid: true,
197
206
  mediaType: 1,
@@ -219,6 +228,7 @@ const ANALYTICS_MESSAGE = {
219
228
  width: 980,
220
229
  height: 240,
221
230
  cpm: 1.1,
231
+ orgCpm: 120,
222
232
  mediaType: 1,
223
233
  gdpr: 0,
224
234
  auctionId: 0
@@ -231,6 +241,7 @@ const ANALYTICS_MESSAGE = {
231
241
  width: 300,
232
242
  height: 250,
233
243
  cpm: 2.2,
244
+ orgCpm: 230,
234
245
  mediaType: 1,
235
246
  gdpr: 0,
236
247
  auctionId: 0
@@ -279,6 +290,14 @@ describe('Livewrapped analytics adapter', function () {
279
290
  sandbox.stub(document, 'getElementById').returns(element);
280
291
 
281
292
  clock = sandbox.useFakeTimers(1519767013781);
293
+ setConfig({
294
+ adServerCurrency: 'USD',
295
+ rates: {
296
+ USD: {
297
+ FOO: 0.1
298
+ }
299
+ }
300
+ });
282
301
  });
283
302
 
284
303
  afterEach(function () {
@@ -453,7 +472,7 @@ describe('Livewrapped analytics adapter', function () {
453
472
  {
454
473
  'floorData': {
455
474
  'floorValue': 1.1,
456
- 'floorCurrency': 'SEK'
475
+ 'floorCurrency': 'FOO'
457
476
  }
458
477
  }));
459
478
  events.emit(BID_WON, Object.assign({},
@@ -461,7 +480,7 @@ describe('Livewrapped analytics adapter', function () {
461
480
  {
462
481
  'floorData': {
463
482
  'floorValue': 1.1,
464
- 'floorCurrency': 'SEK'
483
+ 'floorCurrency': 'FOO'
465
484
  }
466
485
  }));
467
486
  events.emit(AUCTION_END, MOCK.AUCTION_END);
@@ -476,11 +495,11 @@ describe('Livewrapped analytics adapter', function () {
476
495
 
477
496
  expect(message.responses.length).to.equal(1);
478
497
  expect(message.responses[0].floor).to.equal(1.1);
479
- expect(message.responses[0].floorCur).to.equal('SEK');
498
+ expect(message.responses[0].floorCur).to.equal('FOO');
480
499
 
481
500
  expect(message.wins.length).to.equal(1);
482
501
  expect(message.wins[0].floor).to.equal(1.1);
483
- expect(message.wins[0].floorCur).to.equal('SEK');
502
+ expect(message.wins[0].floorCur).to.equal('FOO');
484
503
  });
485
504
 
486
505
  it('should forward Livewrapped floor data', function () {
@@ -82,7 +82,7 @@ describe('multibid adapter', function () {
82
82
  'sizes': [[300, 250]]
83
83
  }
84
84
  },
85
- 'adUnitCode': 'test-div',
85
+ 'adUnitCode': 'test.div',
86
86
  'transactionId': 'c153f3da-84f0-4be8-95cb-0647c458bc60',
87
87
  'sizes': [[300, 250]],
88
88
  'bidId': '2408ef83b84c9d',
@@ -106,7 +106,7 @@ describe('multibid adapter', function () {
106
106
  'sizes': [[300, 250]]
107
107
  }
108
108
  },
109
- 'adUnitCode': 'test-div',
109
+ 'adUnitCode': 'test.div',
110
110
  'transactionId': 'c153f3da-84f0-4be8-95cb-0647c458bc60',
111
111
  'sizes': [[300, 250]],
112
112
  'bidId': '2408ef83b84c9d',
@@ -197,14 +197,14 @@ describe('multibid adapter', function () {
197
197
  });
198
198
 
199
199
  it('adds original bids and does not modify', function () {
200
- let adUnitCode = 'test-div';
200
+ let adUnitCode = 'test.div';
201
201
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
202
202
 
203
203
  addBidResponseHook(callbackFn, adUnitCode, {...bids[0]});
204
204
 
205
205
  expect(result).to.not.equal(null);
206
206
  expect(result.adUnitCode).to.not.equal(null);
207
- expect(result.adUnitCode).to.equal('test-div');
207
+ expect(result.adUnitCode).to.equal('test.div');
208
208
  expect(result.bid).to.not.equal(null);
209
209
  expect(result.bid).to.deep.equal(bids[0]);
210
210
 
@@ -214,13 +214,13 @@ describe('multibid adapter', function () {
214
214
 
215
215
  expect(result).to.not.equal(null);
216
216
  expect(result.adUnitCode).to.not.equal(null);
217
- expect(result.adUnitCode).to.equal('test-div');
217
+ expect(result.adUnitCode).to.equal('test.div');
218
218
  expect(result.bid).to.not.equal(null);
219
219
  expect(result.bid).to.deep.equal(bids[1]);
220
220
  });
221
221
 
222
222
  it('modifies and adds both bids based on multibid configuration', function () {
223
- let adUnitCode = 'test-div';
223
+ let adUnitCode = 'test.div';
224
224
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
225
225
 
226
226
  config.setConfig({multibid: [{bidder: 'bidderA', maxBids: 2, targetBiddercodePrefix: 'bidA'}]});
@@ -232,7 +232,7 @@ describe('multibid adapter', function () {
232
232
 
233
233
  expect(result).to.not.equal(null);
234
234
  expect(result.adUnitCode).to.not.equal(null);
235
- expect(result.adUnitCode).to.equal('test-div');
235
+ expect(result.adUnitCode).to.equal('test.div');
236
236
  expect(result.bid).to.not.equal(null);
237
237
  expect(result.bid).to.deep.equal(bids[0]);
238
238
 
@@ -250,13 +250,13 @@ describe('multibid adapter', function () {
250
250
 
251
251
  expect(result).to.not.equal(null);
252
252
  expect(result.adUnitCode).to.not.equal(null);
253
- expect(result.adUnitCode).to.equal('test-div');
253
+ expect(result.adUnitCode).to.equal('test.div');
254
254
  expect(result.bid).to.not.equal(null);
255
255
  expect(result.bid).to.deep.equal(bids[1]);
256
256
  });
257
257
 
258
258
  it('only modifies bids defined in the multibid configuration', function () {
259
- let adUnitCode = 'test-div';
259
+ let adUnitCode = 'test.div';
260
260
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
261
261
 
262
262
  bids.push({
@@ -276,7 +276,7 @@ describe('multibid adapter', function () {
276
276
 
277
277
  expect(result).to.not.equal(null);
278
278
  expect(result.adUnitCode).to.not.equal(null);
279
- expect(result.adUnitCode).to.equal('test-div');
279
+ expect(result.adUnitCode).to.equal('test.div');
280
280
  expect(result.bid).to.not.equal(null);
281
281
  expect(result.bid).to.deep.equal(bids[0]);
282
282
 
@@ -292,7 +292,7 @@ describe('multibid adapter', function () {
292
292
 
293
293
  expect(result).to.not.equal(null);
294
294
  expect(result.adUnitCode).to.not.equal(null);
295
- expect(result.adUnitCode).to.equal('test-div');
295
+ expect(result.adUnitCode).to.equal('test.div');
296
296
  expect(result.bid).to.not.equal(null);
297
297
  expect(result.bid).to.deep.equal(bids[1]);
298
298
 
@@ -302,13 +302,13 @@ describe('multibid adapter', function () {
302
302
 
303
303
  expect(result).to.not.equal(null);
304
304
  expect(result.adUnitCode).to.not.equal(null);
305
- expect(result.adUnitCode).to.equal('test-div');
305
+ expect(result.adUnitCode).to.equal('test.div');
306
306
  expect(result.bid).to.not.equal(null);
307
307
  expect(result.bid).to.deep.equal(bids[2]);
308
308
  });
309
309
 
310
310
  it('only modifies and returns bids under limit for a specifc bidder in the multibid configuration', function () {
311
- let adUnitCode = 'test-div';
311
+ let adUnitCode = 'test.div';
312
312
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
313
313
 
314
314
  bids.push({
@@ -328,7 +328,7 @@ describe('multibid adapter', function () {
328
328
 
329
329
  expect(result).to.not.equal(null);
330
330
  expect(result.adUnitCode).to.not.equal(null);
331
- expect(result.adUnitCode).to.equal('test-div');
331
+ expect(result.adUnitCode).to.equal('test.div');
332
332
  expect(result.bid).to.not.equal(null);
333
333
  expect(result.bid).to.deep.equal(bids[0]);
334
334
 
@@ -344,7 +344,7 @@ describe('multibid adapter', function () {
344
344
 
345
345
  expect(result).to.not.equal(null);
346
346
  expect(result.adUnitCode).to.not.equal(null);
347
- expect(result.adUnitCode).to.equal('test-div');
347
+ expect(result.adUnitCode).to.equal('test.div');
348
348
  expect(result.bid).to.not.equal(null);
349
349
  expect(result.bid).to.deep.equal(bids[1]);
350
350
 
@@ -356,7 +356,7 @@ describe('multibid adapter', function () {
356
356
  });
357
357
 
358
358
  it('if no prefix in multibid configuration, modifies and returns bids under limit without preifx property', function () {
359
- let adUnitCode = 'test-div';
359
+ let adUnitCode = 'test.div';
360
360
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
361
361
 
362
362
  bids.push({
@@ -375,7 +375,7 @@ describe('multibid adapter', function () {
375
375
 
376
376
  expect(result).to.not.equal(null);
377
377
  expect(result.adUnitCode).to.not.equal(null);
378
- expect(result.adUnitCode).to.equal('test-div');
378
+ expect(result.adUnitCode).to.equal('test.div');
379
379
  expect(result.bid).to.not.equal(null);
380
380
  expect(result.bid).to.deep.equal(bids[0]);
381
381
 
@@ -389,7 +389,7 @@ describe('multibid adapter', function () {
389
389
 
390
390
  expect(result).to.not.equal(null);
391
391
  expect(result.adUnitCode).to.not.equal(null);
392
- expect(result.adUnitCode).to.equal('test-div');
392
+ expect(result.adUnitCode).to.equal('test.div');
393
393
  expect(result.bid).to.not.equal(null);
394
394
  expect(result.bid).to.deep.equal(bids[1]);
395
395
 
@@ -401,7 +401,7 @@ describe('multibid adapter', function () {
401
401
  });
402
402
 
403
403
  it('does not include extra bids if cpm is less than floor value', function () {
404
- let adUnitCode = 'test-div';
404
+ let adUnitCode = 'test.div';
405
405
  let bids = [{...bidArrayAlt[1]}, {...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}];
406
406
 
407
407
  bids.map(bid => {
@@ -418,7 +418,7 @@ describe('multibid adapter', function () {
418
418
  floorRuleValue: 65,
419
419
  floorValue: 65,
420
420
  matchedFields: {
421
- gptSlot: 'test-div',
421
+ gptSlot: 'test.div',
422
422
  mediaType: 'banner'
423
423
  }
424
424
  }
@@ -435,7 +435,7 @@ describe('multibid adapter', function () {
435
435
 
436
436
  expect(result).to.not.equal(null);
437
437
  expect(result.adUnitCode).to.not.equal(null);
438
- expect(result.adUnitCode).to.equal('test-div');
438
+ expect(result.adUnitCode).to.equal('test.div');
439
439
  expect(result.bid).to.not.equal(null);
440
440
  expect(result.bid.bidder).to.equal('bidderA');
441
441
  expect(result.bid.targetingBidder).to.equal(undefined);
@@ -452,7 +452,7 @@ describe('multibid adapter', function () {
452
452
 
453
453
  expect(result).to.not.equal(null);
454
454
  expect(result.adUnitCode).to.not.equal(null);
455
- expect(result.adUnitCode).to.equal('test-div');
455
+ expect(result.adUnitCode).to.equal('test.div');
456
456
  expect(result.bid).to.not.equal(null);
457
457
  expect(result.bid.bidder).to.equal('bidderB');
458
458
  expect(result.bid.targetingBidder).to.equal(undefined);
@@ -463,14 +463,14 @@ describe('multibid adapter', function () {
463
463
 
464
464
  expect(result).to.not.equal(null);
465
465
  expect(result.adUnitCode).to.not.equal(null);
466
- expect(result.adUnitCode).to.equal('test-div');
466
+ expect(result.adUnitCode).to.equal('test.div');
467
467
  expect(result.bid).to.not.equal(null);
468
468
  expect(result.bid.bidder).to.equal('bidderC');
469
469
  expect(result.bid.targetingBidder).to.equal(undefined);
470
470
  });
471
471
 
472
472
  it('does include extra bids if cpm is not less than floor value', function () {
473
- let adUnitCode = 'test-div';
473
+ let adUnitCode = 'test.div';
474
474
  let bids = [{...bidArrayAlt[1]}, {...bidArrayAlt[0]}];
475
475
 
476
476
  bids.map(bid => {
@@ -487,7 +487,7 @@ describe('multibid adapter', function () {
487
487
  floorRuleValue: 25,
488
488
  floorValue: 25,
489
489
  matchedFields: {
490
- gptSlot: 'test-div',
490
+ gptSlot: 'test.div',
491
491
  mediaType: 'banner'
492
492
  }
493
493
  }
@@ -504,7 +504,7 @@ describe('multibid adapter', function () {
504
504
 
505
505
  expect(result).to.not.equal(null);
506
506
  expect(result.adUnitCode).to.not.equal(null);
507
- expect(result.adUnitCode).to.equal('test-div');
507
+ expect(result.adUnitCode).to.equal('test.div');
508
508
  expect(result.bid).to.not.equal(null);
509
509
  expect(result.bid.bidder).to.equal('bidderA');
510
510
  expect(result.bid.targetingBidder).to.equal(undefined);
@@ -518,7 +518,7 @@ describe('multibid adapter', function () {
518
518
 
519
519
  expect(result).to.not.equal(null);
520
520
  expect(result.adUnitCode).to.not.equal(null);
521
- expect(result.adUnitCode).to.equal('test-div');
521
+ expect(result.adUnitCode).to.equal('test.div');
522
522
  expect(result.bid).to.not.equal(null);
523
523
  expect(result.bid.bidder).to.equal('bidderA');
524
524
  expect(result.bid.targetingBidder).to.equal('bidA2');
@@ -578,7 +578,7 @@ describe('multibid adapter', function () {
578
578
 
579
579
  it('it sorts and creates dynamic alias on bidsReceived if multibid configuration found with prefix', function () {
580
580
  let modifiedBids = [{...bidArray[1]}, {...bidArray[0]}].map(bid => {
581
- addBidResponseHook(bidResponseCallback, 'test-div', {...bid});
581
+ addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
582
582
 
583
583
  return bidResult;
584
584
  });
@@ -603,7 +603,7 @@ describe('multibid adapter', function () {
603
603
 
604
604
  it('it sorts by cpm treating dynamic alias as unique bid when no bid limit defined', function () {
605
605
  let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
606
- addBidResponseHook(bidResponseCallback, 'test-div', {...bid});
606
+ addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
607
607
 
608
608
  return bidResult;
609
609
  });
@@ -636,7 +636,7 @@ describe('multibid adapter', function () {
636
636
 
637
637
  it('it should filter out dynamic bid when bid limit is less than unique bid pool', function () {
638
638
  let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
639
- addBidResponseHook(bidResponseCallback, 'test-div', {...bid});
639
+ addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
640
640
 
641
641
  return bidResult;
642
642
  });
@@ -662,7 +662,7 @@ describe('multibid adapter', function () {
662
662
  config.setConfig({ multibid: [{bidder: 'bidderA', maxBids: 2, targetBiddercodePrefix: 'bidA'}] });
663
663
 
664
664
  let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
665
- addBidResponseHook(bidResponseCallback, 'test-div', {...bid});
665
+ addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
666
666
 
667
667
  return bidResult;
668
668
  });
@@ -1602,32 +1602,6 @@ describe('OpenxAdapter', function () {
1602
1602
  scsm: 'dmp3/5:foo2|bar2,dmp4:baz2'
1603
1603
  },
1604
1604
  },
1605
- {
1606
- name: 'should not send duplicate proprietary segment data from first party config ',
1607
- config: {
1608
- ortb2: {
1609
- user: {
1610
- data: [
1611
- {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}, {id: 'foo'}]},
1612
- {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]},
1613
- ]
1614
- },
1615
- site: {
1616
- content: {
1617
- data: [
1618
- {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]},
1619
- {name: 'dmp3', ext: {segtax: 5}, segment: [{id: 'foo2'}, {id: 'foo2'}, {id: 'bar2'}]},
1620
- {name: 'dmp3', ext: {segtax: 5}, segment: [{id: 'foo2'}, {id: 'bar2'}]},
1621
- ]
1622
- }
1623
- }
1624
- }
1625
- },
1626
- expect: {
1627
- sm: 'dmp1/4:foo|bar',
1628
- scsm: 'dmp1/4:foo|bar,dmp3/5:foo2|bar2'
1629
- },
1630
- },
1631
1605
  {
1632
1606
  name: 'should combine same provider segment data from ortb2.user.data',
1633
1607
  config: {
@@ -369,7 +369,7 @@ describe('Opera Ads Bid Adapter', function () {
369
369
  requestData = JSON.parse(reqs[0].data);
370
370
  }).to.not.throw();
371
371
 
372
- expect(requestData.user.id).to.equal(bidRequests[0].userId.sharedid.id);
372
+ expect(requestData.user.buyeruid).to.equal(bidRequests[0].userId.sharedid.id);
373
373
  });
374
374
 
375
375
  it('pubcid should be used when sharedid is empty', function () {
@@ -406,7 +406,7 @@ describe('Opera Ads Bid Adapter', function () {
406
406
  requestData = JSON.parse(reqs[0].data);
407
407
  }).to.not.throw();
408
408
 
409
- expect(requestData.user.id).to.equal(bidRequests[0].userId.pubcid);
409
+ expect(requestData.user.buyeruid).to.equal(bidRequests[0].userId.pubcid);
410
410
  });
411
411
 
412
412
  it('random uid will be generate when userId is empty', function () {
@@ -433,7 +433,7 @@ describe('Opera Ads Bid Adapter', function () {
433
433
  requestData = JSON.parse(reqs[0].data);
434
434
  }).to.not.throw();
435
435
 
436
- expect(requestData.user.id).to.not.be.empty;
436
+ expect(requestData.user.buyeruid).to.not.be.empty;
437
437
  })
438
438
  });
439
439
 
@@ -679,9 +679,41 @@ describe('Opera Ads Bid Adapter', function () {
679
679
  });
680
680
  });
681
681
 
682
- describe('Test getUserSyncs', function () {
683
- it('getUserSyncs should return empty array', function () {
684
- expect(spec.getUserSyncs()).to.be.an('array').that.is.empty;
682
+ describe('Test getUserSyncs with both iframe and pixel disabled', function () {
683
+ it('getUserSyncs should return an empty array', function () {
684
+ const syncOptions = {};
685
+ expect(spec.getUserSyncs(syncOptions)).to.be.an('array').that.is.empty;
686
+ });
687
+ });
688
+
689
+ describe('Test getUserSyncs with iframe enabled', function () {
690
+ it('getUserSyncs should return array', function () {
691
+ const syncOptions = {
692
+ iframeEnabled: true
693
+ }
694
+ const userSyncPixels = spec.getUserSyncs(syncOptions)
695
+ expect(userSyncPixels).to.have.lengthOf(1);
696
+ expect(userSyncPixels[0].url).to.equal('https://s.adx.opera.com/usersync/page')
697
+ });
698
+ });
699
+
700
+ describe('Test getUserSyncs with pixel enabled', function () {
701
+ it('getUserSyncs should return array', function () {
702
+ const serverResponse = {
703
+ body: {
704
+ 'pixels': [
705
+ 'https://b1.com/usersync',
706
+ 'https://b2.com/usersync'
707
+ ]
708
+ }
709
+ };
710
+ const syncOptions = {
711
+ pixelEnabled: true
712
+ }
713
+ const userSyncPixels = spec.getUserSyncs(syncOptions, [serverResponse])
714
+ expect(userSyncPixels).to.have.lengthOf(2);
715
+ expect(userSyncPixels[0].url).to.equal('https://b1.com/usersync')
716
+ expect(userSyncPixels[1].url).to.equal('https://b2.com/usersync')
685
717
  });
686
718
  });
687
719