From 3539ebf2180eb013ba5afbc7ebf6f61c93e12845 Mon Sep 17 00:00:00 2001 From: Soman Sarker Date: Tue, 18 Mar 2025 15:02:08 +0600 Subject: [PATCH 1/2] Added new optional param placement --- modules/adgridBidAdapter.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/adgridBidAdapter.js b/modules/adgridBidAdapter.js index 71c55a54395..ec2bc185b0b 100644 --- a/modules/adgridBidAdapter.js +++ b/modules/adgridBidAdapter.js @@ -160,6 +160,7 @@ function getBidData(bid) { deviceUa: bid.ortb2?.device?.ua, domain: bid.ortb2?.site?.publisher?.domain, domainId: bid.params.domainId, + placement: bid.params.placement || '', code: bid.adUnitCode }; From ea99954f10ffe3fa2c7aa5928e877b4d97beb4e7 Mon Sep 17 00:00:00 2001 From: Soman Sarker Date: Wed, 19 Mar 2025 16:23:04 +0600 Subject: [PATCH 2/2] Placement params is required now --- modules/adgridBidAdapter.js | 4 ++-- modules/adgridBidAdapter.md | 6 ++++-- test/spec/modules/adgridBidAdapter_spec.js | 10 ++++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/adgridBidAdapter.js b/modules/adgridBidAdapter.js index ec2bc185b0b..ee5c3c55b9d 100644 --- a/modules/adgridBidAdapter.js +++ b/modules/adgridBidAdapter.js @@ -21,7 +21,7 @@ function isBidRequestValid(bid) { return false; } - return !!bid.params.domainId; + return !!bid.params.domainId && !!bid.params.placement; } /** @@ -160,7 +160,7 @@ function getBidData(bid) { deviceUa: bid.ortb2?.device?.ua, domain: bid.ortb2?.site?.publisher?.domain, domainId: bid.params.domainId, - placement: bid.params.placement || '', + placement: bid.params.placement, code: bid.adUnitCode }; diff --git a/modules/adgridBidAdapter.md b/modules/adgridBidAdapter.md index 94eda01e895..205c6ca31bf 100644 --- a/modules/adgridBidAdapter.md +++ b/modules/adgridBidAdapter.md @@ -23,7 +23,8 @@ var adUnits = [ bids: [{ bidder: 'adgrid', params: { - domainId: 12345 + domainId: 12345, + placement: 'leaderboard' } }] }, @@ -37,7 +38,8 @@ var adUnits = [ bids: [{ bidder: 'adgrid', params: { - domainId: 67890 + domainId: 67890, + placement: 'adhesion' } }] } diff --git a/test/spec/modules/adgridBidAdapter_spec.js b/test/spec/modules/adgridBidAdapter_spec.js index 0d7ad9c245d..55b80d44b16 100644 --- a/test/spec/modules/adgridBidAdapter_spec.js +++ b/test/spec/modules/adgridBidAdapter_spec.js @@ -16,7 +16,8 @@ describe('AdGrid Bid Adapter', function () { } }, params: { - domainId: 12345 + domainId: 12345, + placement: 'leaderboard' } }]; @@ -32,17 +33,18 @@ describe('AdGrid Bid Adapter', function () { } }, params: { - domainId: 12345 + domainId: 12345, + placement: 'video1' } }]; describe('isBidRequestValid', function () { - it('Should return true when domainId exist inside params object', function () { + it('Should return true when domainId and placement exist inside params object', function () { const isBidValid = spec.isBidRequestValid(bannerRequest[0]); expect(isBidValid).to.be.true; }); - it('Should return false when domainId is not exist inside params object', function () { + it('Should return false when domainId and placement are not exist inside params object', function () { const isBidNotValid = spec.isBidRequestValid(null); expect(isBidNotValid).to.be.false; });