prebid.js 6.4.0 → 6.8.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/integrationExamples/gpt/amp/creative.html +11 -33
- package/integrationExamples/gpt/x-domain/creative.html +53 -26
- package/modules/.submodules.json +2 -1
- package/modules/adagioBidAdapter.js +0 -8
- package/modules/adagioBidAdapter.md +1 -1
- package/modules/adbookpspBidAdapter.js +27 -10
- package/modules/adhashBidAdapter.js +3 -3
- package/modules/adkernelBidAdapter.js +2 -1
- package/modules/admanBidAdapter.js +10 -4
- package/modules/adomikAnalyticsAdapter.js +23 -11
- package/modules/adqueryIdSystem.js +103 -0
- package/modules/adqueryIdSystem.md +35 -0
- package/modules/adyoulikeBidAdapter.js +13 -9
- package/modules/appnexusBidAdapter.js +11 -0
- package/modules/bliinkBidAdapter.js +3 -2
- package/modules/brandmetricsRtdProvider.js +168 -0
- package/modules/brandmetricsRtdProvider.md +40 -0
- package/modules/colossussspBidAdapter.js +12 -8
- package/modules/colossussspBidAdapter.md +15 -1
- package/modules/compassBidAdapter.js +10 -3
- package/modules/consentManagement.js +7 -1
- package/modules/consumableBidAdapter.md +1 -1
- package/modules/criteoBidAdapter.js +10 -1
- package/modules/criteoIdSystem.js +29 -7
- package/modules/currency.js +26 -1
- package/modules/displayioBidAdapter.js +157 -0
- package/modules/displayioBidAdapter.md +148 -0
- package/modules/docereeBidAdapter.js +10 -1
- package/modules/docereeBidAdapter.md +2 -0
- package/modules/e_volutionBidAdapter.js +158 -0
- package/modules/glimpseBidAdapter.js +66 -44
- package/modules/gnetBidAdapter.js +3 -3
- package/modules/gnetBidAdapter.md +4 -4
- package/modules/gptPreAuction.js +55 -7
- package/modules/gumgumBidAdapter.js +56 -42
- package/modules/idImportLibrary.js +45 -8
- package/modules/idImportLibrary.md +4 -0
- package/modules/improvedigitalBidAdapter.js +24 -2
- package/modules/interactiveOffersBidAdapter.js +9 -6
- package/modules/ixBidAdapter.js +29 -12
- package/modules/jwplayerRtdProvider.js +71 -6
- package/modules/jwplayerRtdProvider.md +27 -11
- package/modules/kargoBidAdapter.js +2 -2
- package/modules/limelightDigitalBidAdapter.js +2 -1
- package/modules/livewrappedAnalyticsAdapter.js +3 -1
- package/modules/loglyliftBidAdapter.js +79 -0
- package/modules/loglyliftBidAdapter.md +55 -0
- package/modules/nextMillenniumBidAdapter.js +3 -1
- package/modules/oguryBidAdapter.js +9 -2
- package/modules/onetagBidAdapter.js +4 -2
- package/modules/optimeraRtdProvider.js +8 -1
- package/modules/ozoneBidAdapter.js +21 -64
- package/modules/pilotxBidAdapter.js +147 -0
- package/modules/pilotxBidAdapter.md +50 -0
- package/modules/proxistoreBidAdapter.js +0 -2
- package/modules/pubmaticAnalyticsAdapter.js +16 -0
- package/modules/richaudienceBidAdapter.js +3 -2
- package/modules/riseBidAdapter.js +1 -1
- package/modules/rtbhouseBidAdapter.js +14 -4
- package/modules/rtdModule/index.js +14 -15
- package/modules/rubiconAnalyticsAdapter.js +3 -2
- package/modules/seedingAllianceBidAdapter.js +3 -3
- package/modules/sharethroughBidAdapter.js +12 -17
- package/modules/showheroes-bsBidAdapter.js +13 -2
- package/modules/sovrnBidAdapter.js +93 -18
- package/modules/sovrnBidAdapter.md +80 -2
- package/modules/synacormediaBidAdapter.js +31 -10
- package/modules/tappxBidAdapter.js +8 -5
- package/modules/teadsBidAdapter.js +1 -2
- package/modules/undertoneBidAdapter.js +17 -1
- package/modules/userId/eids.js +7 -1
- package/modules/userId/userId.md +8 -0
- package/modules/viewability.js +177 -0
- package/modules/viewability.md +87 -0
- package/modules/welectBidAdapter.js +106 -0
- package/modules/yahoosspBidAdapter.js +2 -0
- package/modules/yieldmoBidAdapter.js +23 -5
- package/modules/zeta_global_sspAnalyticsAdapter.js +97 -0
- package/modules/zeta_global_sspAnalyticsAdapter.md +24 -0
- package/package.json +1 -1
- package/src/adRendering.js +38 -0
- package/src/auction.js +44 -9
- package/src/config.js +27 -3
- package/src/hook.js +5 -1
- package/src/prebid.js +21 -21
- package/src/secureCreatives.js +114 -44
- package/src/utils.js +25 -4
- package/test/helpers/syncPromise.js +71 -0
- package/test/spec/auctionmanager_spec.js +148 -16
- package/test/spec/config_spec.js +279 -0
- package/test/spec/modules/adagioBidAdapter_spec.js +0 -10
- package/test/spec/modules/adbookpspBidAdapter_spec.js +17 -3
- package/test/spec/modules/adhashBidAdapter_spec.js +2 -2
- package/test/spec/modules/admanBidAdapter_spec.js +2 -2
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +3 -1
- package/test/spec/modules/adqueryIdSystem_spec.js +74 -0
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +49 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +27 -0
- package/test/spec/modules/bliinkBidAdapter_spec.js +2 -0
- package/test/spec/modules/brandmetricsRtdProvider_spec.js +191 -0
- package/test/spec/modules/colossussspBidAdapter_spec.js +5 -2
- package/test/spec/modules/compassBidAdapter_spec.js +1 -0
- package/test/spec/modules/consentManagement_spec.js +20 -0
- package/test/spec/modules/criteoBidAdapter_spec.js +21 -0
- package/test/spec/modules/criteoIdSystem_spec.js +6 -3
- package/test/spec/modules/currency_spec.js +21 -6
- package/test/spec/modules/displayioBidAdapter_spec.js +239 -0
- package/test/spec/modules/docereeBidAdapter_spec.js +9 -1
- package/test/spec/modules/e_volutionBidAdapter_spec.js +242 -0
- package/test/spec/modules/eids_spec.js +15 -0
- package/test/spec/modules/glimpseBidAdapter_spec.js +0 -18
- package/test/spec/modules/gnetBidAdapter_spec.js +6 -6
- package/test/spec/modules/gptPreAuction_spec.js +177 -2
- package/test/spec/modules/gumgumBidAdapter_spec.js +46 -0
- package/test/spec/modules/idImportLibrary_spec.js +197 -10
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +42 -0
- package/test/spec/modules/ixBidAdapter_spec.js +104 -62
- package/test/spec/modules/jwplayerRtdProvider_spec.js +195 -2
- package/test/spec/modules/kargoBidAdapter_spec.js +1 -1
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +75 -17
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +22 -0
- package/test/spec/modules/loglyliftBidAdapter_spec.js +172 -0
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +1 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +10 -2
- package/test/spec/modules/optimeraRtdProvider_spec.js +14 -1
- package/test/spec/modules/ozoneBidAdapter_spec.js +43 -31
- package/test/spec/modules/pilotxBidAdapter_spec.js +244 -0
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +13 -1
- package/test/spec/modules/realTimeDataModule_spec.js +67 -5
- package/test/spec/modules/richaudienceBidAdapter_spec.js +40 -0
- package/test/spec/modules/riseBidAdapter_spec.js +1 -1
- package/test/spec/modules/rtbhouseBidAdapter_spec.js +20 -0
- package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +30 -0
- package/test/spec/modules/sharethroughBidAdapter_spec.js +91 -6
- package/test/spec/modules/showheroes-bsBidAdapter_spec.js +2 -0
- package/test/spec/modules/sovrnBidAdapter_spec.js +413 -333
- package/test/spec/modules/synacormediaBidAdapter_spec.js +70 -0
- package/test/spec/modules/tappxBidAdapter_spec.js +0 -19
- package/test/spec/modules/teadsBidAdapter_spec.js +14 -59
- package/test/spec/modules/undertoneBidAdapter_spec.js +55 -2
- package/test/spec/modules/userId_spec.js +68 -19
- package/test/spec/modules/viewability_spec.js +280 -0
- package/test/spec/modules/welectBidAdapter_spec.js +211 -0
- package/test/spec/modules/yahoosspBidAdapter_spec.js +10 -0
- package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +427 -0
- package/test/spec/unit/pbjs_api_spec.js +20 -2
- package/test/spec/unit/secureCreatives_spec.js +85 -0
package/test/spec/config_spec.js
CHANGED
|
@@ -7,8 +7,10 @@ const utils = require('src/utils');
|
|
|
7
7
|
let getConfig;
|
|
8
8
|
let setConfig;
|
|
9
9
|
let readConfig;
|
|
10
|
+
let mergeConfig;
|
|
10
11
|
let getBidderConfig;
|
|
11
12
|
let setBidderConfig;
|
|
13
|
+
let mergeBidderConfig;
|
|
12
14
|
let setDefaults;
|
|
13
15
|
|
|
14
16
|
describe('config API', function () {
|
|
@@ -19,8 +21,10 @@ describe('config API', function () {
|
|
|
19
21
|
getConfig = config.getConfig;
|
|
20
22
|
setConfig = config.setConfig;
|
|
21
23
|
readConfig = config.readConfig;
|
|
24
|
+
mergeConfig = config.mergeConfig;
|
|
22
25
|
getBidderConfig = config.getBidderConfig;
|
|
23
26
|
setBidderConfig = config.setBidderConfig;
|
|
27
|
+
mergeBidderConfig = config.mergeBidderConfig;
|
|
24
28
|
setDefaults = config.setDefaults;
|
|
25
29
|
logErrorSpy = sinon.spy(utils, 'logError');
|
|
26
30
|
logWarnSpy = sinon.spy(utils, 'logWarn');
|
|
@@ -345,4 +349,279 @@ describe('config API', function () {
|
|
|
345
349
|
const warning = 'Auction Options given an incorrect param: testing';
|
|
346
350
|
assert.ok(logWarnSpy.calledWith(warning), 'expected warning was logged');
|
|
347
351
|
});
|
|
352
|
+
|
|
353
|
+
it('should merge input with existing global config', function () {
|
|
354
|
+
const obj = {
|
|
355
|
+
ortb2: {
|
|
356
|
+
site: {
|
|
357
|
+
name: 'example',
|
|
358
|
+
domain: 'page.example.com',
|
|
359
|
+
cat: ['IAB2'],
|
|
360
|
+
sectioncat: ['IAB2-2'],
|
|
361
|
+
pagecat: ['IAB2-2']
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
setConfig({ ortb2: {
|
|
366
|
+
user: {
|
|
367
|
+
ext: {
|
|
368
|
+
data: {
|
|
369
|
+
registered: true,
|
|
370
|
+
interests: ['cars']
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
mergeConfig(obj);
|
|
377
|
+
const expected = {
|
|
378
|
+
site: {
|
|
379
|
+
name: 'example',
|
|
380
|
+
domain: 'page.example.com',
|
|
381
|
+
cat: ['IAB2'],
|
|
382
|
+
sectioncat: ['IAB2-2'],
|
|
383
|
+
pagecat: ['IAB2-2']
|
|
384
|
+
},
|
|
385
|
+
user: {
|
|
386
|
+
ext: {
|
|
387
|
+
data: {
|
|
388
|
+
registered: true,
|
|
389
|
+
interests: ['cars']
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
expect(getConfig('ortb2')).to.deep.equal(expected);
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
it('input should take precedence over existing config if keys are the same', function() {
|
|
398
|
+
const input = {
|
|
399
|
+
ortb2: {
|
|
400
|
+
user: {
|
|
401
|
+
ext: {
|
|
402
|
+
data: {
|
|
403
|
+
registered: true,
|
|
404
|
+
interests: ['cars']
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
setConfig({ ortb2: {
|
|
411
|
+
user: {
|
|
412
|
+
ext: {
|
|
413
|
+
data: {
|
|
414
|
+
registered: false
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}});
|
|
419
|
+
mergeConfig(input);
|
|
420
|
+
const expected = {
|
|
421
|
+
user: {
|
|
422
|
+
ext: {
|
|
423
|
+
data: {
|
|
424
|
+
registered: true,
|
|
425
|
+
interests: ['cars']
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
expect(getConfig('ortb2')).to.deep.equal(expected);
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
it('should log error for a non-object value passed in', function () {
|
|
434
|
+
mergeConfig('invalid object');
|
|
435
|
+
expect(logErrorSpy.calledOnce).to.equal(true);
|
|
436
|
+
const error = 'mergeConfig input must be an object';
|
|
437
|
+
assert.ok(logErrorSpy.calledWith(error), 'expected error was logged');
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
it('should merge input with existing bidder config', function () {
|
|
441
|
+
const input = {
|
|
442
|
+
bidders: ['rubicon', 'appnexus'],
|
|
443
|
+
config: {
|
|
444
|
+
ortb2: {
|
|
445
|
+
site: {
|
|
446
|
+
name: 'example',
|
|
447
|
+
domain: 'page.example.com',
|
|
448
|
+
cat: ['IAB2'],
|
|
449
|
+
sectioncat: ['IAB2-2'],
|
|
450
|
+
pagecat: ['IAB2-2']
|
|
451
|
+
},
|
|
452
|
+
user: {
|
|
453
|
+
ext: {
|
|
454
|
+
ssp: 'magnite',
|
|
455
|
+
data: {
|
|
456
|
+
registered: false,
|
|
457
|
+
interests: ['sports']
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
setBidderConfig({
|
|
465
|
+
bidders: ['rubicon'],
|
|
466
|
+
config: {
|
|
467
|
+
ortb2: {
|
|
468
|
+
user: {
|
|
469
|
+
ext: {
|
|
470
|
+
data: {
|
|
471
|
+
registered: true,
|
|
472
|
+
interests: ['cars']
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
mergeBidderConfig(input);
|
|
480
|
+
const expected = {
|
|
481
|
+
rubicon: {
|
|
482
|
+
ortb2: {
|
|
483
|
+
site: {
|
|
484
|
+
name: 'example',
|
|
485
|
+
domain: 'page.example.com',
|
|
486
|
+
cat: ['IAB2'],
|
|
487
|
+
sectioncat: ['IAB2-2'],
|
|
488
|
+
pagecat: ['IAB2-2']
|
|
489
|
+
},
|
|
490
|
+
user: {
|
|
491
|
+
ext: {
|
|
492
|
+
ssp: 'magnite',
|
|
493
|
+
data: {
|
|
494
|
+
registered: false,
|
|
495
|
+
interests: ['cars', 'sports']
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
appnexus: {
|
|
502
|
+
ortb2: {
|
|
503
|
+
site: {
|
|
504
|
+
name: 'example',
|
|
505
|
+
domain: 'page.example.com',
|
|
506
|
+
cat: ['IAB2'],
|
|
507
|
+
sectioncat: ['IAB2-2'],
|
|
508
|
+
pagecat: ['IAB2-2']
|
|
509
|
+
},
|
|
510
|
+
user: {
|
|
511
|
+
ext: {
|
|
512
|
+
ssp: 'magnite',
|
|
513
|
+
data: {
|
|
514
|
+
registered: false,
|
|
515
|
+
interests: ['sports']
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
expect(getBidderConfig()).to.deep.equal(expected);
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
it('should log error for a non-object value passed in', function () {
|
|
526
|
+
mergeBidderConfig('invalid object');
|
|
527
|
+
expect(logErrorSpy.calledOnce).to.equal(true);
|
|
528
|
+
const error = 'setBidderConfig bidder options must be an object';
|
|
529
|
+
assert.ok(logErrorSpy.calledWith(error), 'expected error was logged');
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
it('should log error for empty bidders array', function () {
|
|
533
|
+
mergeBidderConfig({
|
|
534
|
+
bidders: [],
|
|
535
|
+
config: {
|
|
536
|
+
ortb2: {
|
|
537
|
+
site: {
|
|
538
|
+
name: 'example',
|
|
539
|
+
domain: 'page.example.com',
|
|
540
|
+
cat: ['IAB2'],
|
|
541
|
+
sectioncat: ['IAB2-2'],
|
|
542
|
+
pagecat: ['IAB2-2']
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
expect(logErrorSpy.calledOnce).to.equal(true);
|
|
548
|
+
const error = 'setBidderConfig bidder options must contain a bidders list with at least 1 bidder';
|
|
549
|
+
assert.ok(logErrorSpy.calledWith(error), 'expected error was logged');
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
it('should log error for nonexistent config object', function () {
|
|
553
|
+
mergeBidderConfig({
|
|
554
|
+
bidders: ['appnexus']
|
|
555
|
+
});
|
|
556
|
+
expect(logErrorSpy.calledOnce).to.equal(true);
|
|
557
|
+
const error = 'setBidderConfig bidder options must contain a config object';
|
|
558
|
+
assert.ok(logErrorSpy.calledWith(error), 'expected error was logged');
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
it('should merge without array duplication', function() {
|
|
562
|
+
const userObj1 = {
|
|
563
|
+
name: 'www.dataprovider1.com',
|
|
564
|
+
ext: { taxonomyname: 'iab_audience_taxonomy' },
|
|
565
|
+
segment: [{
|
|
566
|
+
id: '1776'
|
|
567
|
+
}]
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
const userObj2 = {
|
|
571
|
+
name: 'www.dataprovider2.com',
|
|
572
|
+
ext: { taxonomyname: 'iab_audience_taxonomy' },
|
|
573
|
+
segment: [{
|
|
574
|
+
id: '1914'
|
|
575
|
+
}]
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
const siteObj1 = {
|
|
579
|
+
name: 'www.dataprovider3.com',
|
|
580
|
+
ext: {
|
|
581
|
+
taxonomyname: 'iab_audience_taxonomy'
|
|
582
|
+
},
|
|
583
|
+
segment: [
|
|
584
|
+
{
|
|
585
|
+
id: '1812'
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
id: '1955'
|
|
589
|
+
}
|
|
590
|
+
]
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
setConfig({
|
|
594
|
+
ortb2: {
|
|
595
|
+
user: {
|
|
596
|
+
data: [userObj1, userObj2]
|
|
597
|
+
},
|
|
598
|
+
site: {
|
|
599
|
+
content: {
|
|
600
|
+
data: [siteObj1]
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
const rtd = {
|
|
607
|
+
ortb2: {
|
|
608
|
+
user: {
|
|
609
|
+
data: [userObj1]
|
|
610
|
+
},
|
|
611
|
+
site: {
|
|
612
|
+
content: {
|
|
613
|
+
data: [siteObj1]
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
};
|
|
618
|
+
mergeConfig(rtd);
|
|
619
|
+
|
|
620
|
+
let ortb2Config = getConfig('ortb2');
|
|
621
|
+
|
|
622
|
+
expect(ortb2Config.user.data).to.deep.include.members([userObj1, userObj2]);
|
|
623
|
+
expect(ortb2Config.site.content.data).to.deep.include.members([siteObj1]);
|
|
624
|
+
expect(ortb2Config.user.data).to.have.lengthOf(2);
|
|
625
|
+
expect(ortb2Config.site.content.data).to.have.lengthOf(1);
|
|
626
|
+
});
|
|
348
627
|
});
|
|
@@ -244,16 +244,6 @@ describe('Adagio bid adapter', () => {
|
|
|
244
244
|
expect(spec.isBidRequestValid(bid03)).to.equal(false);
|
|
245
245
|
expect(spec.isBidRequestValid(bid04)).to.equal(false);
|
|
246
246
|
});
|
|
247
|
-
|
|
248
|
-
it('should return false when refererInfo.reachedTop is false', function() {
|
|
249
|
-
sandbox.spy(utils, 'logWarn');
|
|
250
|
-
sandbox.stub(adagio, 'getRefererInfo').returns({ reachedTop: false });
|
|
251
|
-
const bid = new BidRequestBuilder().withParams().build();
|
|
252
|
-
|
|
253
|
-
expect(spec.isBidRequestValid(bid)).to.equal(false);
|
|
254
|
-
sinon.assert.callCount(utils.logWarn, 1);
|
|
255
|
-
sinon.assert.calledWith(utils.logWarn, 'Adagio: the main page url is unreachabled.');
|
|
256
|
-
});
|
|
257
247
|
});
|
|
258
248
|
|
|
259
249
|
describe('buildRequests()', function() {
|
|
@@ -504,9 +504,11 @@ describe('adbookpsp bid adapter', () => {
|
|
|
504
504
|
ad: '<div>ad</div>',
|
|
505
505
|
adId: '5',
|
|
506
506
|
adserverTargeting: {
|
|
507
|
+
hb_ad_ord_adbookpsp: '0_0', // the value to the left of the underscore represents the index of the ad id and the number to the right represents the order index
|
|
507
508
|
hb_adid_c_adbookpsp: '5',
|
|
508
509
|
hb_deal_adbookpsp: 'werwetwerw',
|
|
509
510
|
hb_liid_adbookpsp: '2342345',
|
|
511
|
+
hb_ordid_adbookpsp: '567843',
|
|
510
512
|
},
|
|
511
513
|
referrer: 'http://prebid-test-page.io:8080/banner.html',
|
|
512
514
|
lineItemId: '2342345',
|
|
@@ -516,9 +518,11 @@ describe('adbookpsp bid adapter', () => {
|
|
|
516
518
|
adId: '10',
|
|
517
519
|
adUnitCode: 'div-gpt-ad-837465923534-0',
|
|
518
520
|
adserverTargeting: {
|
|
521
|
+
hb_ad_ord_adbookpsp: '0_0',
|
|
519
522
|
hb_adid_c_adbookpsp: '10',
|
|
520
523
|
hb_deal_adbookpsp: 'dsfxcxcvxc',
|
|
521
524
|
hb_liid_adbookpsp: '2121221',
|
|
525
|
+
hb_ordid_adbookpsp: '5678234',
|
|
522
526
|
},
|
|
523
527
|
bidId: 'bid4321',
|
|
524
528
|
bidderRequestId: '999ccceeee11',
|
|
@@ -556,14 +560,18 @@ describe('adbookpsp bid adapter', () => {
|
|
|
556
560
|
|
|
557
561
|
expect(bids).to.have.length(2);
|
|
558
562
|
expect(bids[0].adserverTargeting).to.deep.equal({
|
|
563
|
+
hb_ad_ord_adbookpsp: '0_0',
|
|
564
|
+
hb_adid_c_adbookpsp: '5',
|
|
559
565
|
hb_deal_adbookpsp: 'werwetwerw',
|
|
560
566
|
hb_liid_adbookpsp: '2342345',
|
|
561
|
-
|
|
567
|
+
hb_ordid_adbookpsp: '567843',
|
|
562
568
|
});
|
|
563
569
|
expect(bids[1].adserverTargeting).to.deep.equal({
|
|
570
|
+
hb_ad_ord_adbookpsp: '0_0',
|
|
571
|
+
hb_adid_c_adbookpsp: '10',
|
|
564
572
|
hb_deal_adbookpsp: 'dsfxcxcvxc',
|
|
565
573
|
hb_liid_adbookpsp: '2121221',
|
|
566
|
-
|
|
574
|
+
hb_ordid_adbookpsp: '5678234',
|
|
567
575
|
});
|
|
568
576
|
});
|
|
569
577
|
|
|
@@ -580,9 +588,11 @@ describe('adbookpsp bid adapter', () => {
|
|
|
580
588
|
expect(bids).to.have.length(2);
|
|
581
589
|
for (const bid of bids) {
|
|
582
590
|
expect(bid.adserverTargeting).to.deep.equal({
|
|
591
|
+
hb_ad_ord_adbookpsp: '0_0,1_0',
|
|
592
|
+
hb_adid_c_adbookpsp: '5,10',
|
|
583
593
|
hb_deal_adbookpsp: 'werwetwerw,dsfxcxcvxc',
|
|
584
594
|
hb_liid_adbookpsp: '2342345,2121221',
|
|
585
|
-
|
|
595
|
+
hb_ordid_adbookpsp: '567843,5678234',
|
|
586
596
|
});
|
|
587
597
|
}
|
|
588
598
|
});
|
|
@@ -670,9 +680,11 @@ describe('adbookpsp bid adapter', () => {
|
|
|
670
680
|
);
|
|
671
681
|
|
|
672
682
|
expect(bids[0].adserverTargeting).to.deep.equal({
|
|
683
|
+
hb_ad_ord_adbookpsp: '0_0',
|
|
673
684
|
hb_adid_c_adbookpsp: '10',
|
|
674
685
|
hb_deal_adbookpsp: 'dsfxcxcvxc',
|
|
675
686
|
hb_liid_adbookpsp: '2121221',
|
|
687
|
+
hb_ordid_adbookpsp: '5678234',
|
|
676
688
|
});
|
|
677
689
|
});
|
|
678
690
|
|
|
@@ -1279,6 +1291,7 @@ const exchangeResponse = {
|
|
|
1279
1291
|
nurl: 'http://win.example.url',
|
|
1280
1292
|
ext: {
|
|
1281
1293
|
liid: '2342345',
|
|
1294
|
+
ordid: '567843',
|
|
1282
1295
|
},
|
|
1283
1296
|
cat: ['IAB2-1', 'IAB2-2', 'IAB2-3'],
|
|
1284
1297
|
adomain: ['advertiser.com'],
|
|
@@ -1301,6 +1314,7 @@ const exchangeResponse = {
|
|
|
1301
1314
|
nurl: 'http://win.example.url',
|
|
1302
1315
|
ext: {
|
|
1303
1316
|
liid: '2121221',
|
|
1317
|
+
ordid: '5678234',
|
|
1304
1318
|
},
|
|
1305
1319
|
cat: ['IAB2-3'],
|
|
1306
1320
|
adomain: ['advertiser.com', 'campaign.advertiser.com'],
|
|
@@ -77,7 +77,7 @@ describe('adhashBidAdapter', function () {
|
|
|
77
77
|
);
|
|
78
78
|
expect(result.length).to.equal(1);
|
|
79
79
|
expect(result[0].method).to.equal('POST');
|
|
80
|
-
expect(result[0].url).to.equal('https://bidder.adhash.
|
|
80
|
+
expect(result[0].url).to.equal('https://bidder.adhash.com/rtb?version=1.0&prebid=true&publisher=0xc3b09b27e9c6ef73957901aa729b9e69e5bbfbfb');
|
|
81
81
|
expect(result[0].bidRequest).to.equal(bidRequest);
|
|
82
82
|
expect(result[0].data).to.have.property('timezone');
|
|
83
83
|
expect(result[0].data).to.have.property('location');
|
|
@@ -93,7 +93,7 @@ describe('adhashBidAdapter', function () {
|
|
|
93
93
|
const result = spec.buildRequests([ bidRequest ], { gdprConsent: true });
|
|
94
94
|
expect(result.length).to.equal(1);
|
|
95
95
|
expect(result[0].method).to.equal('POST');
|
|
96
|
-
expect(result[0].url).to.equal('https://bidder.adhash.
|
|
96
|
+
expect(result[0].url).to.equal('https://bidder.adhash.com/rtb?version=1.0&prebid=true&publisher=0xc3b09b27e9c6ef73957901aa729b9e69e5bbfbfb');
|
|
97
97
|
expect(result[0].bidRequest).to.equal(bidRequest);
|
|
98
98
|
expect(result[0].data).to.have.property('timezone');
|
|
99
99
|
expect(result[0].data).to.have.property('location');
|
|
@@ -175,13 +175,13 @@ describe('AdmanAdapter', function () {
|
|
|
175
175
|
});
|
|
176
176
|
|
|
177
177
|
describe('getUserSyncs', function () {
|
|
178
|
-
let userSync = spec.getUserSyncs();
|
|
178
|
+
let userSync = spec.getUserSyncs({});
|
|
179
179
|
it('Returns valid URL and type', function () {
|
|
180
180
|
expect(userSync).to.be.an('array').with.lengthOf(1);
|
|
181
181
|
expect(userSync[0].type).to.exist;
|
|
182
182
|
expect(userSync[0].url).to.exist;
|
|
183
183
|
expect(userSync[0].type).to.be.equal('image');
|
|
184
|
-
expect(userSync[0].url).to.be.equal('https://pub.admanmedia.com
|
|
184
|
+
expect(userSync[0].url).to.be.equal('https://pub.admanmedia.com/image?pbjs=1&coppa=0');
|
|
185
185
|
});
|
|
186
186
|
});
|
|
187
187
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import adomikAnalytics from 'modules/adomikAnalyticsAdapter.js';
|
|
2
|
-
import {expect} from 'chai';
|
|
2
|
+
import { expect } from 'chai';
|
|
3
3
|
|
|
4
4
|
let events = require('src/events');
|
|
5
5
|
let adapterManager = require('src/adapterManager').default;
|
|
@@ -73,6 +73,7 @@ describe('Adomik Prebid Analytic', function () {
|
|
|
73
73
|
expect(adomikAnalytics.currentContext).to.deep.equal({
|
|
74
74
|
uid: '123456',
|
|
75
75
|
url: 'testurl',
|
|
76
|
+
sampling: undefined,
|
|
76
77
|
testId: '12345',
|
|
77
78
|
testValue: '1000',
|
|
78
79
|
id: '',
|
|
@@ -85,6 +86,7 @@ describe('Adomik Prebid Analytic', function () {
|
|
|
85
86
|
expect(adomikAnalytics.currentContext).to.deep.equal({
|
|
86
87
|
uid: '123456',
|
|
87
88
|
url: 'testurl',
|
|
89
|
+
sampling: undefined,
|
|
88
90
|
testId: '12345',
|
|
89
91
|
testValue: '1000',
|
|
90
92
|
id: 'test-test-test',
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { adqueryIdSubmodule, storage } from 'modules/adqueryIdSystem.js';
|
|
2
|
+
import { server } from 'test/mocks/xhr.js';
|
|
3
|
+
import {amxIdSubmodule} from '../../../modules/amxIdSystem';
|
|
4
|
+
import * as utils from '../../../src/utils';
|
|
5
|
+
|
|
6
|
+
const config = {
|
|
7
|
+
storage: {
|
|
8
|
+
type: 'html5',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
describe('AdqueryIdSystem', function () {
|
|
13
|
+
describe('qid submodule', () => {
|
|
14
|
+
it('should expose a "name" property containing qid', () => {
|
|
15
|
+
expect(adqueryIdSubmodule.name).to.equal('qid');
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should expose a "gvlid" property containing the GVL ID 902', () => {
|
|
19
|
+
expect(adqueryIdSubmodule.gvlid).to.equal(902);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe('getId', function() {
|
|
24
|
+
let getDataFromLocalStorageStub;
|
|
25
|
+
|
|
26
|
+
beforeEach(function() {
|
|
27
|
+
getDataFromLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
afterEach(function () {
|
|
31
|
+
getDataFromLocalStorageStub.restore();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('gets a adqueryId', function() {
|
|
35
|
+
const config = {
|
|
36
|
+
params: {}
|
|
37
|
+
};
|
|
38
|
+
const callbackSpy = sinon.spy();
|
|
39
|
+
const callback = adqueryIdSubmodule.getId(config).callback;
|
|
40
|
+
callback(callbackSpy);
|
|
41
|
+
const request = server.requests[0];
|
|
42
|
+
expect(request.url).to.eq(`https://bidder.adquery.io/prebid/qid`);
|
|
43
|
+
request.respond(200, { 'Content-Type': 'application/json' }, JSON.stringify({ qid: 'qid' }));
|
|
44
|
+
expect(callbackSpy.lastCall.lastArg).to.deep.equal({qid: 'qid'});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('gets a cached adqueryId', function() {
|
|
48
|
+
const config = {
|
|
49
|
+
params: {}
|
|
50
|
+
};
|
|
51
|
+
getDataFromLocalStorageStub.withArgs('qid').returns('qid');
|
|
52
|
+
|
|
53
|
+
const callbackSpy = sinon.spy();
|
|
54
|
+
const callback = adqueryIdSubmodule.getId(config).callback;
|
|
55
|
+
callback(callbackSpy);
|
|
56
|
+
expect(callbackSpy.lastCall.lastArg).to.deep.equal({qid: 'qid'});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('allows configurable id url', function() {
|
|
60
|
+
const config = {
|
|
61
|
+
params: {
|
|
62
|
+
url: 'https://bidder.adquery.io'
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const callbackSpy = sinon.spy();
|
|
66
|
+
const callback = adqueryIdSubmodule.getId(config).callback;
|
|
67
|
+
callback(callbackSpy);
|
|
68
|
+
const request = server.requests[0];
|
|
69
|
+
expect(request.url).to.eq('https://bidder.adquery.io');
|
|
70
|
+
request.respond(200, { 'Content-Type': 'application/json' }, JSON.stringify({ qid: 'testqid' }));
|
|
71
|
+
expect(callbackSpy.lastCall.lastArg).to.deep.equal({qid: 'testqid'});
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -95,6 +95,40 @@ describe('Adyoulike Adapter', function () {
|
|
|
95
95
|
}
|
|
96
96
|
];
|
|
97
97
|
|
|
98
|
+
const bidRequestWithMultipleMediatype = [
|
|
99
|
+
{
|
|
100
|
+
'bidId': 'bid_id_0',
|
|
101
|
+
'bidder': 'adyoulike',
|
|
102
|
+
'placementCode': 'adunit/hb-0',
|
|
103
|
+
'params': {
|
|
104
|
+
'placement': 'placement_0'
|
|
105
|
+
},
|
|
106
|
+
'sizes': '300x250',
|
|
107
|
+
'mediaTypes': {
|
|
108
|
+
'banner': {
|
|
109
|
+
'sizes': ['640x480']
|
|
110
|
+
},
|
|
111
|
+
'video': {
|
|
112
|
+
'playerSize': [640, 480],
|
|
113
|
+
'context': 'outstream'
|
|
114
|
+
},
|
|
115
|
+
'native': {
|
|
116
|
+
'image': {
|
|
117
|
+
'required': true,
|
|
118
|
+
},
|
|
119
|
+
'title': {
|
|
120
|
+
'required': true,
|
|
121
|
+
'len': 80
|
|
122
|
+
},
|
|
123
|
+
'cta': {
|
|
124
|
+
'required': false
|
|
125
|
+
},
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
'transactionId': 'bid_id_0_transaction_id'
|
|
129
|
+
}
|
|
130
|
+
];
|
|
131
|
+
|
|
98
132
|
const bidRequestWithNativeImageType = [
|
|
99
133
|
{
|
|
100
134
|
'bidId': 'bid_id_0',
|
|
@@ -647,6 +681,21 @@ describe('Adyoulike Adapter', function () {
|
|
|
647
681
|
expect(payload.Bids['bid_id_0'].TransactionID).to.be.equal('bid_id_0_transaction_id');
|
|
648
682
|
});
|
|
649
683
|
|
|
684
|
+
it('sends bid request to endpoint with single placement multiple mediatype', function () {
|
|
685
|
+
canonicalQuery.restore();
|
|
686
|
+
const request = spec.buildRequests(bidRequestWithMultipleMediatype, bidderRequest);
|
|
687
|
+
const payload = JSON.parse(request.data);
|
|
688
|
+
|
|
689
|
+
expect(request.url).to.contain(getEndpoint());
|
|
690
|
+
expect(request.method).to.equal('POST');
|
|
691
|
+
|
|
692
|
+
expect(request.url).to.not.contains('CanonicalUrl=' + encodeURIComponent(canonicalUrl));
|
|
693
|
+
expect(payload.Version).to.equal('1.0');
|
|
694
|
+
expect(payload.Bids['bid_id_0'].PlacementID).to.be.equal('placement_0');
|
|
695
|
+
expect(payload.PageRefreshed).to.equal(false);
|
|
696
|
+
expect(payload.Bids['bid_id_0'].TransactionID).to.be.equal('bid_id_0_transaction_id');
|
|
697
|
+
});
|
|
698
|
+
|
|
650
699
|
it('sends bid request to endpoint with multiple placements', function () {
|
|
651
700
|
const request = spec.buildRequests(bidRequestMultiPlacements, bidderRequest);
|
|
652
701
|
const payload = JSON.parse(request.data);
|
|
@@ -556,6 +556,33 @@ describe('AppNexusAdapter', function () {
|
|
|
556
556
|
config.getConfig.restore();
|
|
557
557
|
});
|
|
558
558
|
|
|
559
|
+
it('adds auction level keywords to request when set', function() {
|
|
560
|
+
let bidRequest = Object.assign({}, bidRequests[0]);
|
|
561
|
+
sinon
|
|
562
|
+
.stub(config, 'getConfig')
|
|
563
|
+
.withArgs('appnexusAuctionKeywords')
|
|
564
|
+
.returns({
|
|
565
|
+
gender: 'm',
|
|
566
|
+
music: ['rock', 'pop'],
|
|
567
|
+
test: ''
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
const request = spec.buildRequests([bidRequest]);
|
|
571
|
+
const payload = JSON.parse(request.data);
|
|
572
|
+
|
|
573
|
+
expect(payload.keywords).to.deep.equal([{
|
|
574
|
+
'key': 'gender',
|
|
575
|
+
'value': ['m']
|
|
576
|
+
}, {
|
|
577
|
+
'key': 'music',
|
|
578
|
+
'value': ['rock', 'pop']
|
|
579
|
+
}, {
|
|
580
|
+
'key': 'test'
|
|
581
|
+
}]);
|
|
582
|
+
|
|
583
|
+
config.getConfig.restore();
|
|
584
|
+
});
|
|
585
|
+
|
|
559
586
|
it('should attach native params to the request', function () {
|
|
560
587
|
let bidRequest = Object.assign({},
|
|
561
588
|
bidRequests[0],
|