diff --git a/modules/gridBidAdapter.js b/modules/gridBidAdapter.js index 9c63e871356..8285b3308b7 100644 --- a/modules/gridBidAdapter.js +++ b/modules/gridBidAdapter.js @@ -26,10 +26,9 @@ const RENDERER_URL = 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js export const storage = getStorageManager({ bidderCode: BIDDER_CODE }); const LOG_ERROR_MESS = { - noAuid: 'Bid from response has no auid parameter - ', + noAdid: 'Bid from response has no adid parameter - ', noAdm: 'Bid from response has no adm parameter - ', noBid: 'Array of bid objects is empty', - noPlacementCode: 'Can\'t find in requested bids the bid with auid - ', emptyUids: 'Uids should be not empty', emptySeatbid: 'Seatbid array from response has empty item', emptyResponse: 'Response is empty', @@ -507,7 +506,7 @@ function _getBidFromResponse(respItem) { function _addBidResponse(serverBid, bidRequest, bidResponses, RendererConst, bidderCode) { if (!serverBid) return; let errorMessage; - if (!serverBid.auid) errorMessage = LOG_ERROR_MESS.noAuid + JSON.stringify(serverBid); + if (!serverBid.adid) errorMessage = LOG_ERROR_MESS.noAdid + JSON.stringify(serverBid); if (!errorMessage && !serverBid.adm && !serverBid.nurl) errorMessage = LOG_ERROR_MESS.noAdm + JSON.stringify(serverBid); else { const bidObject = bidRequest.bidsMap ? bidRequest.bidsMap[serverBid.impid] : bidRequest.bidObject; @@ -518,7 +517,7 @@ function _addBidResponse(serverBid, bidRequest, bidResponses, RendererConst, bid cpm: serverBid.price, width: serverBid.w, height: serverBid.h, - creativeId: serverBid.auid, // bid.bidId + creativeId: serverBid.adid, currency: 'USD', netRevenue: true, ttl: TIME_TO_LIVE, diff --git a/test/spec/modules/gridBidAdapter_spec.js b/test/spec/modules/gridBidAdapter_spec.js index 4a1148bf377..c1edff46dc0 100644 --- a/test/spec/modules/gridBidAdapter_spec.js +++ b/test/spec/modules/gridBidAdapter_spec.js @@ -911,11 +911,11 @@ describe('TheMediaGrid Adapter', function () { describe('interpretResponse', function () { const responses = [ - {'bid': [{'impid': '659423fff799cb', 'price': 1.15, 'adm': '
test content 1
', 'auid': 1, 'h': 250, 'w': 300, 'dealid': 11}], 'seat': '1'}, - {'bid': [{'impid': '4dff80cc4ee346', 'price': 0.5, 'adm': '
test content 2
', 'auid': 2, 'h': 600, 'w': 300}], 'seat': '1'}, - {'bid': [{'impid': '5703af74d0472a', 'price': 0.15, 'adm': '
test content 3
', 'auid': 1, 'h': 90, 'w': 728}], 'seat': '1'}, - {'bid': [{'impid': '2344da98f78b42', 'price': 0, 'auid': 3, 'h': 250, 'w': 300}], 'seat': '1'}, - {'bid': [{'price': 0, 'adm': '
test content 5
', 'h': 250, 'w': 300}], 'seat': '1'}, + {'bid': [{'impid': '659423fff799cb', 'adid': '13_14_4353', 'price': 1.15, 'adm': '
test content 1
', 'auid': 1, 'h': 250, 'w': 300, 'dealid': 11}], 'seat': '1'}, + {'bid': [{'impid': '4dff80cc4ee346', 'adid': '13_15_6454', 'price': 0.5, 'adm': '
test content 2
', 'auid': 2, 'h': 600, 'w': 300}], 'seat': '1'}, + {'bid': [{'impid': '5703af74d0472a', 'adid': '13_16_7654', 'price': 0.15, 'adm': '
test content 3
', 'auid': 1, 'h': 90, 'w': 728}], 'seat': '1'}, + {'bid': [{'impid': '2344da98f78b42', 'adid': '13_17_5433', 'price': 0, 'auid': 3, 'h': 250, 'w': 300}], 'seat': '1'}, + {'bid': [{'price': 0, 'adid': '13_18_34645', 'adm': '
test content 5
', 'h': 250, 'w': 300}], 'seat': '1'}, undefined, {'bid': [], 'seat': '1'}, {'seat': '1'}, @@ -940,7 +940,7 @@ describe('TheMediaGrid Adapter', function () { { 'requestId': '659423fff799cb', 'cpm': 1.15, - 'creativeId': 1, + 'creativeId': '13_14_4353', 'dealId': 11, 'width': 300, 'height': 250, @@ -1000,7 +1000,7 @@ describe('TheMediaGrid Adapter', function () { { 'requestId': '659423fff799cb', 'cpm': 1.15, - 'creativeId': 1, + 'creativeId': '13_14_4353', 'dealId': 11, 'width': 300, 'height': 250, @@ -1016,7 +1016,7 @@ describe('TheMediaGrid Adapter', function () { { 'requestId': '4dff80cc4ee346', 'cpm': 0.5, - 'creativeId': 2, + 'creativeId': '13_15_6454', 'dealId': undefined, 'width': 300, 'height': 600, @@ -1032,7 +1032,7 @@ describe('TheMediaGrid Adapter', function () { { 'requestId': '5703af74d0472a', 'cpm': 0.15, - 'creativeId': 1, + 'creativeId': '13_16_7654', 'dealId': undefined, 'width': 728, 'height': 90, @@ -1135,18 +1135,18 @@ describe('TheMediaGrid Adapter', function () { } ]; const response = [ - {'bid': [{'impid': '659423fff799cb', 'price': 1.15, 'adm': '\n<\/Ad>\n<\/VAST>', 'auid': 11, content_type: 'video', w: 300, h: 600}], 'seat': '2'}, - {'bid': [{'impid': '2bc598e42b6a', 'price': 1.00, 'adm': '\n<\/Ad>\n<\/VAST>', 'auid': 12, content_type: 'video'}], 'seat': '2'}, - {'bid': [{'impid': '23312a43bc42', 'price': 2.00, 'nurl': 'https://some_test_vast_url.com', 'auid': 13, content_type: 'video', 'adomain': ['example.com'], w: 300, h: 600}], 'seat': '2'}, - {'bid': [{'impid': '112432ab4f34', 'price': 1.80, 'adm': '\n<\/Ad>\n<\/VAST>', 'nurl': 'https://wrong_url.com', 'auid': 14, content_type: 'video', 'adomain': ['example.com'], w: 300, h: 600}], 'seat': '2'}, - {'bid': [{'impid': 'a74b342f8cd', 'price': 1.50, 'nurl': '', 'auid': 15, content_type: 'video'}], 'seat': '2'} + {'bid': [{'impid': '659423fff799cb', 'adid': '35_56_6454', 'price': 1.15, 'adm': '\n<\/Ad>\n<\/VAST>', 'auid': 11, content_type: 'video', w: 300, h: 600}], 'seat': '2'}, + {'bid': [{'impid': '2bc598e42b6a', 'adid': '35_57_2344', 'price': 1.00, 'adm': '\n<\/Ad>\n<\/VAST>', content_type: 'video'}], 'seat': '2'}, + {'bid': [{'impid': '23312a43bc42', 'adid': '35_58_5345', 'price': 2.00, 'nurl': 'https://some_test_vast_url.com', 'auid': 13, content_type: 'video', 'adomain': ['example.com'], w: 300, h: 600}], 'seat': '2'}, + {'bid': [{'impid': '112432ab4f34', 'adid': '35_59_56756', 'price': 1.80, 'adm': '\n<\/Ad>\n<\/VAST>', 'nurl': 'https://wrong_url.com', 'auid': 14, content_type: 'video', 'adomain': ['example.com'], w: 300, h: 600}], 'seat': '2'}, + {'bid': [{'impid': 'a74b342f8cd', 'adid': '35_60_523452', 'price': 1.50, 'nurl': '', 'auid': 15, content_type: 'video'}], 'seat': '2'} ]; const [request] = spec.buildRequests(bidRequests); const expectedResponse = [ { 'requestId': '659423fff799cb', 'cpm': 1.15, - 'creativeId': 11, + 'creativeId': '35_56_6454', 'dealId': undefined, 'width': 300, 'height': 600, @@ -1165,7 +1165,7 @@ describe('TheMediaGrid Adapter', function () { { 'requestId': '2bc598e42b6a', 'cpm': 1.00, - 'creativeId': 12, + 'creativeId': '35_57_2344', 'dealId': undefined, 'width': undefined, 'height': undefined, @@ -1184,7 +1184,7 @@ describe('TheMediaGrid Adapter', function () { { 'requestId': '23312a43bc42', 'cpm': 2.00, - 'creativeId': 13, + 'creativeId': '35_58_5345', 'dealId': undefined, 'width': 300, 'height': 600, @@ -1200,7 +1200,7 @@ describe('TheMediaGrid Adapter', function () { { 'requestId': '112432ab4f34', 'cpm': 1.80, - 'creativeId': 14, + 'creativeId': '35_59_56756', 'dealId': undefined, 'width': 300, 'height': 600, @@ -1265,11 +1265,11 @@ describe('TheMediaGrid Adapter', function () { it('complicated case', function () { const fullResponse = [ - {'bid': [{'impid': '2164be6358b9', 'price': 1.15, 'adm': '
test content 1
', 'auid': 1, 'h': 250, 'w': 300, dealid: 11}], 'seat': '1'}, - {'bid': [{'impid': '4e111f1b66e4', 'price': 0.5, 'adm': '
test content 2
', 'auid': 2, 'h': 600, 'w': 300, dealid: 12}], 'seat': '1'}, - {'bid': [{'impid': '26d6f897b516', 'price': 0.15, 'adm': '
test content 3
', 'auid': 1, 'h': 90, 'w': 728}], 'seat': '1'}, - {'bid': [{'impid': '326bde7fbf69', 'price': 0.15, 'adm': '
test content 4
', 'auid': 1, 'h': 600, 'w': 300}], 'seat': '1'}, - {'bid': [{'impid': '2234f233b22a', 'price': 0.5, 'adm': '
test content 5
', 'auid': 2, 'h': 600, 'w': 350}], 'seat': '1'}, + {'bid': [{'impid': '2164be6358b9', 'adid': '32_52_7543', 'price': 1.15, 'adm': '
test content 1
', 'auid': 1, 'h': 250, 'w': 300, dealid: 11}], 'seat': '1'}, + {'bid': [{'impid': '4e111f1b66e4', 'adid': '32_54_4535', 'price': 0.5, 'adm': '
test content 2
', 'auid': 2, 'h': 600, 'w': 300, dealid: 12}], 'seat': '1'}, + {'bid': [{'impid': '26d6f897b516', 'adid': '32_53_75467', 'price': 0.15, 'adm': '
test content 3
', 'auid': 1, 'h': 90, 'w': 728}], 'seat': '1'}, + {'bid': [{'impid': '326bde7fbf69', 'adid': '32_54_12342', 'price': 0.15, 'adm': '
test content 4
', 'auid': 1, 'h': 600, 'w': 300}], 'seat': '1'}, + {'bid': [{'impid': '2234f233b22a', 'adid': '32_55_987686', 'price': 0.5, 'adm': '
test content 5
', 'auid': 2, 'h': 600, 'w': 350}], 'seat': '1'}, ]; const bidRequests = [ { @@ -1333,7 +1333,7 @@ describe('TheMediaGrid Adapter', function () { { 'requestId': '2164be6358b9', 'cpm': 1.15, - 'creativeId': 1, + 'creativeId': '32_52_7543', 'dealId': 11, 'width': 300, 'height': 250, @@ -1349,7 +1349,7 @@ describe('TheMediaGrid Adapter', function () { { 'requestId': '4e111f1b66e4', 'cpm': 0.5, - 'creativeId': 2, + 'creativeId': '32_54_4535', 'dealId': 12, 'width': 300, 'height': 600, @@ -1365,7 +1365,7 @@ describe('TheMediaGrid Adapter', function () { { 'requestId': '26d6f897b516', 'cpm': 0.15, - 'creativeId': 1, + 'creativeId': '32_53_75467', 'dealId': undefined, 'width': 728, 'height': 90, @@ -1381,7 +1381,7 @@ describe('TheMediaGrid Adapter', function () { { 'requestId': '326bde7fbf69', 'cpm': 0.15, - 'creativeId': 1, + 'creativeId': '32_54_12342', 'dealId': undefined, 'width': 300, 'height': 600, @@ -1421,6 +1421,7 @@ describe('TheMediaGrid Adapter', function () { 'price': 1.15, 'adm': '
test content 1
', 'auid': 1, + 'adid': '234_6454_3453', 'h': 250, 'w': 300, 'dealid': 11, @@ -1440,7 +1441,7 @@ describe('TheMediaGrid Adapter', function () { { 'requestId': '26d6f897b516', 'cpm': 1.15, - 'creativeId': 1, + 'creativeId': '234_6454_3453', 'dealId': 11, 'width': 300, 'height': 250,