Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yieldmo Bid Adapter : support for cookie deprecation label #11294

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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