diff --git a/modules/yieldmoBidAdapter.js b/modules/yieldmoBidAdapter.js index 3dd5baf771a..7fee4af422c 100644 --- a/modules/yieldmoBidAdapter.js +++ b/modules/yieldmoBidAdapter.js @@ -100,6 +100,10 @@ export const spec = { if (topicsData) { serverRequest.topics = topicsData; } + const gpc = getGPCSignal(bidderRequest); + if (gpc) { + serverRequest.gpc = gpc; + } if (canAccessTopWindow()) { serverRequest.pr = (LOCAL_WINDOW.document && LOCAL_WINDOW.document.referrer) || ''; @@ -417,7 +421,10 @@ function openRtbRequest(bidRequests, bidderRequest) { if (schain) { openRtbRequest.schain = schain; } - + const gpc = getGPCSignal(bidderRequest); + if (gpc) { + deepSetValue(openRtbRequest, 'regs.ext.gpc', gpc); + } if (bidRequests[0].auctionId) { openRtbRequest.auctionId = bidRequests[0].auctionId; } @@ -425,6 +432,11 @@ function openRtbRequest(bidRequests, bidderRequest) { return openRtbRequest; } +function getGPCSignal(bidderRequest) { + const gpc = deepAccess(bidderRequest, 'ortb2.regs.ext.gpc'); + return gpc; +} + function getTopics(bidderRequest) { const userData = deepAccess(bidderRequest, 'ortb2.user.data') || []; const topicsData = userData.filter((dataObj) => { diff --git a/test/spec/modules/yieldmoBidAdapter_spec.js b/test/spec/modules/yieldmoBidAdapter_spec.js index 6d68ee79170..43daa9aca41 100644 --- a/test/spec/modules/yieldmoBidAdapter_spec.js +++ b/test/spec/modules/yieldmoBidAdapter_spec.js @@ -413,6 +413,22 @@ describe('YieldmoAdapter', function () { }); }); + it('should send gpc in the banner bid request', function () { + const biddata = build( + [mockBannerBid()], + mockBidderRequest({ + ortb2: { + regs: { + ext: { + gpc: '1' + }, + }, + }, + }) + ); + expect(biddata[0].data.gpc).to.equal('1'); + }); + it('should add eids to the banner bid request', function () { const params = { userIdAsEids: [{ @@ -667,6 +683,23 @@ describe('YieldmoAdapter', function () { }); }); + it('should send gpc in the bid request', function () { + let videoBidder = mockBidderRequest( + { + ortb2: { + regs: { + ext: { + gpc: '1', + }, + }, + }, + }, + [mockVideoBid()] + ); + let payload = buildAndGetData([mockVideoBid()], 0, videoBidder); + expect(payload.regs.ext.gpc).to.equal('1'); + }); + it('should add device info to payload if available', function () { let videoBidder = mockBidderRequest({ ortb2: { device: {