prebid.js 5.19.0 → 6.2.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.
- package/.babelrc.js +1 -10
- package/README.md +4 -2
- package/browsers.json +13 -37
- package/gulpfile.js +1 -0
- package/karma.conf.maker.js +1 -1
- package/modules/adheseBidAdapter.js +7 -2
- package/modules/adkernelBidAdapter.js +1 -0
- package/modules/adlivetechBidAdapter.md +61 -0
- package/modules/admixerBidAdapter.js +2 -1
- package/modules/adnuntiusBidAdapter.js +2 -1
- package/modules/adomikAnalyticsAdapter.js +10 -4
- package/modules/adplusBidAdapter.js +203 -0
- package/modules/adplusBidAdapter.md +39 -0
- package/modules/adyoulikeBidAdapter.js +7 -2
- package/modules/airgridRtdProvider.js +1 -1
- package/modules/appnexusBidAdapter.js +28 -5
- package/modules/atsAnalyticsAdapter.js +67 -46
- package/modules/atsAnalyticsAdapter.md +1 -0
- package/modules/beachfrontBidAdapter.js +14 -17
- package/modules/betweenBidAdapter.js +2 -1
- package/modules/browsiRtdProvider.js +106 -18
- package/modules/cleanioRtdProvider.js +192 -0
- package/modules/cleanioRtdProvider.md +59 -0
- package/modules/codefuelBidAdapter.js +1 -3
- package/modules/codefuelBidAdapter.md +3 -3
- package/modules/craftBidAdapter.js +5 -3
- package/modules/datablocksBidAdapter.js +3 -3
- package/modules/dchain.js +149 -0
- package/modules/dchain.md +45 -0
- package/modules/deepintentBidAdapter.js +1 -1
- package/modules/deltaprojectsBidAdapter.js +252 -0
- package/modules/deltaprojectsBidAdapter.md +32 -0
- package/modules/emx_digitalBidAdapter.js +9 -1
- package/modules/engageyaBidAdapter.js +68 -54
- package/modules/freewheel-sspBidAdapter.js +6 -0
- package/modules/glimpseBidAdapter.js +31 -16
- package/modules/goldbachBidAdapter.js +1176 -0
- package/modules/goldbachBidAdapter.md +151 -0
- package/modules/gptPreAuction.js +11 -5
- package/modules/gridBidAdapter.js +1 -0
- package/modules/gumgumBidAdapter.js +5 -1
- package/modules/id5IdSystem.md +6 -6
- package/modules/imRtdProvider.js +31 -0
- package/modules/intersectionRtdProvider.js +114 -0
- package/modules/invibesBidAdapter.js +15 -9
- package/modules/ipromBidAdapter.js +79 -0
- package/modules/ixBidAdapter.js +173 -22
- package/modules/jixieBidAdapter.js +8 -2
- package/modules/justpremiumBidAdapter.js +6 -1
- package/modules/limelightDigitalBidAdapter.js +2 -1
- package/modules/livewrappedAnalyticsAdapter.js +5 -0
- package/modules/luponmediaBidAdapter.js +570 -0
- package/modules/merkleIdSystem.js +5 -0
- package/modules/missenaBidAdapter.js +89 -0
- package/modules/multibid/index.js +3 -3
- package/modules/nativoBidAdapter.js +32 -2
- package/modules/oguryBidAdapter.js +2 -1
- package/modules/openxBidAdapter.js +7 -2
- package/modules/operaadsBidAdapter.js +21 -1
- package/modules/otmBidAdapter.js +146 -0
- package/modules/otmBidAdapter.md +27 -26
- package/modules/outbrainBidAdapter.js +5 -0
- package/modules/playwireBidAdapter.md +61 -0
- package/modules/prebidServerBidAdapter/index.js +3 -3
- package/modules/pubmaticBidAdapter.js +5 -3
- package/modules/relaidoBidAdapter.js +86 -65
- package/modules/richaudienceBidAdapter.js +1 -1
- package/modules/rtdModule/index.js +2 -2
- package/modules/saambaaBidAdapter.js +420 -0
- package/modules/saambaaBidAdapter.md +65 -68
- package/modules/seedtagBidAdapter.js +6 -0
- package/modules/smaatoBidAdapter.js +9 -1
- package/modules/smartxBidAdapter.js +17 -1
- package/modules/sonobiBidAdapter.js +7 -0
- package/modules/sortableBidAdapter.js +1 -0
- package/modules/sspBCBidAdapter.js +34 -3
- package/modules/tappxBidAdapter.js +3 -1
- package/modules/teadsBidAdapter.js +3 -0
- package/modules/trustxBidAdapter.js +18 -7
- package/modules/undertoneBidAdapter.js +8 -1
- package/modules/userId/index.js +27 -2
- package/modules/ventes.md +71 -0
- package/modules/ventesBidAdapter.js +410 -0
- package/modules/ventesBidAdapter.md +93 -0
- package/modules/vidoomyBidAdapter.js +51 -100
- package/modules/visxBidAdapter.js +20 -3
- package/modules/visxBidAdapter.md +4 -6
- package/modules/yahoosspBidAdapter.js +6 -6
- package/modules/yahoosspBidAdapter.md +1 -1
- package/modules/yieldlabBidAdapter.js +41 -10
- package/modules/yieldlabBidAdapter.md +91 -48
- package/modules/yieldoneBidAdapter.js +115 -11
- package/package.json +6 -1
- package/src/adapterManager.js +14 -8
- package/src/auction.js +14 -13
- package/src/targeting.js +2 -2
- package/src/utils.js +7 -0
- package/test/spec/integration/faker/googletag.js +6 -0
- package/test/spec/modules/adheseBidAdapter_spec.js +27 -1
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +18 -0
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +3 -1
- package/test/spec/modules/adplusBidAdapter_spec.js +213 -0
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +26 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +65 -2
- package/test/spec/modules/atsAnalyticsAdapter_spec.js +42 -9
- package/test/spec/modules/beachfrontBidAdapter_spec.js +65 -1
- package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
- package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
- package/test/spec/modules/codefuelBidAdapter_spec.js +1 -1
- package/test/spec/modules/datablocksBidAdapter_spec.js +3 -3
- package/test/spec/modules/dchain_spec.js +329 -0
- package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
- package/test/spec/modules/emx_digitalBidAdapter_spec.js +10 -0
- package/test/spec/modules/engageyaBidAdapter_spec.js +231 -95
- package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
- package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
- package/test/spec/modules/glimpseBidAdapter_spec.js +33 -0
- package/test/spec/modules/goldbachBidAdapter_spec.js +1359 -0
- package/test/spec/modules/gptPreAuction_spec.js +58 -4
- package/test/spec/modules/gumgumBidAdapter_spec.js +6 -0
- package/test/spec/modules/imRtdProvider_spec.js +25 -0
- package/test/spec/modules/intersectionRtdProvider_spec.js +141 -0
- package/test/spec/modules/invibesBidAdapter_spec.js +29 -4
- package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
- package/test/spec/modules/ixBidAdapter_spec.js +288 -5
- package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
- package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
- package/test/spec/modules/konduitWrapper_spec.js +0 -1
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +10 -7
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +23 -4
- package/test/spec/modules/luponmediaBidAdapter_spec.js +412 -0
- package/test/spec/modules/merkleIdSystem_spec.js +18 -0
- package/test/spec/modules/missenaBidAdapter_spec.js +134 -0
- package/test/spec/modules/multibid_spec.js +31 -31
- package/test/spec/modules/nativoBidAdapter_spec.js +35 -18
- package/test/spec/modules/oguryBidAdapter_spec.js +13 -11
- package/test/spec/modules/openxBidAdapter_spec.js +5 -26
- package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
- package/test/spec/modules/otmBidAdapter_spec.js +67 -0
- package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
- package/test/spec/modules/prebidServerBidAdapter_spec.js +19 -2
- package/test/spec/modules/pubmaticBidAdapter_spec.js +1 -1
- package/test/spec/modules/relaidoBidAdapter_spec.js +71 -63
- package/test/spec/modules/seedtagBidAdapter_spec.js +3 -0
- package/test/spec/modules/smaatoBidAdapter_spec.js +61 -0
- package/test/spec/modules/smartxBidAdapter_spec.js +9 -0
- package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
- package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
- package/test/spec/modules/sspBCBidAdapter_spec.js +33 -3
- package/test/spec/modules/tappxBidAdapter_spec.js +4 -0
- package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
- package/test/spec/modules/trustxBidAdapter_spec.js +45 -3
- package/test/spec/modules/userId_spec.js +51 -0
- package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
- package/test/spec/modules/vidoomyBidAdapter_spec.js +32 -13
- package/test/spec/modules/visxBidAdapter_spec.js +121 -5
- package/test/spec/modules/yieldlabBidAdapter_spec.js +81 -0
- package/test/spec/modules/yieldoneBidAdapter_spec.js +299 -53
- package/test/spec/unit/core/adapterManager_spec.js +26 -7
- package/test/spec/unit/core/targeting_spec.js +44 -0
- package/wdio.conf.js +1 -1
|
@@ -2,7 +2,7 @@ import * as utils from 'src/utils.js';
|
|
|
2
2
|
import { config } from 'src/config.js';
|
|
3
3
|
import { expect } from 'chai';
|
|
4
4
|
import { newBidder } from 'src/adapters/bidderFactory.js';
|
|
5
|
-
import { spec } from 'modules/ixBidAdapter.js';
|
|
5
|
+
import { spec, storage, ERROR_CODES } from '../../../modules/ixBidAdapter.js';
|
|
6
6
|
import { createEidsArray } from 'modules/userId/eids.js';
|
|
7
7
|
|
|
8
8
|
describe('IndexexchangeAdapter', function () {
|
|
@@ -353,6 +353,37 @@ describe('IndexexchangeAdapter', function () {
|
|
|
353
353
|
]
|
|
354
354
|
};
|
|
355
355
|
|
|
356
|
+
const DEFAULT_VIDEO_BID_RESPONSE_WITH_MTYPE_SET = {
|
|
357
|
+
cur: 'USD',
|
|
358
|
+
id: '1aa2bb3cc4de',
|
|
359
|
+
seatbid: [
|
|
360
|
+
{
|
|
361
|
+
bid: [
|
|
362
|
+
{
|
|
363
|
+
crid: '12346',
|
|
364
|
+
adomain: ['www.abcd.com'],
|
|
365
|
+
adid: '14851456',
|
|
366
|
+
impid: '1a2b3c4e',
|
|
367
|
+
cid: '3051267',
|
|
368
|
+
price: 110,
|
|
369
|
+
id: '2',
|
|
370
|
+
mtype: 2,
|
|
371
|
+
adm: '<?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=\"488427365\"> <InLine> <AdSystem>Test</AdSystem> <AdTitle>In-Stream Video</AdTitle> </InLine> </Ad></VAST',
|
|
372
|
+
ext: {
|
|
373
|
+
vasturl: 'www.abcd.com/vast',
|
|
374
|
+
errorurl: 'www.abcd.com/error',
|
|
375
|
+
dspid: 51,
|
|
376
|
+
pricelevel: '_110',
|
|
377
|
+
advbrandid: 303326,
|
|
378
|
+
advbrand: 'OECTB'
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
],
|
|
382
|
+
seat: '3971'
|
|
383
|
+
}
|
|
384
|
+
]
|
|
385
|
+
};
|
|
386
|
+
|
|
356
387
|
const DEFAULT_OPTION = {
|
|
357
388
|
gdprConsent: {
|
|
358
389
|
gdprApplies: true,
|
|
@@ -1236,7 +1267,7 @@ describe('IndexexchangeAdapter', function () {
|
|
|
1236
1267
|
afterEach(function () {
|
|
1237
1268
|
config.setConfig({
|
|
1238
1269
|
ortb2: {}
|
|
1239
|
-
})
|
|
1270
|
+
});
|
|
1240
1271
|
});
|
|
1241
1272
|
|
|
1242
1273
|
it('should not set ixdiag.fpd value if not defined', function () {
|
|
@@ -1405,16 +1436,16 @@ describe('IndexexchangeAdapter', function () {
|
|
|
1405
1436
|
}
|
|
1406
1437
|
};
|
|
1407
1438
|
const requests = spec.buildRequests(validBids, DEFAULT_OPTION);
|
|
1408
|
-
const { dfp_ad_unit_code } = JSON.parse(requests[0].data.r).imp[0]
|
|
1439
|
+
const { ext: { dfp_ad_unit_code } } = JSON.parse(requests[0].data.r).imp[0];
|
|
1409
1440
|
expect(dfp_ad_unit_code).to.equal(AD_UNIT_CODE);
|
|
1410
1441
|
});
|
|
1411
1442
|
|
|
1412
1443
|
it('should not send dfp_adunit_code in request if ortb2Imp.ext.data.adserver.adslot does not exists', function () {
|
|
1413
1444
|
const validBids = utils.deepClone(DEFAULT_BANNER_VALID_BID);
|
|
1414
1445
|
const requests = spec.buildRequests(validBids, DEFAULT_OPTION);
|
|
1415
|
-
const {
|
|
1446
|
+
const { ext } = JSON.parse(requests[0].data.r).imp[0];
|
|
1416
1447
|
|
|
1417
|
-
expect(
|
|
1448
|
+
expect(ext).to.not.exist;
|
|
1418
1449
|
});
|
|
1419
1450
|
|
|
1420
1451
|
it('payload should have correct format and value', function () {
|
|
@@ -2343,6 +2374,45 @@ describe('IndexexchangeAdapter', function () {
|
|
|
2343
2374
|
expect(result[0]).to.deep.equal(expectedParse[0]);
|
|
2344
2375
|
});
|
|
2345
2376
|
|
|
2377
|
+
it('should get correct bid response for video ad and set bid.vastXml when mtype is 2 (video)', function () {
|
|
2378
|
+
const expectedParse = [
|
|
2379
|
+
{
|
|
2380
|
+
requestId: '1a2b3c4e',
|
|
2381
|
+
cpm: 1.1,
|
|
2382
|
+
creativeId: '12346',
|
|
2383
|
+
mediaType: 'video',
|
|
2384
|
+
mediaTypes: {
|
|
2385
|
+
video: {
|
|
2386
|
+
context: 'instream',
|
|
2387
|
+
playerSize: [
|
|
2388
|
+
[
|
|
2389
|
+
400,
|
|
2390
|
+
100
|
|
2391
|
+
]
|
|
2392
|
+
]
|
|
2393
|
+
}
|
|
2394
|
+
},
|
|
2395
|
+
width: 640,
|
|
2396
|
+
height: 480,
|
|
2397
|
+
currency: 'USD',
|
|
2398
|
+
ttl: 3600,
|
|
2399
|
+
netRevenue: true,
|
|
2400
|
+
vastXml: '<?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=\"488427365\"> <InLine> <AdSystem>Test</AdSystem> <AdTitle>In-Stream Video</AdTitle> </InLine> </Ad></VAST',
|
|
2401
|
+
meta: {
|
|
2402
|
+
networkId: 51,
|
|
2403
|
+
brandId: 303326,
|
|
2404
|
+
brandName: 'OECTB',
|
|
2405
|
+
advertiserDomains: ['www.abcd.com']
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
];
|
|
2409
|
+
const result = spec.interpretResponse({ body: DEFAULT_VIDEO_BID_RESPONSE_WITH_MTYPE_SET }, {
|
|
2410
|
+
data: DEFAULT_BIDDER_REQUEST_DATA, validBidRequests: ONE_VIDEO
|
|
2411
|
+
});
|
|
2412
|
+
|
|
2413
|
+
expect(result[0]).to.deep.equal(expectedParse[0]);
|
|
2414
|
+
});
|
|
2415
|
+
|
|
2346
2416
|
it('bidrequest should not have page if options is undefined', function () {
|
|
2347
2417
|
const options = {};
|
|
2348
2418
|
const validBidWithoutreferInfo = spec.buildRequests(DEFAULT_BANNER_VALID_BID, options);
|
|
@@ -2524,4 +2594,217 @@ describe('IndexexchangeAdapter', function () {
|
|
|
2524
2594
|
expect(r.regs.coppa).to.be.undefined;
|
|
2525
2595
|
});
|
|
2526
2596
|
});
|
|
2597
|
+
|
|
2598
|
+
describe('LocalStorage ixdiag', () => {
|
|
2599
|
+
let TODAY = new Date().toISOString().slice(0, 10);
|
|
2600
|
+
const key = 'ixdiag';
|
|
2601
|
+
|
|
2602
|
+
let sandbox;
|
|
2603
|
+
let setDataInLocalStorageStub;
|
|
2604
|
+
let getDataFromLocalStorageStub;
|
|
2605
|
+
let removeDataFromLocalStorageStub;
|
|
2606
|
+
let localStorageValues = {};
|
|
2607
|
+
|
|
2608
|
+
beforeEach(() => {
|
|
2609
|
+
sandbox = sinon.sandbox.create();
|
|
2610
|
+
setDataInLocalStorageStub = sandbox.stub(storage, 'setDataInLocalStorage').callsFake((key, value) => localStorageValues[key] = value)
|
|
2611
|
+
getDataFromLocalStorageStub = sandbox.stub(storage, 'getDataFromLocalStorage').callsFake((key) => localStorageValues[key])
|
|
2612
|
+
removeDataFromLocalStorageStub = sandbox.stub(storage, 'removeDataFromLocalStorage').callsFake((key) => delete localStorageValues[key])
|
|
2613
|
+
sandbox.stub(storage, 'localStorageIsEnabled').returns(true);
|
|
2614
|
+
});
|
|
2615
|
+
|
|
2616
|
+
afterEach(() => {
|
|
2617
|
+
setDataInLocalStorageStub.restore();
|
|
2618
|
+
getDataFromLocalStorageStub.restore();
|
|
2619
|
+
removeDataFromLocalStorageStub.restore();
|
|
2620
|
+
localStorageValues = {};
|
|
2621
|
+
sandbox.restore();
|
|
2622
|
+
|
|
2623
|
+
config.setConfig({
|
|
2624
|
+
fpd: {},
|
|
2625
|
+
ix: {},
|
|
2626
|
+
})
|
|
2627
|
+
});
|
|
2628
|
+
|
|
2629
|
+
it('should not log error in LocalStorage when there is no logError called.', () => {
|
|
2630
|
+
const bid = DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0];
|
|
2631
|
+
expect(spec.isBidRequestValid(bid)).to.be.true;
|
|
2632
|
+
expect(localStorageValues[key]).to.be.undefined;
|
|
2633
|
+
});
|
|
2634
|
+
|
|
2635
|
+
it('should log ERROR_CODES.BID_SIZE_INVALID_FORMAT in LocalStorage when there is logError called.', () => {
|
|
2636
|
+
const bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
|
|
2637
|
+
bid.params.size = ['400', 100];
|
|
2638
|
+
|
|
2639
|
+
expect(spec.isBidRequestValid(bid)).to.be.false;
|
|
2640
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal({ [TODAY]: { [ERROR_CODES.BID_SIZE_INVALID_FORMAT]: 1 } });
|
|
2641
|
+
});
|
|
2642
|
+
|
|
2643
|
+
it('should log ERROR_CODES.BID_SIZE_NOT_INCLUDED in LocalStorage when there is logError called.', () => {
|
|
2644
|
+
const bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
|
|
2645
|
+
bid.params.size = [407, 100];
|
|
2646
|
+
|
|
2647
|
+
expect(spec.isBidRequestValid(bid)).to.be.false;
|
|
2648
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal({ [TODAY]: { [ERROR_CODES.BID_SIZE_NOT_INCLUDED]: 1 } });
|
|
2649
|
+
});
|
|
2650
|
+
|
|
2651
|
+
it('should log ERROR_CODES.PROPERTY_NOT_INCLUDED in LocalStorage when there is logError called.', () => {
|
|
2652
|
+
const bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
|
|
2653
|
+
bid.params.video = {};
|
|
2654
|
+
|
|
2655
|
+
expect(spec.isBidRequestValid(bid)).to.be.false;
|
|
2656
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal({ [TODAY]: { [ERROR_CODES.PROPERTY_NOT_INCLUDED]: 4 } });
|
|
2657
|
+
});
|
|
2658
|
+
|
|
2659
|
+
it('should log ERROR_CODES.SITE_ID_INVALID_VALUE in LocalStorage when there is logError called.', () => {
|
|
2660
|
+
const bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
|
|
2661
|
+
bid.params.siteId = false;
|
|
2662
|
+
|
|
2663
|
+
expect(spec.isBidRequestValid(bid)).to.be.false;
|
|
2664
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal({ [TODAY]: { [ERROR_CODES.SITE_ID_INVALID_VALUE]: 1 } });
|
|
2665
|
+
});
|
|
2666
|
+
|
|
2667
|
+
it('should log ERROR_CODES.BID_FLOOR_INVALID_FORMAT in LocalStorage when there is logError called.', () => {
|
|
2668
|
+
const bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
|
|
2669
|
+
bid.params.bidFloor = true;
|
|
2670
|
+
|
|
2671
|
+
expect(spec.isBidRequestValid(bid)).to.be.false;
|
|
2672
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal({ [TODAY]: { [ERROR_CODES.BID_FLOOR_INVALID_FORMAT]: 1 } });
|
|
2673
|
+
});
|
|
2674
|
+
|
|
2675
|
+
it('should log ERROR_CODES.IX_FPD_EXCEEDS_MAX_SIZE in LocalStorage when there is logError called.', () => {
|
|
2676
|
+
const bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
|
|
2677
|
+
|
|
2678
|
+
config.setConfig({
|
|
2679
|
+
ix: {
|
|
2680
|
+
firstPartyData: {
|
|
2681
|
+
cd: Array(1700).join('#')
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
});
|
|
2685
|
+
|
|
2686
|
+
expect(spec.isBidRequestValid(bid)).to.be.true;
|
|
2687
|
+
spec.buildRequests([bid]);
|
|
2688
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal({ [TODAY]: { [ERROR_CODES.IX_FPD_EXCEEDS_MAX_SIZE]: 2 } });
|
|
2689
|
+
});
|
|
2690
|
+
|
|
2691
|
+
it('should log ERROR_CODES.EXCEEDS_MAX_SIZE in LocalStorage when there is logError called.', () => {
|
|
2692
|
+
const bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
|
|
2693
|
+
bid.bidderRequestId = Array(8000).join('#');
|
|
2694
|
+
|
|
2695
|
+
expect(spec.isBidRequestValid(bid)).to.be.true;
|
|
2696
|
+
spec.buildRequests([bid]);
|
|
2697
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal({ [TODAY]: { [ERROR_CODES.EXCEEDS_MAX_SIZE]: 2 } });
|
|
2698
|
+
});
|
|
2699
|
+
|
|
2700
|
+
it('should log ERROR_CODES.PB_FPD_EXCEEDS_MAX_SIZE in LocalStorage when there is logError called.', () => {
|
|
2701
|
+
const bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
|
|
2702
|
+
|
|
2703
|
+
config.setConfig({
|
|
2704
|
+
fpd: {
|
|
2705
|
+
site: {
|
|
2706
|
+
data: {
|
|
2707
|
+
pageType: Array(5700).join('#')
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
}
|
|
2711
|
+
});
|
|
2712
|
+
|
|
2713
|
+
expect(spec.isBidRequestValid(bid)).to.be.true;
|
|
2714
|
+
spec.buildRequests([bid]);
|
|
2715
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal({ [TODAY]: { [ERROR_CODES.PB_FPD_EXCEEDS_MAX_SIZE]: 2 } });
|
|
2716
|
+
});
|
|
2717
|
+
|
|
2718
|
+
it('should log ERROR_CODES.VIDEO_DURATION_INVALID in LocalStorage when there is logError called.', () => {
|
|
2719
|
+
const bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
|
|
2720
|
+
bid.params.video.minduration = 1;
|
|
2721
|
+
bid.params.video.maxduration = 0;
|
|
2722
|
+
|
|
2723
|
+
expect(spec.isBidRequestValid(bid)).to.be.true;
|
|
2724
|
+
spec.buildRequests([bid]);
|
|
2725
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal({ [TODAY]: { [ERROR_CODES.VIDEO_DURATION_INVALID]: 2 } });
|
|
2726
|
+
});
|
|
2727
|
+
|
|
2728
|
+
it('should increment errors for errorCode', () => {
|
|
2729
|
+
const bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
|
|
2730
|
+
bid.params.video = {};
|
|
2731
|
+
|
|
2732
|
+
expect(spec.isBidRequestValid(bid)).to.be.false;
|
|
2733
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal({ [TODAY]: { [ERROR_CODES.PROPERTY_NOT_INCLUDED]: 4 } });
|
|
2734
|
+
|
|
2735
|
+
expect(spec.isBidRequestValid(bid)).to.be.false;
|
|
2736
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal({ [TODAY]: { [ERROR_CODES.PROPERTY_NOT_INCLUDED]: 8 } });
|
|
2737
|
+
});
|
|
2738
|
+
|
|
2739
|
+
it('should add new errorCode to ixdiag.', () => {
|
|
2740
|
+
let bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
|
|
2741
|
+
bid.params.size = ['400', 100];
|
|
2742
|
+
|
|
2743
|
+
expect(spec.isBidRequestValid(bid)).to.be.false;
|
|
2744
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal({ [TODAY]: { [ERROR_CODES.BID_SIZE_INVALID_FORMAT]: 1 } });
|
|
2745
|
+
|
|
2746
|
+
bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
|
|
2747
|
+
bid.params.siteId = false;
|
|
2748
|
+
|
|
2749
|
+
expect(spec.isBidRequestValid(bid)).to.be.false;
|
|
2750
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal({
|
|
2751
|
+
[TODAY]: {
|
|
2752
|
+
[ERROR_CODES.BID_SIZE_INVALID_FORMAT]: 1,
|
|
2753
|
+
[ERROR_CODES.SITE_ID_INVALID_VALUE]: 1
|
|
2754
|
+
}
|
|
2755
|
+
});
|
|
2756
|
+
});
|
|
2757
|
+
|
|
2758
|
+
it('should clear errors with successful response', () => {
|
|
2759
|
+
const ixdiag = { [TODAY]: { '1': 1, '3': 8, '4': 1 } };
|
|
2760
|
+
setDataInLocalStorageStub(key, JSON.stringify(ixdiag));
|
|
2761
|
+
|
|
2762
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal(ixdiag);
|
|
2763
|
+
|
|
2764
|
+
const request = DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0];
|
|
2765
|
+
expect(spec.isBidRequestValid(request)).to.be.true;
|
|
2766
|
+
|
|
2767
|
+
const data = {
|
|
2768
|
+
...utils.deepClone(DEFAULT_BIDDER_REQUEST_DATA[0]),
|
|
2769
|
+
r: JSON.stringify({
|
|
2770
|
+
id: '345',
|
|
2771
|
+
imp: [
|
|
2772
|
+
{
|
|
2773
|
+
id: '1a2b3c4e',
|
|
2774
|
+
}
|
|
2775
|
+
],
|
|
2776
|
+
ext: {
|
|
2777
|
+
ixdiag: {
|
|
2778
|
+
err: {
|
|
2779
|
+
'4': 8
|
|
2780
|
+
}
|
|
2781
|
+
}
|
|
2782
|
+
}
|
|
2783
|
+
}),
|
|
2784
|
+
};
|
|
2785
|
+
|
|
2786
|
+
const validBidRequests = [
|
|
2787
|
+
DEFAULT_MULTIFORMAT_BANNER_VALID_BID[0],
|
|
2788
|
+
DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]
|
|
2789
|
+
];
|
|
2790
|
+
|
|
2791
|
+
spec.interpretResponse({ body: DEFAULT_BANNER_BID_RESPONSE }, { data, validBidRequests });
|
|
2792
|
+
|
|
2793
|
+
expect(localStorageValues[key]).to.be.undefined;
|
|
2794
|
+
});
|
|
2795
|
+
|
|
2796
|
+
it('should clear errors after 7 day expiry errorCode', () => {
|
|
2797
|
+
const EXPIRED_DATE = '2019-12-12';
|
|
2798
|
+
|
|
2799
|
+
const ixdiag = { [EXPIRED_DATE]: { '1': 1, '3': 8, '4': 1 }, [TODAY]: { '3': 8, '4': 1 } };
|
|
2800
|
+
setDataInLocalStorageStub(key, JSON.stringify(ixdiag));
|
|
2801
|
+
|
|
2802
|
+
const bid = utils.deepClone(DEFAULT_MULTIFORMAT_VIDEO_VALID_BID[0]);
|
|
2803
|
+
bid.params.size = ['400', 100];
|
|
2804
|
+
|
|
2805
|
+
expect(spec.isBidRequestValid(bid)).to.be.false;
|
|
2806
|
+
expect(JSON.parse(localStorageValues[key])[EXPIRED_DATE]).to.be.undefined;
|
|
2807
|
+
expect(JSON.parse(localStorageValues[key])).to.deep.equal({ [TODAY]: { '1': 1, '3': 8, '4': 1 } })
|
|
2808
|
+
});
|
|
2809
|
+
});
|
|
2527
2810
|
});
|
|
@@ -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.
|
|
247
|
-
const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.
|
|
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.
|
|
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://
|
|
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://
|
|
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.
|
|
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://
|
|
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://
|
|
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 () {
|
|
@@ -53,7 +53,6 @@ describe('The Konduit vast wrapper module', function () {
|
|
|
53
53
|
const callback = sinon.spy();
|
|
54
54
|
processBids({ bid, callback });
|
|
55
55
|
server.respond();
|
|
56
|
-
|
|
57
56
|
expect(server.requests.length).to.equal(1);
|
|
58
57
|
|
|
59
58
|
const requestBody = JSON.parse(server.requests[0].requestBody);
|
|
@@ -9,7 +9,8 @@ describe('limelightDigitalAdapter', function () {
|
|
|
9
9
|
params: {
|
|
10
10
|
host: 'exchange.ortb.net',
|
|
11
11
|
adUnitId: 123,
|
|
12
|
-
adUnitType: 'banner'
|
|
12
|
+
adUnitType: 'banner',
|
|
13
|
+
publisherId: 'perfectPublisher'
|
|
13
14
|
},
|
|
14
15
|
placementCode: 'placement_0',
|
|
15
16
|
auctionId: '74f78609-a92d-4cf1-869f-1b244bbfb5d2',
|
|
@@ -41,7 +42,8 @@ describe('limelightDigitalAdapter', function () {
|
|
|
41
42
|
params: {
|
|
42
43
|
host: 'exchange.ortb.net',
|
|
43
44
|
adUnitId: 789,
|
|
44
|
-
adUnitType: 'video'
|
|
45
|
+
adUnitType: 'video',
|
|
46
|
+
publisherId: 'secondPerfectPublisher'
|
|
45
47
|
},
|
|
46
48
|
placementCode: 'placement_2',
|
|
47
49
|
auctionId: 'e4771143-6aa7-41ec-8824-ced4342c96c8',
|
|
@@ -89,7 +91,7 @@ describe('limelightDigitalAdapter', function () {
|
|
|
89
91
|
expect(data.deviceHeight).to.be.a('number')
|
|
90
92
|
expect(data.secure).to.be.a('boolean')
|
|
91
93
|
data.adUnits.forEach(adUnit => {
|
|
92
|
-
expect(adUnit).to.have.all.keys('id', 'bidId', 'type', 'sizes', 'transactionId')
|
|
94
|
+
expect(adUnit).to.have.all.keys('id', 'bidId', 'type', 'sizes', 'transactionId', 'publisherId')
|
|
93
95
|
expect(adUnit.id).to.be.a('number')
|
|
94
96
|
expect(adUnit.bidId).to.be.a('string')
|
|
95
97
|
expect(adUnit.type).to.be.a('string')
|
|
@@ -456,10 +458,10 @@ describe('limelightDigitalAdapter', function () {
|
|
|
456
458
|
});
|
|
457
459
|
|
|
458
460
|
function validateAdUnit(adUnit, bid) {
|
|
459
|
-
expect(adUnit.id).to.equal(bid.params.adUnitId)
|
|
460
|
-
expect(adUnit.bidId).to.equal(bid.bidId)
|
|
461
|
-
expect(adUnit.type).to.equal(bid.params.adUnitType.toUpperCase())
|
|
462
|
-
expect(adUnit.transactionId).to.equal(bid.transactionId)
|
|
461
|
+
expect(adUnit.id).to.equal(bid.params.adUnitId);
|
|
462
|
+
expect(adUnit.bidId).to.equal(bid.bidId);
|
|
463
|
+
expect(adUnit.type).to.equal(bid.params.adUnitType.toUpperCase());
|
|
464
|
+
expect(adUnit.transactionId).to.equal(bid.transactionId);
|
|
463
465
|
let bidSizes = [];
|
|
464
466
|
if (bid.mediaTypes) {
|
|
465
467
|
if (bid.mediaTypes.video && bid.mediaTypes.video.playerSize) {
|
|
@@ -478,4 +480,5 @@ function validateAdUnit(adUnit, bid) {
|
|
|
478
480
|
height: size[1]
|
|
479
481
|
}
|
|
480
482
|
}));
|
|
483
|
+
expect(adUnit.publisherId).to.equal(bid.params.publisherId);
|
|
481
484
|
}
|
|
@@ -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': '
|
|
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': '
|
|
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('
|
|
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('
|
|
502
|
+
expect(message.wins[0].floorCur).to.equal('FOO');
|
|
484
503
|
});
|
|
485
504
|
|
|
486
505
|
it('should forward Livewrapped floor data', function () {
|