Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update appnexus PBS default configs #10503

Merged
merged 3 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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': {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is used by some integration examples and unit tests, those should probably also be updated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed a change to get the remaining references

'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