diff --git a/modules/a4gBidAdapter.js b/modules/a4gBidAdapter.js index 1961dba1f101..01c59616dc07 100644 --- a/modules/a4gBidAdapter.js +++ b/modules/a4gBidAdapter.js @@ -77,7 +77,10 @@ export const spec = { currency: A4G_CURRENCY, netRevenue: true, ttl: A4G_TTL, - ad: response.ad + ad: response.ad, + meta: { + advertiserDomains: response.adomain && response.adomain.length > 0 ? response.adomain : [] + } }; bidResponses.push(bidResponse); } diff --git a/test/spec/modules/a4gBidAdapter_spec.js b/test/spec/modules/a4gBidAdapter_spec.js index cb05fa62ab62..a9ead9fd0214 100644 --- a/test/spec/modules/a4gBidAdapter_spec.js +++ b/test/spec/modules/a4gBidAdapter_spec.js @@ -161,7 +161,11 @@ describe('a4gAdapterTests', function () { ad: 'test ad', currency: 'USD', ttl: 120, - netRevenue: true + netRevenue: true, + meta: { + advertiserDomains: [] + } + } ]; const result = spec.interpretResponse(bidResponse, bidRequest); @@ -181,7 +185,10 @@ describe('a4gAdapterTests', function () { ad: 'test ad', currency: 'USD', ttl: 120, - netRevenue: true + netRevenue: true, + meta: { + advertiserDomains: [] + } } ]; const result = spec.interpretResponse(bidResponseWithoutCrid, bidRequest); @@ -201,7 +208,8 @@ describe('a4gAdapterTests', function () { 'currency', 'netRevenue', 'ttl', - 'ad' + 'ad', + 'meta' ]; let resultKeys = Object.keys(result[0]); @@ -215,5 +223,13 @@ describe('a4gAdapterTests', function () { expect(result[0].requestId).to.not.equal(result[0].adId); }) + + it('advertiserDomains is included when sent by server', function () { + bidResponse.body[0].adomain = ['test_adomain']; + let response = spec.interpretResponse(bidResponse, bidRequest); + expect(Object.keys(response[0].meta)).to.include.members(['advertiserDomains']); + expect(response[0].meta.advertiserDomains).to.deep.equal(['test_adomain']); + delete bidResponse.body[0].adomain; + }); }); });