Skip to content

Commit

Permalink
Yieldmo Bid Adapter : support for cookie deprecation label (prebid#11294
Browse files Browse the repository at this point in the history
)

* Sending Cdep label in Banner

Sending Cdep label in the banner request.

* Update yieldmoBidAdapter.js

Using deepAccess for consistency.
  • Loading branch information
desidiver authored and mefjush committed Apr 8, 2024
1 parent 30a0fbd commit 9d87f8a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/yieldmoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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$',
Expand Down Expand Up @@ -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) || '';
Expand Down Expand Up @@ -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) => {
Expand Down
19 changes: 19 additions & 0 deletions test/spec/modules/yieldmoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()],
Expand Down

0 comments on commit 9d87f8a

Please sign in to comment.