From 66c4e7b46121afc5331c8bca6e2fc972fc55f090 Mon Sep 17 00:00:00 2001 From: YakirLavi <73641910+YakirLavi@users.noreply.github.com> Date: Thu, 20 Apr 2023 17:26:39 +0300 Subject: [PATCH] MinuteMedia Bid Adapter: support Coppa param (#25) --- modules/minutemediaBidAdapter.js | 4 ++++ test/spec/modules/minutemediaBidAdapter_spec.js | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/modules/minutemediaBidAdapter.js b/modules/minutemediaBidAdapter.js index a80a37f5ead..82eb48a5a2b 100644 --- a/modules/minutemediaBidAdapter.js +++ b/modules/minutemediaBidAdapter.js @@ -428,5 +428,9 @@ function generateGeneralParams(generalObject, bidderRequest) { generalParams.page_url = deepAccess(bidderRequest, 'refererInfo.page') || window.location.href } + if (config.getConfig('coppa') === true) { + generalParams.coppa = 1; + } + return generalParams } diff --git a/test/spec/modules/minutemediaBidAdapter_spec.js b/test/spec/modules/minutemediaBidAdapter_spec.js index bbd23918031..ca1c237914d 100644 --- a/test/spec/modules/minutemediaBidAdapter_spec.js +++ b/test/spec/modules/minutemediaBidAdapter_spec.js @@ -293,6 +293,20 @@ describe('minutemediaAdapter', function () { expect(request.data.bids[0]).to.be.an('object'); expect(request.data.bids[0]).to.have.property('floorPrice', 1.5); }); + + describe('COPPA param', function () { + it('should add COPPA param to payload when COPPA equal to true', function () { + config.setConfig({ coppa: true }); + const request = spec.buildRequests(bidRequests, bidderRequest); + expect(request.data.params.coppa).to.equal(1); + }); + + it('should not add COPPA param to payload when prebid config has parameter COPPA equal to false', function () { + config.setConfig({ coppa: false }); + const request = spec.buildRequests(bidRequests, bidderRequest); + expect(request.data.params.coppa).to.be.undefined; + }); + }) }); describe('interpretResponse', function () {