Skip to content

Commit

Permalink
TheMediaGridNM: Fix bug with wrong vastUrl (#7530)
Browse files Browse the repository at this point in the history
* Added TheMediaGridNM Bid Adapter

* Updated required params for TheMediaGridNM Bid Adapter

* Update TheMediGridNM Bid Adapter

* Fix tests for TheMediaGridNM Bid Adapter

* Fixes after review for TheMediaGridNM Bid Adapter

* Add support of multi-format in TheMediaGrid Bid Adapter

* Update sync url for grid and gridNM Bid Adapters

* TheMediaGrid Bid Adapter: added keywords adUnit parameter

* Update TheMediaGrid Bid Adapter to support keywords from config

* Implement new request format for TheMediaGrid Bid Adapter

* Fix jwpseg params for TheMediaGrid Bid Adapter

* Update unit tests for The Media Grid Bid Adapter

* Fix typo in TheMediaGrid Bid Adapter

* Added test for jwTargeting in TheMediaGrid Bid Adapter

* The new request format was made by default in TheMediaGrid Bid Adapter

* Update userId format in ad request for TheMediaGrid Bid Adapter

* Added bidFloor parameter for TheMediaGrid Bid Adapter

* Fix for review TheMediaGrid Bid Adapter

* Support floorModule in TheMediaGrid Bid Adapter

* Fix empty bidfloor for TheMediaGrid Bid Adapter

* Some change to restart autotests

* Fix userIds format for TheMediaGrid Bid Adapter

* Remove digitrust userId from TheMediaGrid Bid Adapter

* Protocols was added in video section in ad request for TheMediaGrid Bid Adapter

* TheMediaGrid: fix trouble with alias using

* TheMediaGridNM: fix trouble with alias

* TheMediaGrid Bid Adapter: added support of PBAdSlot module

* TheMediaGrid Bid Adapter: fix typo

* GridNM Bid Adapter: use absent in params data from mediaTypes

* GridNM Bid Adapter: fix md file + add advertiserDomains support

* TheMediaGrid and gridNM Bid Adapter: minor netRevenue fixes

* gridNM Bid Adapter updates after review

* TheMediaGrid Bid Adapter: fix keywords workflow

* fix testing and kick off lgtm again

* TheMediaGrid: added ext.bidder.grid.demandSource processing

* TheMediaGrid: added user.id from fpd cookie

* TheMediaGrid: control cookie setting via bidder config

* TheMediaGrid: use localStorage instead cookie

* TheMediaGridNM Bid Adapter: update adapter to use /hbjson endpoint

* TheMediaGridNM: fix unnecessary conditions

* TheMediaGrid: fix bug with nurl field in response

* TheMediaGrid: update test

* TheMediaGridNM: fix possible bug with nurl

Co-authored-by: Chris Huie <phoenixtechnerd@gmail.com>
  • Loading branch information
TheMediaGrid and ChrisHuie authored Oct 4, 2021
1 parent 3d606de commit 20e0c44
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 7 deletions.
13 changes: 7 additions & 6 deletions modules/gridNMBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export const spec = {
if (!errorMessage && serverResponse.seatbid) {
const serverBid = _getBidFromResponse(serverResponse.seatbid[0]);
if (serverBid) {
if (!serverBid.adm) errorMessage = LOG_ERROR_MESS.noAdm + JSON.stringify(serverBid);
if (!serverBid.adm && !serverBid.nurl) errorMessage = LOG_ERROR_MESS.noAdm + JSON.stringify(serverBid);
else if (!serverBid.price) errorMessage = LOG_ERROR_MESS.noPrice + JSON.stringify(serverBid);
else if (serverBid.content_type !== 'video') errorMessage = LOG_ERROR_MESS.wrongContentType + serverBid.content_type;
if (!errorMessage) {
Expand All @@ -246,17 +246,18 @@ export const spec = {
netRevenue: true,
ttl: TIME_TO_LIVE,
dealId: serverBid.dealid,
vastXml: serverBid.adm,
mediaType: VIDEO,
meta: {
advertiserDomains: serverBid.adomain ? serverBid.adomain : []
},
adResponse: {
content: serverBid.adm
}
};

if (serverBid.nurl) {
if (serverBid.adm) {
bidResponse.vastXml = serverBid.adm;
bidResponse.adResponse = {
content: bidResponse.vastXml
};
} else if (serverBid.nurl) {
bidResponse.vastUrl = serverBid.nurl;
}

Expand Down
41 changes: 40 additions & 1 deletion test/spec/modules/gridNMBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ describe('TheMediaGridNM Adapter', function () {
const responses = [
{'bid': [{'price': 1.15, 'adm': '<VAST version=\"3.0\">\n<Ad id=\"21341234\"><\/Ad>\n<\/VAST>', 'content_type': 'video', 'h': 250, 'w': 300, 'dealid': 11}], 'seat': '2'},
{'bid': [{'price': 0.5, 'adm': '<VAST version=\"3.0\">\n<Ad id=\"21341235\"><\/Ad>\n<\/VAST>', 'content_type': 'video', 'h': 600, 'w': 300, adomain: ['my_domain.ru']}], 'seat': '2'},
{'bid': [{'price': 2.00, 'nurl': 'https://some_test_vast_url.com', 'content_type': 'video', 'adomain': ['example.com'], 'w': 300, 'h': 600}], 'seat': '2'},
{'bid': [{'price': 0, 'h': 250, 'w': 300}], 'seat': '2'},
{'bid': [{'price': 0, 'adm': '<VAST version=\"3.0\">\n<Ad id=\"21341237\"><\/Ad>\n<\/VAST>', 'h': 250, 'w': 300}], 'seat': '2'},
undefined,
Expand Down Expand Up @@ -394,6 +395,28 @@ describe('TheMediaGridNM Adapter', function () {
'context': 'instream'
}
}
},
{
'bidder': 'gridNM',
'params': {
'source': 'jwp',
'secid': '11',
'pubid': '22',
'video': {
'mimes': ['video/mp4'],
'protocols': [1, 2, 3],
}
},
'adUnitCode': 'adunit-code-1',
'sizes': [[300, 250], [300, 600]],
'bidId': '127f4b12a432c',
'bidderRequestId': 'a75bc868f32',
'auctionId': '1cbd2feafe5e8b',
'mediaTypes': {
'video': {
'context': 'instream'
}
}
}
];
const requests = spec.buildRequests(bidRequests);
Expand Down Expand Up @@ -435,6 +458,22 @@ describe('TheMediaGridNM Adapter', function () {
'adResponse': {
'content': '<VAST version=\"3.0\">\n<Ad id=\"21341235\"><\/Ad>\n<\/VAST>'
}
},
{
'requestId': '127f4b12a432c',
'cpm': 2.00,
'creativeId': 'a75bc868f32',
'dealId': undefined,
'width': 300,
'height': 600,
'currency': 'USD',
'mediaType': 'video',
'netRevenue': true,
'ttl': 360,
'meta': {
advertiserDomains: ['example.com']
},
'vastUrl': 'https://some_test_vast_url.com',
}
];

Expand All @@ -445,7 +484,7 @@ describe('TheMediaGridNM Adapter', function () {
});

it('handles wrong and nobid responses', function () {
responses.slice(2).forEach((resp) => {
responses.slice(3).forEach((resp) => {
const request = spec.buildRequests([{
'bidder': 'gridNM',
'params': {
Expand Down

0 comments on commit 20e0c44

Please sign in to comment.