From faf6c3be9f887c76f852eb28eb2faa803b99b5de Mon Sep 17 00:00:00 2001 From: rtuschkany <35923908+rtuschkany@users.noreply.github.com> Date: Thu, 27 May 2021 22:07:28 +0200 Subject: [PATCH 1/4] ConnectAd bid adapter: Add adomain support Add adomain support --- modules/connectadBidAdapter.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/connectadBidAdapter.js b/modules/connectadBidAdapter.js index 4fa2a56a004..5a66a01f3e3 100644 --- a/modules/connectadBidAdapter.js +++ b/modules/connectadBidAdapter.js @@ -124,6 +124,7 @@ export const spec = { bid.width = decision.width; bid.height = decision.height; bid.dealid = decision.dealid || null; + meta: { advertiserDomains: decision && decision.adomain ? decision.adomain : [] }, bid.ad = retrieveAd(decision); bid.currency = 'USD'; bid.creativeId = decision.adId; From fb161aeec688e8ccc43d38106f12b499561b1d92 Mon Sep 17 00:00:00 2001 From: rtuschkany <35923908+rtuschkany@users.noreply.github.com> Date: Thu, 27 May 2021 22:21:27 +0200 Subject: [PATCH 2/4] ConnectAd Bid-Adapter: Add adomain support fix --- modules/connectadBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/connectadBidAdapter.js b/modules/connectadBidAdapter.js index 5a66a01f3e3..06d7b4adcb8 100644 --- a/modules/connectadBidAdapter.js +++ b/modules/connectadBidAdapter.js @@ -124,7 +124,7 @@ export const spec = { bid.width = decision.width; bid.height = decision.height; bid.dealid = decision.dealid || null; - meta: { advertiserDomains: decision && decision.adomain ? decision.adomain : [] }, + bid.meta: { advertiserDomains: decision && decision.adomain ? decision.adomain : [] }, bid.ad = retrieveAd(decision); bid.currency = 'USD'; bid.creativeId = decision.adId; From 016680bed8902938bbe286146da10908cf42a42f Mon Sep 17 00:00:00 2001 From: rtuschkany <35923908+rtuschkany@users.noreply.github.com> Date: Thu, 27 May 2021 22:29:53 +0200 Subject: [PATCH 3/4] ConnectAd Bid-Adapter: Add adomain support --- modules/connectadBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/connectadBidAdapter.js b/modules/connectadBidAdapter.js index 06d7b4adcb8..111b6ac10e8 100644 --- a/modules/connectadBidAdapter.js +++ b/modules/connectadBidAdapter.js @@ -124,7 +124,7 @@ export const spec = { bid.width = decision.width; bid.height = decision.height; bid.dealid = decision.dealid || null; - bid.meta: { advertiserDomains: decision && decision.adomain ? decision.adomain : [] }, + bid.meta = { advertiserDomains: decision && decision.adomain ? decision.adomain : [] }; bid.ad = retrieveAd(decision); bid.currency = 'USD'; bid.creativeId = decision.adId; From ad66a3eebd10c96d1d05224f59b5e2b5dd9dd0e5 Mon Sep 17 00:00:00 2001 From: rtuschkany <35923908+rtuschkany@users.noreply.github.com> Date: Sun, 30 May 2021 20:01:46 +0200 Subject: [PATCH 4/4] ConnectAd Bid-Adapter: Add adomain support test update --- test/spec/modules/connectadBidAdapter_spec.js | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/test/spec/modules/connectadBidAdapter_spec.js b/test/spec/modules/connectadBidAdapter_spec.js index dbac3c0dc7c..657bc432d06 100644 --- a/test/spec/modules/connectadBidAdapter_spec.js +++ b/test/spec/modules/connectadBidAdapter_spec.js @@ -303,7 +303,43 @@ describe('ConnectAd Adapter', function () { }); describe('bid responses', function () { - it('should return complete bid response', function () { + it('should return complete bid response with adomain', function () { + const ADOMAINS = ['connectad.io']; + + let serverResponse = { + body: { + decisions: { + '2f95c00074b931': { + adId: '0', + adomain: ['connectad.io'], + contents: [ + { + body: '<<<---- Creative --->>>' + } + ], + height: '250', + width: '300', + pricing: { + clearPrice: 11.899999999999999 + } + } + } + } + }; + const request = spec.buildRequests(bidRequests, bidderRequest); + const bids = spec.interpretResponse(serverResponse, request); + + expect(bids).to.be.lengthOf(1); + expect(bids[0].cpm).to.equal(11.899999999999999); + expect(bids[0].width).to.equal('300'); + expect(bids[0].height).to.equal('250'); + expect(bids[0].ad).to.have.length.above(1); + expect(bids[0].meta.advertiserDomains).to.deep.equal(ADOMAINS); + }); + + it('should return complete bid response with empty adomain', function () { + const ADOMAINS = []; + let serverResponse = { body: { decisions: { @@ -331,6 +367,7 @@ describe('ConnectAd Adapter', function () { expect(bids[0].width).to.equal('300'); expect(bids[0].height).to.equal('250'); expect(bids[0].ad).to.have.length.above(1); + expect(bids[0].meta.advertiserDomains).to.deep.equal(ADOMAINS); }); it('should return empty bid response', function () {