Skip to content

Commit

Permalink
Added cdep (Cookie Deprecation Label) to openrtb2 object
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinLopez14 committed Apr 15, 2024
1 parent 8785038 commit db589b0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/stroeerCoreBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ export const spec = {
utils.deepSetValue(commonPayload, DSA_KEY, dsa);
}

const COOKIE_DEPRECATION_LABEL_KEY = 'ortb2.device.ext.cdep';
const cdep = utils.deepAccess(bidderRequest, COOKIE_DEPRECATION_LABEL_KEY);
if (cdep) {
utils.deepSetValue(commonPayload, COOKIE_DEPRECATION_LABEL_KEY, cdep);
}

const serverRequestInfos = [];
const endpointUrl = buildUrl(anyBid.params);

Expand Down
21 changes: 21 additions & 0 deletions test/spec/modules/stroeerCoreBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,27 @@ describe('stroeerCore bid adapter', function () {

assert.deepEqual(sentOrtb2, ortb2);
});

it('should add the Cookie Deprecation Label', () => {
const bidReq = buildBidderRequest();

const cDepObj = {
cdep: 'example_label_1'
};

const ortb2 = {
device: {
ext: cDepObj
}
};

bidReq.ortb2 = utils.deepClone(ortb2);

const serverRequestInfo = spec.buildRequests(bidReq.bids, bidReq)[0];
const sentOrtb2 = serverRequestInfo.data.ortb2;

assert.deepEqual(sentOrtb2, ortb2);
});
});
});

Expand Down

0 comments on commit db589b0

Please sign in to comment.