From af21c55ef22382e2ad50c435294298b7ac8e665e Mon Sep 17 00:00:00 2001 From: Nayan Savla Date: Thu, 4 Apr 2024 10:32:21 -0700 Subject: [PATCH] Yieldmo Bid Adapter : support for cookie deprecation label (#11294) * Sending Cdep label in Banner Sending Cdep label in the banner request. * Update yieldmoBidAdapter.js Using deepAccess for consistency. --- modules/yieldmoBidAdapter.js | 9 +++++++++ test/spec/modules/yieldmoBidAdapter_spec.js | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/modules/yieldmoBidAdapter.js b/modules/yieldmoBidAdapter.js index 1bb0488bf5d..fe99adcec5f 100644 --- a/modules/yieldmoBidAdapter.js +++ b/modules/yieldmoBidAdapter.js @@ -77,6 +77,7 @@ export const spec = { let serverRequests = []; const eids = getEids(bidRequests[0]) || []; const topicsData = getTopics(bidderRequest); + const cdep = getCdep(bidderRequest); if (bannerBidRequests.length > 0) { let serverRequest = { pbav: '$prebid.version$', @@ -105,6 +106,9 @@ export const spec = { if (gpc) { serverRequest.gpc = gpc; } + if (cdep) { + serverRequest.cdep = cdep; + } if (canAccessTopWindow()) { serverRequest.pr = (LOCAL_WINDOW.document && LOCAL_WINDOW.document.referrer) || ''; @@ -438,6 +442,11 @@ function getGPCSignal(bidderRequest) { return gpc; } +function getCdep(bidderRequest) { + const cdep = deepAccess(bidderRequest, 'ortb2.device.ext.cdep') || null; + return cdep; +} + 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 3c842c3a308..f37ef9178dd 100644 --- a/test/spec/modules/yieldmoBidAdapter_spec.js +++ b/test/spec/modules/yieldmoBidAdapter_spec.js @@ -414,6 +414,25 @@ describe('YieldmoAdapter', function () { })); }); + it('should add cdep to the banner bid request', function () { + const biddata = build( + [mockBannerBid()], + mockBidderRequest({ + ortb2: { + device: { + ext: { + cdep: 'test_cdep' + }, + }, + }, + }) + ); + + expect(biddata[0].data.cdep).to.equal( + 'test_cdep' + ); + }); + it('should send gpc in the banner bid request', function () { const biddata = build( [mockBannerBid()],