diff --git a/emx-digital/emx-digital-htb-system-tests.js b/emx-digital/emx-digital-htb-system-tests.js index 30d0827d..8795fa84 100644 --- a/emx-digital/emx-digital-htb-system-tests.js +++ b/emx-digital/emx-digital-htb-system-tests.js @@ -191,6 +191,12 @@ function validateBidRequestWithPrivacy(request) { expect(req.user.ext.consent).toBe('TEST_GDPR_CONSENT_STRING'); } +function validateBidRequestWithTcf2(request) { + var req = JSON.parse(request.body); + expect(req.regs.ext.gdpr).toBe(1); + expect(req.user.ext.consent).toBe('TEST_TCF2_CONSENT_STRING'); +} + function getPassResponse(request) { var response = { request: request }; @@ -210,5 +216,6 @@ module.exports = { getPassResponse: getPassResponse, getValidResponseWithDeal: getValidResponseWithDeal, validateTargetingWithDeal: validateTargetingWithDeal, - validateBidRequestWithPrivacy: validateBidRequestWithPrivacy + validateBidRequestWithPrivacy: validateBidRequestWithPrivacy, + validateBidRequestWithTcf2: validateBidRequestWithTcf2 }; diff --git a/emx-digital/emx-digital-htb.js b/emx-digital/emx-digital-htb.js index 72e00529..55750c27 100644 --- a/emx-digital/emx-digital-htb.js +++ b/emx-digital/emx-digital-htb.js @@ -177,6 +177,23 @@ function BRealTimeHtb(configs) { /* eslint-enable camelcase */ } + // Passing liveramp uids in the user ext field + if (returnParcels + && returnParcels.length + && returnParcels[0].identityData + && returnParcels[0].identityData.LiveRampIp + && returnParcels[0].identityData.LiveRampIp.data) { + if (__emxData.user && __emxData.user.ext) { + __emxData.user.ext.eids = returnParcels[0].identityData.LiveRampIp.data; + } else { + __emxData.user = { + ext: { + eids: returnParcels[0].identityData.LiveRampIp.data + } + }; + } + } + /* -------------------------------------------------------------------------- */ return {