diff --git a/modules/quantcastBidAdapter.js b/modules/quantcastBidAdapter.js index f10fd48502f..3639a5a6bb7 100644 --- a/modules/quantcastBidAdapter.js +++ b/modules/quantcastBidAdapter.js @@ -41,9 +41,10 @@ export const spec = { * `BidRequests`. * * @param {BidRequest[]} bidRequests A non-empty list of bid requests which should be send to Quantcast server + * @param bidderRequest * @return ServerRequest information describing the request to the server. */ - buildRequests(bidRequests) { + buildRequests(bidRequests, bidderRequest) { const bids = bidRequests || []; const referrer = utils.getTopWindowUrl(); @@ -75,6 +76,8 @@ export const spec = { }); }); + const gdprConsent = bidderRequest ? bidderRequest.gdprConsent : {}; + // Request Data Format can be found at https://wiki.corp.qc/display/adinf/QCX const requestData = { publisherId: bid.params.publisherId, @@ -94,7 +97,9 @@ export const spec = { referrer, domain }, - bidId: bid.bidId + bidId: bid.bidId, + gdprSignal: gdprConsent.gdprApplies ? 1 : 0, + gdprConsent: gdprConsent.consentString }; const data = JSON.stringify(requestData); diff --git a/modules/quantcastBidAdapter.md b/modules/quantcastBidAdapter.md index 20cf25bffbf..efc21466c75 100644 --- a/modules/quantcastBidAdapter.md +++ b/modules/quantcastBidAdapter.md @@ -3,7 +3,7 @@ ``` Module Name: Quantcast Bidder Adapter Module Type: Bidder Adapter -Maintainer: xli@quantcast.com +Maintainer: igor.soarez@quantcast.com ``` # Description @@ -28,4 +28,4 @@ const adUnits = [{ } ] }]; -``` \ No newline at end of file +``` diff --git a/test/spec/modules/quantcastBidAdapter_spec.js b/test/spec/modules/quantcastBidAdapter_spec.js index 6fd5c3abdf9..f6e2924515c 100644 --- a/test/spec/modules/quantcastBidAdapter_spec.js +++ b/test/spec/modules/quantcastBidAdapter_spec.js @@ -129,13 +129,22 @@ describe('Quantcast adapter', () => { referrer, domain }, - bidId: '2f7b179d443f14' + bidId: '2f7b179d443f14', + gdprSignal: 0 }; expect(requests[0].data).to.equal(JSON.stringify(expectedBidRequest)); }); }); + it('propagates GDPR consent string and signal', () => { + const gdprConsent = { gdprApplies: true, consentString: 'consentString' } + const requests = qcSpec.buildRequests([bidRequest], { gdprConsent }); + const parsed = JSON.parse(requests[0].data) + expect(parsed.gdprSignal).to.equal(1); + expect(parsed.gdprConsent).to.equal(gdprConsent.consentString); + }); + describe('`interpretResponse`', () => { // The sample response is from https://wiki.corp.qc/display/adinf/QCX const body = {