From db589b0d5a82c27292b5edb839f210ef4be44b76 Mon Sep 17 00:00:00 2001 From: Martin Lopez Date: Wed, 10 Apr 2024 10:18:22 +1200 Subject: [PATCH] Added cdep (Cookie Deprecation Label) to openrtb2 object --- modules/stroeerCoreBidAdapter.js | 6 ++++++ .../modules/stroeerCoreBidAdapter_spec.js | 21 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/modules/stroeerCoreBidAdapter.js b/modules/stroeerCoreBidAdapter.js index b51313362f0..0939707087b 100644 --- a/modules/stroeerCoreBidAdapter.js +++ b/modules/stroeerCoreBidAdapter.js @@ -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); diff --git a/test/spec/modules/stroeerCoreBidAdapter_spec.js b/test/spec/modules/stroeerCoreBidAdapter_spec.js index 08b63e6cc34..aed5bd275ef 100644 --- a/test/spec/modules/stroeerCoreBidAdapter_spec.js +++ b/test/spec/modules/stroeerCoreBidAdapter_spec.js @@ -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); + }); }); });