prebid.js 5.18.0 → 6.1.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 +3 -1
- package/browsers.json +1 -8
- package/gulpfile.js +1 -0
- package/integrationExamples/gpt/akamaidap_segments_example.html +132 -0
- package/modules/.submodules.json +1 -0
- package/modules/adfBidAdapter.js +21 -16
- package/modules/adheseBidAdapter.js +7 -2
- package/modules/adkernelBidAdapter.js +1 -0
- package/modules/adlivetechBidAdapter.md +61 -0
- package/modules/adomikAnalyticsAdapter.js +10 -4
- package/modules/adtelligentBidAdapter.js +2 -1
- package/modules/airgridRtdProvider.js +1 -1
- package/modules/akamaiDapRtdProvider.js +474 -0
- package/modules/akamaiDapRtdProvider.md +47 -0
- package/modules/appnexusBidAdapter.js +9 -3
- package/modules/atsAnalyticsAdapter.js +67 -46
- package/modules/atsAnalyticsAdapter.md +1 -0
- package/modules/betweenBidAdapter.js +20 -3
- package/modules/browsiRtdProvider.js +106 -18
- package/modules/cleanioRtdProvider.js +192 -0
- package/modules/cleanioRtdProvider.md +59 -0
- package/modules/codefuelBidAdapter.js +181 -0
- package/modules/codefuelBidAdapter.md +111 -0
- package/modules/connectIdSystem.js +104 -0
- package/modules/connectIdSystem.md +33 -0
- package/modules/datablocksBidAdapter.js +3 -3
- package/modules/deepintentBidAdapter.js +107 -10
- package/modules/deepintentBidAdapter.md +36 -1
- package/modules/deltaprojectsBidAdapter.js +252 -0
- package/modules/deltaprojectsBidAdapter.md +32 -0
- package/modules/engageyaBidAdapter.js +171 -0
- package/modules/glimpseBidAdapter.js +31 -16
- package/modules/gptPreAuction.js +11 -5
- package/modules/gridBidAdapter.js +1 -0
- package/modules/gumgumBidAdapter.js +8 -0
- package/modules/id5IdSystem.md +6 -6
- package/modules/imRtdProvider.js +31 -0
- package/modules/inskinBidAdapter.js +7 -3
- package/modules/ixBidAdapter.js +174 -22
- package/modules/jixieBidAdapter.js +8 -2
- package/modules/justpremiumBidAdapter.js +6 -1
- package/modules/limelightDigitalBidAdapter.js +22 -2
- package/modules/livewrappedAnalyticsAdapter.js +49 -1
- package/modules/merkleIdSystem.js +5 -0
- package/modules/multibid/index.js +3 -3
- package/modules/nativoBidAdapter.js +32 -2
- package/modules/nextMillenniumBidAdapter.js +12 -3
- package/modules/oguryBidAdapter.js +16 -2
- package/modules/openxBidAdapter.js +40 -23
- 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/publinkIdSystem.js +11 -6
- package/modules/pubmaticBidAdapter.js +2 -0
- 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 +6 -1
- package/modules/sonobiBidAdapter.js +7 -0
- package/modules/sortableBidAdapter.js +1 -0
- package/modules/sspBCBidAdapter.js +34 -3
- package/modules/teadsBidAdapter.js +3 -0
- package/modules/tripleliftBidAdapter.js +22 -5
- package/modules/trustxBidAdapter.js +18 -7
- package/modules/undertoneBidAdapter.js +9 -5
- package/modules/undertoneBidAdapter.md +5 -1
- package/modules/userId/eids.js +18 -0
- package/modules/userId/eids.md +7 -0
- package/modules/userId/userId.md +12 -0
- package/modules/ventesBidAdapter.js +370 -0
- package/modules/ventesBidAdapter.md +94 -0
- package/modules/videobyteBidAdapter.js +13 -6
- package/modules/videobyteBidAdapter.md +49 -0
- package/modules/vidoomyBidAdapter.js +51 -100
- package/modules/visxBidAdapter.js +1 -1
- package/modules/yahoosspBidAdapter.js +6 -6
- package/modules/yieldlabBidAdapter.js +41 -10
- package/modules/yieldlabBidAdapter.md +91 -48
- package/modules/yieldmoSyntheticInventoryModule.js +46 -0
- package/modules/yieldmoSyntheticInventoryModule.md +68 -0
- package/package.json +6 -1
- package/src/adapterManager.js +19 -8
- package/src/adapters/bidderFactory.js +4 -3
- package/src/auction.js +11 -11
- package/src/constants.json +1 -0
- package/src/secureCreatives.js +6 -7
- package/src/targeting.js +11 -9
- package/test/spec/modules/adfBidAdapter_spec.js +83 -29
- package/test/spec/modules/adheseBidAdapter_spec.js +27 -1
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +3 -1
- package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
- package/test/spec/modules/akamaiDapRtdProvider_spec.js +246 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +16 -1
- package/test/spec/modules/atsAnalyticsAdapter_spec.js +42 -9
- package/test/spec/modules/betweenBidAdapter_spec.js +41 -0
- 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 +316 -0
- package/test/spec/modules/connectIdSystem_spec.js +189 -0
- package/test/spec/modules/datablocksBidAdapter_spec.js +3 -3
- package/test/spec/modules/deepintentBidAdapter_spec.js +153 -3
- package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
- package/test/spec/modules/engageyaBidAdapter_spec.js +422 -0
- package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
- package/test/spec/modules/glimpseBidAdapter_spec.js +33 -0
- package/test/spec/modules/gptPreAuction_spec.js +58 -4
- package/test/spec/modules/gumgumBidAdapter_spec.js +5 -1
- package/test/spec/modules/imRtdProvider_spec.js +25 -0
- package/test/spec/modules/ixBidAdapter_spec.js +298 -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 +155 -1
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +52 -7
- package/test/spec/modules/merkleIdSystem_spec.js +18 -0
- package/test/spec/modules/multibid_spec.js +31 -31
- package/test/spec/modules/nativoBidAdapter_spec.js +35 -18
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +13 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +66 -23
- package/test/spec/modules/openxBidAdapter_spec.js +90 -13
- 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/publinkIdSystem_spec.js +6 -6
- package/test/spec/modules/seedtagBidAdapter_spec.js +3 -0
- package/test/spec/modules/smaatoBidAdapter_spec.js +30 -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/teadsBidAdapter_spec.js +132 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +128 -0
- package/test/spec/modules/trustxBidAdapter_spec.js +45 -3
- package/test/spec/modules/undertoneBidAdapter_spec.js +52 -0
- package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
- package/test/spec/modules/videobyteBidAdapter_spec.js +2 -2
- package/test/spec/modules/vidoomyBidAdapter_spec.js +32 -13
- package/test/spec/modules/visxBidAdapter_spec.js +1 -1
- package/test/spec/modules/yieldlabBidAdapter_spec.js +81 -0
- package/test/spec/modules/yieldmoSyntheticInventoryModule_spec.js +89 -0
- package/test/spec/unit/core/adapterManager_spec.js +56 -6
- package/test/spec/unit/core/bidderFactory_spec.js +61 -1
- package/test/spec/unit/pbjs_api_spec.js +37 -2
- package/test/spec/unit/secureCreatives_spec.js +54 -25
- package/wdio.conf.js +1 -1
|
@@ -2,6 +2,7 @@ import {expect} from 'chai';
|
|
|
2
2
|
import {spec} from 'modules/outbrainBidAdapter.js';
|
|
3
3
|
import {config} from 'src/config.js';
|
|
4
4
|
import {server} from 'test/mocks/xhr';
|
|
5
|
+
import { createEidsArray } from 'modules/userId/eids.js';
|
|
5
6
|
|
|
6
7
|
describe('Outbrain Adapter', function () {
|
|
7
8
|
describe('Bid request and response', function () {
|
|
@@ -344,6 +345,23 @@ describe('Outbrain Adapter', function () {
|
|
|
344
345
|
|
|
345
346
|
config.resetConfig()
|
|
346
347
|
});
|
|
348
|
+
|
|
349
|
+
it('should pass extended ids', function () {
|
|
350
|
+
let bidRequest = {
|
|
351
|
+
bidId: 'bidId',
|
|
352
|
+
params: {},
|
|
353
|
+
userIdAsEids: createEidsArray({
|
|
354
|
+
idl_env: 'id-value',
|
|
355
|
+
}),
|
|
356
|
+
...commonBidRequest,
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
let res = spec.buildRequests([bidRequest], commonBidderRequest);
|
|
360
|
+
const resData = JSON.parse(res.data)
|
|
361
|
+
expect(resData.user.ext.eids).to.deep.equal([
|
|
362
|
+
{source: 'liveramp.com', uids: [{id: 'id-value', atype: 3}]}
|
|
363
|
+
]);
|
|
364
|
+
});
|
|
347
365
|
})
|
|
348
366
|
|
|
349
367
|
describe('interpretResponse', function () {
|
|
@@ -507,6 +507,17 @@ describe('S2S Adapter', function () {
|
|
|
507
507
|
resetSyncedStatus();
|
|
508
508
|
});
|
|
509
509
|
|
|
510
|
+
it('should set id to auction ID and source.tid to tid', function () {
|
|
511
|
+
config.setConfig({ s2sConfig: CONFIG });
|
|
512
|
+
|
|
513
|
+
adapter.callBids(OUTSTREAM_VIDEO_REQUEST, BID_REQUESTS, addBidResponse, done, ajax);
|
|
514
|
+
|
|
515
|
+
const requestBid = JSON.parse(server.requests[0].requestBody);
|
|
516
|
+
expect(requestBid.id).to.equal('173afb6d132ba3');
|
|
517
|
+
expect(requestBid.source).to.be.an('object');
|
|
518
|
+
expect(requestBid.source.tid).to.equal('437fbbf5-33f5-487a-8e16-a7112903cfe5');
|
|
519
|
+
});
|
|
520
|
+
|
|
510
521
|
it('should block request if config did not define p1Consent URL in endpoint object config', function() {
|
|
511
522
|
let badConfig = utils.deepClone(CONFIG);
|
|
512
523
|
badConfig.endpoint = { noP1Consent: 'https://prebid.adnxs.com/pbs/v1/openrtb2/auction' };
|
|
@@ -1705,7 +1716,7 @@ describe('S2S Adapter', function () {
|
|
|
1705
1716
|
expect(parsedRequestBody.ext.prebid.channel).to.deep.equal({name: 'pbjs', version: 'v$prebid.version$'});
|
|
1706
1717
|
});
|
|
1707
1718
|
|
|
1708
|
-
it('
|
|
1719
|
+
it('extPrebid is now mergedDeep -> should include default channel as well', () => {
|
|
1709
1720
|
const s2sBidRequest = utils.deepClone(REQUEST);
|
|
1710
1721
|
const bidRequests = utils.deepClone(BID_REQUESTS);
|
|
1711
1722
|
|
|
@@ -1714,7 +1725,13 @@ describe('S2S Adapter', function () {
|
|
|
1714
1725
|
adapter.callBids(s2sBidRequest, bidRequests, addBidResponse, done, ajax);
|
|
1715
1726
|
|
|
1716
1727
|
const parsedRequestBody = JSON.parse(server.requests[0].requestBody);
|
|
1717
|
-
|
|
1728
|
+
|
|
1729
|
+
// extPrebid is now deep merged with
|
|
1730
|
+
expect(parsedRequestBody.ext.prebid.channel).to.deep.equal({
|
|
1731
|
+
name: 'pbjs',
|
|
1732
|
+
test: 1,
|
|
1733
|
+
version: 'v$prebid.version$'
|
|
1734
|
+
});
|
|
1718
1735
|
});
|
|
1719
1736
|
|
|
1720
1737
|
it('passes first party data in request', () => {
|
|
@@ -47,12 +47,6 @@ describe('PublinkIdSystem', () => {
|
|
|
47
47
|
expect(result.id).to.equal(LOCAL_VALUE.publink);
|
|
48
48
|
storage.removeDataFromLocalStorage(PUBLINK_COOKIE);
|
|
49
49
|
});
|
|
50
|
-
it('ignore expired cookie', () => {
|
|
51
|
-
storage.setDataInLocalStorage(PUBLINK_COOKIE, JSON.stringify({publink: 'value', exp: Date.now() - 60 * 60 * 24 * 1000}));
|
|
52
|
-
const result = publinkIdSubmodule.getId();
|
|
53
|
-
expect(result.id).to.be.undefined;
|
|
54
|
-
storage.removeDataFromLocalStorage(PUBLINK_COOKIE);
|
|
55
|
-
});
|
|
56
50
|
it('priority goes to publink_srv cookie', () => {
|
|
57
51
|
storage.setCookie(PUBLINK_SRV_COOKIE, JSON.stringify(COOKIE_VALUE), COOKIE_EXPIRATION);
|
|
58
52
|
storage.setDataInLocalStorage(PUBLINK_COOKIE, JSON.stringify(LOCAL_VALUE));
|
|
@@ -61,6 +55,12 @@ describe('PublinkIdSystem', () => {
|
|
|
61
55
|
storage.setCookie(PUBLINK_SRV_COOKIE, '', DELETE_COOKIE);
|
|
62
56
|
storage.removeDataFromLocalStorage(PUBLINK_COOKIE);
|
|
63
57
|
});
|
|
58
|
+
it('publink non-json cookie', () => {
|
|
59
|
+
storage.setCookie(PUBLINK_COOKIE, COOKIE_VALUE.publink, COOKIE_EXPIRATION);
|
|
60
|
+
const result = publinkIdSubmodule.getId();
|
|
61
|
+
expect(result.id).to.equal(COOKIE_VALUE.publink);
|
|
62
|
+
storage.setCookie(PUBLINK_COOKIE, '', DELETE_COOKIE);
|
|
63
|
+
});
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
describe('getId', () => {
|
|
@@ -287,6 +287,13 @@ describe('smaatoBidAdapterTest', () => {
|
|
|
287
287
|
expect(req.regs.ext.us_privacy).to.equal('uspConsentString');
|
|
288
288
|
});
|
|
289
289
|
|
|
290
|
+
it('sends no schain if no schain exists', () => {
|
|
291
|
+
const reqs = spec.buildRequests([singleBannerBidRequest], defaultBidderRequest);
|
|
292
|
+
|
|
293
|
+
const req = extractPayloadOfFirstAndOnlyRequest(reqs);
|
|
294
|
+
expect(req.source.ext.schain).to.not.exist;
|
|
295
|
+
});
|
|
296
|
+
|
|
290
297
|
it('sends tmax', () => {
|
|
291
298
|
const reqs = spec.buildRequests([singleBannerBidRequest], defaultBidderRequest);
|
|
292
299
|
|
|
@@ -854,6 +861,29 @@ describe('smaatoBidAdapterTest', () => {
|
|
|
854
861
|
expect(req.user.ext.eids).to.have.length(2);
|
|
855
862
|
});
|
|
856
863
|
});
|
|
864
|
+
|
|
865
|
+
describe('schain in request', () => {
|
|
866
|
+
it('schain is added to source.ext.schain', () => {
|
|
867
|
+
const schain = {
|
|
868
|
+
ver: '1.0',
|
|
869
|
+
complete: 1,
|
|
870
|
+
nodes: [
|
|
871
|
+
{
|
|
872
|
+
'asi': 'asi',
|
|
873
|
+
'sid': 'sid',
|
|
874
|
+
'rid': 'rid',
|
|
875
|
+
'hp': 1
|
|
876
|
+
}
|
|
877
|
+
]
|
|
878
|
+
};
|
|
879
|
+
const bidRequestWithSchain = Object.assign({}, singleBannerBidRequest, {schain: schain});
|
|
880
|
+
|
|
881
|
+
const reqs = spec.buildRequests([bidRequestWithSchain], defaultBidderRequest);
|
|
882
|
+
|
|
883
|
+
const req = extractPayloadOfFirstAndOnlyRequest(reqs);
|
|
884
|
+
expect(req.source.ext.schain).to.deep.equal(schain);
|
|
885
|
+
});
|
|
886
|
+
});
|
|
857
887
|
});
|
|
858
888
|
|
|
859
889
|
describe('interpretResponse', () => {
|
|
@@ -238,14 +238,17 @@ describe('SonobiBidAdapter', function () {
|
|
|
238
238
|
});
|
|
239
239
|
|
|
240
240
|
describe('.buildRequests', function () {
|
|
241
|
+
let sandbox;
|
|
241
242
|
beforeEach(function() {
|
|
242
243
|
sinon.stub(userSync, 'canBidderRegisterSync');
|
|
243
244
|
sinon.stub(utils, 'getGptSlotInfoForAdUnitCode')
|
|
244
|
-
.onFirstCall().returns({gptSlot: '/123123/gpt_publisher/adunit-code-3', divId: 'adunit-code-3-div-id'})
|
|
245
|
+
.onFirstCall().returns({gptSlot: '/123123/gpt_publisher/adunit-code-3', divId: 'adunit-code-3-div-id'});
|
|
246
|
+
sandbox = sinon.createSandbox();
|
|
245
247
|
});
|
|
246
248
|
afterEach(function() {
|
|
247
249
|
userSync.canBidderRegisterSync.restore();
|
|
248
250
|
utils.getGptSlotInfoForAdUnitCode.restore();
|
|
251
|
+
sandbox.restore();
|
|
249
252
|
});
|
|
250
253
|
let bidRequest = [{
|
|
251
254
|
'schain': {
|
|
@@ -333,6 +336,36 @@ describe('SonobiBidAdapter', function () {
|
|
|
333
336
|
uspConsent: 'someCCPAString'
|
|
334
337
|
};
|
|
335
338
|
|
|
339
|
+
it('should set fpd if there is any data in ortb2', function() {
|
|
340
|
+
const ortb2 = {
|
|
341
|
+
site: {
|
|
342
|
+
ext: {
|
|
343
|
+
data: {
|
|
344
|
+
pageType: 'article',
|
|
345
|
+
category: 'tools'
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
user: {
|
|
350
|
+
ext: {
|
|
351
|
+
data: {
|
|
352
|
+
registered: true,
|
|
353
|
+
interests: ['cars']
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
sandbox.stub(config, 'getConfig').callsFake(key => {
|
|
360
|
+
const config = {
|
|
361
|
+
ortb2: ortb2
|
|
362
|
+
};
|
|
363
|
+
return utils.deepAccess(config, key);
|
|
364
|
+
});
|
|
365
|
+
const bidRequests = spec.buildRequests(bidRequest, bidderRequests);
|
|
366
|
+
expect(bidRequests.data.fpd).to.equal(JSON.stringify(ortb2));
|
|
367
|
+
});
|
|
368
|
+
|
|
336
369
|
it('should populate coppa as 1 if set in config', function () {
|
|
337
370
|
config.setConfig({coppa: true});
|
|
338
371
|
const bidRequests = spec.buildRequests(bidRequest, bidderRequests);
|
|
@@ -112,6 +112,13 @@ describe('sortableBidAdapter', function() {
|
|
|
112
112
|
'key2': 'val2'
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
|
+
'ortb2Imp': {
|
|
116
|
+
'ext': {
|
|
117
|
+
'data': {
|
|
118
|
+
'pbadslot': 'abc/123'
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
115
122
|
'sizes': [
|
|
116
123
|
[300, 250]
|
|
117
124
|
],
|
|
@@ -176,6 +183,10 @@ describe('sortableBidAdapter', function() {
|
|
|
176
183
|
expect(requestBody.imp[0].floor).to.equal(0.21);
|
|
177
184
|
});
|
|
178
185
|
|
|
186
|
+
it('includes pbadslot in the bid request', function () {
|
|
187
|
+
expect(requestBody.imp[0].ext.gpid).to.equal('abc/123');
|
|
188
|
+
});
|
|
189
|
+
|
|
179
190
|
it('sets domain and href correctly', function () {
|
|
180
191
|
expect(requestBody.site.domain).to.equal('example.com');
|
|
181
192
|
expect(requestBody.site.page).to.equal('http://example.com/page?param=val');
|
|
@@ -518,6 +518,33 @@ describe('SSPBC adapter', function () {
|
|
|
518
518
|
expect(payload.user).to.be.an('object').and.to.have.property('[ortb_extensions.consent]', bidRequest.gdprConsent.consentString);
|
|
519
519
|
});
|
|
520
520
|
|
|
521
|
+
it('should send net info and pvid', function () {
|
|
522
|
+
expect(payload.user).to.be.an('object').and.to.have.property('data').that.is.an('array');
|
|
523
|
+
|
|
524
|
+
const userData = payload.user.data;
|
|
525
|
+
expect(userData.length).to.equal(2);
|
|
526
|
+
|
|
527
|
+
const netInfo = userData[0];
|
|
528
|
+
expect(netInfo.id).to.equal('12');
|
|
529
|
+
expect(netInfo.name).to.equal('NetInfo');
|
|
530
|
+
expect(netInfo).to.have.property('segment').that.is.an('array');
|
|
531
|
+
|
|
532
|
+
const pvid = userData[1];
|
|
533
|
+
expect(pvid.id).to.equal('7');
|
|
534
|
+
expect(pvid.name).to.equal('pvid');
|
|
535
|
+
expect(pvid).to.have.property('segment').that.is.an('array');
|
|
536
|
+
expect(pvid.segment[0]).to.have.property('value');
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
it('pvid should be constant on a single page view', function () {
|
|
540
|
+
const userData1 = payload.user.data;
|
|
541
|
+
const userData2 = payloadNative.user.data;
|
|
542
|
+
const pvid1 = userData1[1];
|
|
543
|
+
const pvid2 = userData2[1];
|
|
544
|
+
|
|
545
|
+
expect(pvid1.segment[0].value).to.equal(pvid2.segment[0].value);
|
|
546
|
+
});
|
|
547
|
+
|
|
521
548
|
it('should build correct native payload', function () {
|
|
522
549
|
const nativeAssets = payloadNative.imp && payloadNative.imp[0].native.request;
|
|
523
550
|
|
|
@@ -543,13 +570,16 @@ describe('SSPBC adapter', function () {
|
|
|
543
570
|
expect(videoAssets).to.have.property('api').that.is.an('array');
|
|
544
571
|
});
|
|
545
572
|
|
|
546
|
-
it('should create auxilary placement identifier (size_numUsed)', function () {
|
|
573
|
+
it('should create auxilary placement identifier (size_numUsed), that is constant for a given adUnit', function () {
|
|
547
574
|
const extAssets1 = payload.imp && payload.imp[0].ext.data;
|
|
548
575
|
const extAssets2 = payloadSingle.imp && payloadSingle.imp[0].ext.data;
|
|
549
576
|
|
|
550
|
-
|
|
577
|
+
/*
|
|
578
|
+
note that payload comes from first, and payloadSingle from second auction in the test run
|
|
579
|
+
also, since both have same adUnitName, value of pbsize property should be the same
|
|
580
|
+
*/
|
|
551
581
|
expect(extAssets1).to.have.property('pbsize').that.equals('750x200_1')
|
|
552
|
-
expect(extAssets2).to.have.property('pbsize').that.equals('
|
|
582
|
+
expect(extAssets2).to.have.property('pbsize').that.equals('750x200_1')
|
|
553
583
|
});
|
|
554
584
|
});
|
|
555
585
|
|
|
@@ -582,6 +582,138 @@ describe('teadsBidAdapter', () => {
|
|
|
582
582
|
});
|
|
583
583
|
});
|
|
584
584
|
|
|
585
|
+
describe('Global Placement Id', function () {
|
|
586
|
+
let bidRequests = [
|
|
587
|
+
{
|
|
588
|
+
'bidder': 'teads',
|
|
589
|
+
'params': {
|
|
590
|
+
'placementId': 10433394,
|
|
591
|
+
'pageId': 1234
|
|
592
|
+
},
|
|
593
|
+
'adUnitCode': 'adunit-code-1',
|
|
594
|
+
'sizes': [[300, 250], [300, 600]],
|
|
595
|
+
'bidId': '30b31c1838de1e',
|
|
596
|
+
'bidderRequestId': '22edbae2733bf6',
|
|
597
|
+
'auctionId': '1d1a030790a475',
|
|
598
|
+
'creativeId': 'er2ee',
|
|
599
|
+
'deviceWidth': 1680
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
'bidder': 'teads',
|
|
603
|
+
'params': {
|
|
604
|
+
'placementId': 10433395,
|
|
605
|
+
'pageId': 1234
|
|
606
|
+
},
|
|
607
|
+
'adUnitCode': 'adunit-code-2',
|
|
608
|
+
'sizes': [[300, 250], [300, 600]],
|
|
609
|
+
'bidId': '30b31c1838de1f',
|
|
610
|
+
'bidderRequestId': '22edbae2733bf6',
|
|
611
|
+
'auctionId': '1d1a030790a475',
|
|
612
|
+
'creativeId': 'er2ef',
|
|
613
|
+
'deviceWidth': 1680
|
|
614
|
+
}
|
|
615
|
+
];
|
|
616
|
+
|
|
617
|
+
it('should add gpid if ortb2Imp.ext.data.pbadslot is present and is non empty (and ortb2Imp.ext.data.adserver.adslot is not present)', function () {
|
|
618
|
+
const updatedBidRequests = bidRequests.map(function(bidRequest, index) {
|
|
619
|
+
return {
|
|
620
|
+
...bidRequest,
|
|
621
|
+
ortb2Imp: {
|
|
622
|
+
ext: {
|
|
623
|
+
data: {
|
|
624
|
+
pbadslot: '1111/home-left-' + index
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
);
|
|
631
|
+
const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault);
|
|
632
|
+
const payload = JSON.parse(request.data);
|
|
633
|
+
|
|
634
|
+
expect(payload.data[0].gpid).to.equal('1111/home-left-0');
|
|
635
|
+
expect(payload.data[1].gpid).to.equal('1111/home-left-1');
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
it('should add gpid if ortb2Imp.ext.data.pbadslot is present and is non empty (even if ortb2Imp.ext.data.adserver.adslot is present and is non empty too)', function () {
|
|
639
|
+
const updatedBidRequests = bidRequests.map(function(bidRequest, index) {
|
|
640
|
+
return {
|
|
641
|
+
...bidRequest,
|
|
642
|
+
ortb2Imp: {
|
|
643
|
+
ext: {
|
|
644
|
+
data: {
|
|
645
|
+
pbadslot: '1111/home-left-' + index,
|
|
646
|
+
adserver: {
|
|
647
|
+
adslot: '1111/home-left/div-' + index
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
);
|
|
655
|
+
const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault);
|
|
656
|
+
const payload = JSON.parse(request.data);
|
|
657
|
+
|
|
658
|
+
expect(payload.data[0].gpid).to.equal('1111/home-left-0');
|
|
659
|
+
expect(payload.data[1].gpid).to.equal('1111/home-left-1');
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
it('should not add gpid if both ortb2Imp.ext.data.pbadslot and ortb2Imp.ext.data.adserver.adslot are present but empty', function () {
|
|
663
|
+
const updatedBidRequests = bidRequests.map(bidRequest => ({
|
|
664
|
+
...bidRequest,
|
|
665
|
+
ortb2Imp: {
|
|
666
|
+
ext: {
|
|
667
|
+
data: {
|
|
668
|
+
pbadslot: '',
|
|
669
|
+
adserver: {
|
|
670
|
+
adslot: ''
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}));
|
|
676
|
+
|
|
677
|
+
const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault);
|
|
678
|
+
const payload = JSON.parse(request.data);
|
|
679
|
+
|
|
680
|
+
return payload.data.forEach(bid => {
|
|
681
|
+
expect(bid).not.to.have.property('gpid');
|
|
682
|
+
});
|
|
683
|
+
});
|
|
684
|
+
|
|
685
|
+
it('should not add gpid if both ortb2Imp.ext.data.pbadslot and ortb2Imp.ext.data.adserver.adslot are not present', function () {
|
|
686
|
+
const request = spec.buildRequests(bidRequests, bidderResquestDefault);
|
|
687
|
+
const payload = JSON.parse(request.data);
|
|
688
|
+
|
|
689
|
+
return payload.data.forEach(bid => {
|
|
690
|
+
expect(bid).not.to.have.property('gpid');
|
|
691
|
+
});
|
|
692
|
+
});
|
|
693
|
+
|
|
694
|
+
it('should add gpid if ortb2Imp.ext.data.pbadslot is not present but ortb2Imp.ext.data.adserver.adslot is present and is non empty', function () {
|
|
695
|
+
const updatedBidRequests = bidRequests.map(function(bidRequest, index) {
|
|
696
|
+
return {
|
|
697
|
+
...bidRequest,
|
|
698
|
+
ortb2Imp: {
|
|
699
|
+
ext: {
|
|
700
|
+
data: {
|
|
701
|
+
adserver: {
|
|
702
|
+
adslot: '1111/home-left-' + index
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
});
|
|
709
|
+
const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault);
|
|
710
|
+
const payload = JSON.parse(request.data);
|
|
711
|
+
|
|
712
|
+
expect(payload.data[0].gpid).to.equal('1111/home-left-0');
|
|
713
|
+
expect(payload.data[1].gpid).to.equal('1111/home-left-1');
|
|
714
|
+
});
|
|
715
|
+
});
|
|
716
|
+
|
|
585
717
|
function checkMediaTypesSizes(mediaTypes, expectedSizes) {
|
|
586
718
|
const bidRequestWithBannerSizes = Object.assign(bidRequests[0], mediaTypes);
|
|
587
719
|
const requestWithBannerSizes = spec.buildRequests([bidRequestWithBannerSizes], bidderResquestDefault);
|
|
@@ -568,6 +568,134 @@ describe('triplelift adapter', function () {
|
|
|
568
568
|
expect(payload.user.ext.eids).to.have.lengthOf(4);
|
|
569
569
|
});
|
|
570
570
|
|
|
571
|
+
it('should remove malformed ids that would otherwise break call', function () {
|
|
572
|
+
let tdidId = '6bca7f6b-a98a-46c0-be05-6020f7604598';
|
|
573
|
+
let idlEnvId = null; // fail; can't be null
|
|
574
|
+
let criteoId = '53e30ea700424f7bbdd793b02abc5d7';
|
|
575
|
+
let pubcid = ''; // fail; can't be empty string
|
|
576
|
+
|
|
577
|
+
let bidRequestsMultiple = [
|
|
578
|
+
{ ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } },
|
|
579
|
+
{ ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } },
|
|
580
|
+
{ ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } }
|
|
581
|
+
];
|
|
582
|
+
|
|
583
|
+
let request = tripleliftAdapterSpec.buildRequests(bidRequestsMultiple, bidderRequest);
|
|
584
|
+
let payload = request.data;
|
|
585
|
+
|
|
586
|
+
expect(payload.user).to.deep.equal({
|
|
587
|
+
ext: {
|
|
588
|
+
eids: [
|
|
589
|
+
{
|
|
590
|
+
source: 'adserver.org',
|
|
591
|
+
uids: [
|
|
592
|
+
{
|
|
593
|
+
id: tdidId,
|
|
594
|
+
ext: { rtiPartner: 'TDID' }
|
|
595
|
+
}
|
|
596
|
+
],
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
source: 'criteo.com',
|
|
600
|
+
uids: [
|
|
601
|
+
{
|
|
602
|
+
id: criteoId,
|
|
603
|
+
ext: { rtiPartner: 'criteoId' }
|
|
604
|
+
}
|
|
605
|
+
]
|
|
606
|
+
}
|
|
607
|
+
]
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
expect(payload.user.ext.eids).to.be.an('array');
|
|
612
|
+
expect(payload.user.ext.eids).to.have.lengthOf(2);
|
|
613
|
+
|
|
614
|
+
tdidId = {}; // fail; can't be empty object
|
|
615
|
+
idlEnvId = { id: '987654' }; // pass
|
|
616
|
+
criteoId = [{ id: '123456' }]; // fail; can't be an array
|
|
617
|
+
pubcid = '3261d8ad-435d-481d-abd1-9f1a9ec99f0e'; // pass
|
|
618
|
+
|
|
619
|
+
bidRequestsMultiple = [
|
|
620
|
+
{ ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } },
|
|
621
|
+
{ ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } },
|
|
622
|
+
{ ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } }
|
|
623
|
+
];
|
|
624
|
+
|
|
625
|
+
request = tripleliftAdapterSpec.buildRequests(bidRequestsMultiple, bidderRequest);
|
|
626
|
+
payload = request.data;
|
|
627
|
+
|
|
628
|
+
expect(payload.user).to.deep.equal({
|
|
629
|
+
ext: {
|
|
630
|
+
eids: [
|
|
631
|
+
{
|
|
632
|
+
source: 'liveramp.com',
|
|
633
|
+
uids: [
|
|
634
|
+
{
|
|
635
|
+
id: '987654',
|
|
636
|
+
ext: { rtiPartner: 'idl' }
|
|
637
|
+
}
|
|
638
|
+
]
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
source: 'pubcid.org',
|
|
642
|
+
uids: [
|
|
643
|
+
{
|
|
644
|
+
id: pubcid,
|
|
645
|
+
ext: { rtiPartner: 'pubcid' }
|
|
646
|
+
}
|
|
647
|
+
]
|
|
648
|
+
}
|
|
649
|
+
]
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
expect(payload.user.ext.eids).to.be.an('array');
|
|
654
|
+
expect(payload.user.ext.eids).to.have.lengthOf(2);
|
|
655
|
+
|
|
656
|
+
tdidId = { id: '987654' }; // pass
|
|
657
|
+
idlEnvId = { id: 987654 }; // fail; can't be an int
|
|
658
|
+
criteoId = '53e30ea700424f7bbdd793b02abc5d7'; // pass
|
|
659
|
+
pubcid = { id: '' }; // fail; can't be an empty string
|
|
660
|
+
|
|
661
|
+
bidRequestsMultiple = [
|
|
662
|
+
{ ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } },
|
|
663
|
+
{ ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } },
|
|
664
|
+
{ ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } }
|
|
665
|
+
];
|
|
666
|
+
|
|
667
|
+
request = tripleliftAdapterSpec.buildRequests(bidRequestsMultiple, bidderRequest);
|
|
668
|
+
payload = request.data;
|
|
669
|
+
|
|
670
|
+
expect(payload.user).to.deep.equal({
|
|
671
|
+
ext: {
|
|
672
|
+
eids: [
|
|
673
|
+
{
|
|
674
|
+
source: 'adserver.org',
|
|
675
|
+
uids: [
|
|
676
|
+
{
|
|
677
|
+
id: '987654',
|
|
678
|
+
ext: { rtiPartner: 'TDID' }
|
|
679
|
+
}
|
|
680
|
+
],
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
source: 'criteo.com',
|
|
684
|
+
uids: [
|
|
685
|
+
{
|
|
686
|
+
id: criteoId,
|
|
687
|
+
ext: { rtiPartner: 'criteoId' }
|
|
688
|
+
}
|
|
689
|
+
]
|
|
690
|
+
}
|
|
691
|
+
]
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
expect(payload.user.ext.eids).to.be.an('array');
|
|
696
|
+
expect(payload.user.ext.eids).to.have.lengthOf(2);
|
|
697
|
+
});
|
|
698
|
+
|
|
571
699
|
it('should return a query string for TL call', function () {
|
|
572
700
|
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
|
|
573
701
|
const url = request.url;
|
|
@@ -402,7 +402,7 @@ describe('TrustXAdapter', function () {
|
|
|
402
402
|
});
|
|
403
403
|
|
|
404
404
|
it('if segment is present in permutive targeting, payload must have right params', function () {
|
|
405
|
-
const permSegments = ['test_perm_1', 'test_perm_2'];
|
|
405
|
+
const permSegments = [{id: 'test_perm_1'}, {id: 'test_perm_2'}];
|
|
406
406
|
const bidRequestsWithPermutiveTargeting = bidRequests.map((bid) => {
|
|
407
407
|
return Object.assign({
|
|
408
408
|
rtd: {
|
|
@@ -421,8 +421,8 @@ describe('TrustXAdapter', function () {
|
|
|
421
421
|
expect(payload.user.data).to.deep.equal([{
|
|
422
422
|
name: 'permutive',
|
|
423
423
|
segment: [
|
|
424
|
-
{name: 'p_standard', value: permSegments[0]},
|
|
425
|
-
{name: 'p_standard', value: permSegments[1]}
|
|
424
|
+
{name: 'p_standard', value: permSegments[0].id},
|
|
425
|
+
{name: 'p_standard', value: permSegments[1].id}
|
|
426
426
|
]
|
|
427
427
|
}]);
|
|
428
428
|
});
|
|
@@ -519,6 +519,48 @@ describe('TrustXAdapter', function () {
|
|
|
519
519
|
expect(payload.tmax).to.equal(3000);
|
|
520
520
|
getConfigStub.restore();
|
|
521
521
|
});
|
|
522
|
+
it('should contain imp[].ext.data.adserver if available', function() {
|
|
523
|
+
const ortb2Imp = [{
|
|
524
|
+
ext: {
|
|
525
|
+
data: {
|
|
526
|
+
adserver: {
|
|
527
|
+
name: 'ad_server_name',
|
|
528
|
+
adslot: '/111111/slot'
|
|
529
|
+
},
|
|
530
|
+
pbadslot: '/111111/slot'
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}, {
|
|
534
|
+
ext: {
|
|
535
|
+
data: {
|
|
536
|
+
adserver: {
|
|
537
|
+
name: 'ad_server_name',
|
|
538
|
+
adslot: '/222222/slot'
|
|
539
|
+
},
|
|
540
|
+
pbadslot: '/222222/slot'
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}];
|
|
544
|
+
const bidRequestsWithOrtb2Imp = bidRequests.slice(0, 3).map((bid, ind) => {
|
|
545
|
+
return Object.assign(ortb2Imp[ind] ? { ortb2Imp: ortb2Imp[ind] } : {}, bid);
|
|
546
|
+
});
|
|
547
|
+
const request = spec.buildRequests(bidRequestsWithOrtb2Imp, bidderRequest);
|
|
548
|
+
expect(request.data).to.be.an('string');
|
|
549
|
+
const payload = parseRequest(request.data);
|
|
550
|
+
expect(payload.imp[0].ext).to.deep.equal({
|
|
551
|
+
divid: bidRequests[0].adUnitCode,
|
|
552
|
+
data: ortb2Imp[0].ext.data,
|
|
553
|
+
gpid: ortb2Imp[0].ext.data.adserver.adslot
|
|
554
|
+
});
|
|
555
|
+
expect(payload.imp[1].ext).to.deep.equal({
|
|
556
|
+
divid: bidRequests[1].adUnitCode,
|
|
557
|
+
data: ortb2Imp[1].ext.data,
|
|
558
|
+
gpid: ortb2Imp[1].ext.data.adserver.adslot
|
|
559
|
+
});
|
|
560
|
+
expect(payload.imp[2].ext).to.deep.equal({
|
|
561
|
+
divid: bidRequests[2].adUnitCode
|
|
562
|
+
});
|
|
563
|
+
});
|
|
522
564
|
it('all id like request fields must be a string', function () {
|
|
523
565
|
const bidderRequestWithNumId = Object.assign({}, bidderRequest, { bidderRequestId: 123123, auctionId: 345345543 });
|
|
524
566
|
|