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

Nexx360 Bid Adapter : Ad and adUrl banner split #10344

Merged
merged 1 commit into from
Aug 10, 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
8 changes: 7 additions & 1 deletion modules/nexx360BidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,13 @@ function interpretResponse(serverResponse) {
};
if (allowAlternateBidderCodes) response.bidderCode = `n360-${bid.ext.ssp}`;

if (bid.ext.mediaType === BANNER) response.adUrl = bid.ext.adUrl;
if (bid.ext.mediaType === BANNER) {
if (bid.adm) {
response.ad = bid.adm;
} else {
response.adUrl = bid.ext.adUrl;
}
}
if ([INSTREAM, OUTSTREAM].includes(bid.ext.mediaType)) response.vastXml = bid.ext.vastXml;

if (bid.ext.mediaType === OUTSTREAM) {
Expand Down
49 changes: 48 additions & 1 deletion test/spec/modules/nexx360BidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ describe('Nexx360 bid adapter tests', function () {
const output = spec.interpretResponse(response);
expect(output.length).to.be.eql(0);
});
it('banner responses', function() {
it('banner responses with adUrl only', function() {
const response = {
body: {
'id': 'a8d3a675-a4ba-4d26-807f-c8f2fad821e0',
Expand Down Expand Up @@ -479,6 +479,53 @@ describe('Nexx360 bid adapter tests', function () {
expect(output[0].currency).to.be.eql(response.body.cur);
expect(output[0].cpm).to.be.eql(response.body.seatbid[0].bid[0].price);
});
it('banner responses with adm', function() {
const response = {
body: {
'id': 'a8d3a675-a4ba-4d26-807f-c8f2fad821e0',
'cur': 'USD',
'seatbid': [
{
'bid': [
{
'id': '4427551302944024629',
'impid': '226175918ebeda',
'price': 1.5,
'adomain': [
'http://prebid.org'
],
'crid': '98493581',
'ssp': 'appnexus',
'h': 600,
'w': 300,
'adm': '<div>TestAd</div>',
'cat': [
'IAB3-1'
],
'ext': {
'adUnitCode': 'div-1',
'mediaType': 'banner',
'adUrl': 'https://fast.nexx360.io/cache?uuid=fdddcebc-1edf-489d-880d-1418d8bdc493',
'ssp': 'appnexus',
}
}
],
'seat': 'appnexus'
}
],
'ext': {
'id': 'de3de7c7-e1cf-4712-80a9-94eb26bfc718',
'cookies': []
},
}
};
const output = spec.interpretResponse(response);
expect(output[0].ad).to.be.eql(response.body.seatbid[0].bid[0].adm);
expect(output[0].adUrl).to.be.eql(undefined);
expect(output[0].mediaType).to.be.eql(response.body.seatbid[0].bid[0].ext.mediaType);
expect(output[0].currency).to.be.eql(response.body.cur);
expect(output[0].cpm).to.be.eql(response.body.seatbid[0].bid[0].price);
});
it('instream responses', function() {
const response = {
body: {
Expand Down