diff --git a/modules/improvedigitalBidAdapter.js b/modules/improvedigitalBidAdapter.js index 1a523c0294f..a68e90754fb 100644 --- a/modules/improvedigitalBidAdapter.js +++ b/modules/improvedigitalBidAdapter.js @@ -90,6 +90,7 @@ export const spec = { // End of adding first party data requestParameters.schain = bidRequests[0].schain; + requestParameters.coppa = config.getConfig('coppa') === true; if (bidRequests[0].userId) { const eids = createEidsArray(bidRequests[0].userId); @@ -652,6 +653,10 @@ export function ImproveDigitalAdServerJSClient(endPoint) { } } + if (requestParameters.coppa) { + impressionBidRequestObject.coppa = 1; + } + return impressionBidRequestObject; }; diff --git a/test/spec/modules/improvedigitalBidAdapter_spec.js b/test/spec/modules/improvedigitalBidAdapter_spec.js index 7d6099e0de6..6fe50183cda 100644 --- a/test/spec/modules/improvedigitalBidAdapter_spec.js +++ b/test/spec/modules/improvedigitalBidAdapter_spec.js @@ -557,6 +557,25 @@ describe('Improve Digital Adapter Tests', function () { ] ); }); + + it('should set coppa', function() { + sinon.stub(config, 'getConfig') + .withArgs('coppa') + .returns(true); + const bidRequest = Object.assign({}, simpleBidRequest); + const request = spec.buildRequests([bidRequest], bidderRequestReferrer)[0]; + const params = JSON.parse(decodeURIComponent(request.data.substring(PARAM_PREFIX.length))); + expect(params.bid_request.coppa).to.equal(1); + + config.getConfig.restore(); + }); + + it('should undefined coppa', function() { + const bidRequest = Object.assign({}, simpleBidRequest); + const request = spec.buildRequests([bidRequest], bidderRequestReferrer)[0]; + const params = JSON.parse(decodeURIComponent(request.data.substring(PARAM_PREFIX.length))); + expect(params.bid_request.coppa).to.equal(undefined); + }); }); const serverResponse = {