Skip to content

Commit

Permalink
update appnexus PBS default configs (#10503)
Browse files Browse the repository at this point in the history
* update appnexus PBS configs

* fix remaining appnexus defaultVendor references
  • Loading branch information
jsnellbaker committed Sep 27, 2023
1 parent 069d86b commit a8753d5
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 58 deletions.
40 changes: 25 additions & 15 deletions integrationExamples/gpt/prebidServer_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,41 @@

pbjs.que.push(function() {
var adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
mediaTypes: {
banner: {
sizes: [[300, 250]]
}
},
bids: [
{
bidder: 'appnexus',
params: {
placementId: 13144370
}
code: 'div-gpt-ad-1460505748561-0',
mediaTypes: {
banner: {
sizes: [600, 500]
}
},
bids: [
{
bidder: 'appnexus',
params: {
placementId: 12883451
}
]
}];
}
]
}];

pbjs.bidderSettings = {
appnexus: {
bidCpmAdjustment: function () {
return 10;
}
}
}
pbjs.setConfig({
bidderTimeout: 3000,
s2sConfig : {
accountId : '1',
enabled : true, //default value set to false
defaultVendor: 'appnexus',
defaultVendor: 'appnexuspsp',
bidders : ['appnexus'],
timeout : 1000, //default value is 1000
adapter : 'prebidServer', //if we have any other s2s adapter, default value is s2s
},
ortb2: {
test: 1
}
});

Expand Down
2 changes: 1 addition & 1 deletion integrationExamples/gpt/prebidServer_fledge_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
s2sConfig: [{
accountId : '1',
enabled : true,
defaultVendor: 'appnexus',
defaultVendor: 'appnexuspsp',
bidders : ['openx'],
timeout : 1500,
adapter : 'prebidServer'
Expand Down
15 changes: 3 additions & 12 deletions modules/prebidServerBidAdapter/config.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
// accountId and bidders params are not included here, should be configured by end-user
export const S2S_VENDORS = {
'appnexus': {
'appnexuspsp': {
adapter: 'prebidServer',
enabled: true,
endpoint: {
p1Consent: 'https://prebid.adnxs.com/pbs/v1/openrtb2/auction',
noP1Consent: 'https://prebid.adnxs-simple.com/pbs/v1/openrtb2/auction'
p1Consent: 'https://ib.adnxs.com/openrtb2/prebid',
noP1Consent: 'https://ib.adnxs-simple.com/openrtb2/prebid'
},
syncEndpoint: {
p1Consent: 'https://prebid.adnxs.com/pbs/v1/cookie_sync',
noP1Consent: 'https://prebid.adnxs-simple.com/pbs/v1/cookie_sync'
},
timeout: 1000
},
'appnexuspsp': {
adapter: 'prebidServer',
enabled: true,
endpoint: {
p1Consent: 'https://ib.adnxs.com/openrtb2/prebid',
noP1Consent: 'https://ib.adnxs-simple.com/openrtb2/prebid'
},
timeout: 1000
},
'rubicon': {
adapter: 'prebidServer',
enabled: true,
Expand Down
4 changes: 2 additions & 2 deletions test/spec/auctionmanager_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ describe('auctionmanager.js', function () {
s2sConfig: {
accountId: '1',
enabled: true,
defaultVendor: 'appnexus',
defaultVendor: 'appnexuspsp',
bidders: ['appnexus'],
timeout: 1000,
adapter: 'prebidServer'
Expand Down Expand Up @@ -1263,7 +1263,7 @@ describe('auctionmanager.js', function () {
s2sConfig: [{
accountId: '1',
enabled: true,
defaultVendor: 'appnexus',
defaultVendor: 'appnexuspsp',
bidders: ['mock-s2s-1'],
adapter: 'pbs'
}, {
Expand Down
32 changes: 4 additions & 28 deletions test/spec/modules/prebidServerBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3635,33 +3635,6 @@ describe('S2S Adapter', function () {
sinon.assert.calledOnce(logErrorSpy);
});

it('should configure the s2sConfig object with appnexus vendor defaults unless specified by user', function () {
const options = {
accountId: '123',
bidders: ['appnexus'],
defaultVendor: 'appnexus',
timeout: 750
};

config.setConfig({ s2sConfig: options });
sinon.assert.notCalled(logErrorSpy);

let vendorConfig = config.getConfig('s2sConfig');
expect(vendorConfig).to.have.property('accountId', '123');
expect(vendorConfig).to.have.property('adapter', 'prebidServer');
expect(vendorConfig.bidders).to.deep.equal(['appnexus']);
expect(vendorConfig.enabled).to.be.true;
expect(vendorConfig.endpoint).to.deep.equal({
p1Consent: 'https://prebid.adnxs.com/pbs/v1/openrtb2/auction',
noP1Consent: 'https://prebid.adnxs-simple.com/pbs/v1/openrtb2/auction'
});
expect(vendorConfig.syncEndpoint).to.deep.equal({
p1Consent: 'https://prebid.adnxs.com/pbs/v1/cookie_sync',
noP1Consent: 'https://prebid.adnxs-simple.com/pbs/v1/cookie_sync'
});
expect(vendorConfig).to.have.property('timeout', 750);
});

it('should configure the s2sConfig object with appnexuspsp vendor defaults unless specified by user', function () {
const options = {
accountId: '123',
Expand All @@ -3682,7 +3655,10 @@ describe('S2S Adapter', function () {
p1Consent: 'https://ib.adnxs.com/openrtb2/prebid',
noP1Consent: 'https://ib.adnxs-simple.com/openrtb2/prebid'
});
expect(vendorConfig.syncEndpoint).to.be.undefined;
expect(vendorConfig.syncEndpoint).to.deep.equal({
p1Consent: 'https://prebid.adnxs.com/pbs/v1/cookie_sync',
noP1Consent: 'https://prebid.adnxs-simple.com/pbs/v1/cookie_sync'
});
expect(vendorConfig).to.have.property('timeout', 750);
});

Expand Down

0 comments on commit a8753d5

Please sign in to comment.