From d67ed8f74f1f36a9f3786b0c5afb633682900470 Mon Sep 17 00:00:00 2001 From: Nick Colletti Date: Tue, 7 Jan 2020 11:00:06 -0500 Subject: [PATCH 1/5] Add US CCPA Support --- emx-digital/CHANGES.md | 3 +++ emx-digital/emx-digital-htb-system-tests.js | 11 ++++++++++- emx-digital/emx-digital-htb.js | 14 ++++++++++---- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/emx-digital/CHANGES.md b/emx-digital/CHANGES.md index 0f486d98..ed3d02b1 100644 --- a/emx-digital/CHANGES.md +++ b/emx-digital/CHANGES.md @@ -1,2 +1,5 @@ +# 1.1.0 +- Adds support for CCPA (US Privacy) + # 1.0.0 - Bidder added to support latest EMX Exchange. \ No newline at end of file diff --git a/emx-digital/emx-digital-htb-system-tests.js b/emx-digital/emx-digital-htb-system-tests.js index 07545224..6052cc9e 100644 --- a/emx-digital/emx-digital-htb-system-tests.js +++ b/emx-digital/emx-digital-htb-system-tests.js @@ -185,6 +185,14 @@ function validateTargetingWithDeal(targetingMap) { })); } +function validateBidRequestWithPrivacy(request) { + var r = request.query; + expect(r.gdpr).toBe('1'); + expect(r.gdpr_consent).toBe('TEST_GDPR_CONSENT_STRING'); + expect(r.us_privacy).toBeDefined(); + expect(r.us_privacy).toBe('1YNN'); +} + function getPassResponse(request) { var response = { request: request }; @@ -203,5 +211,6 @@ module.exports = { getValidResponse: getValidResponse, getPassResponse: getPassResponse, getValidResponseWithDeal: getValidResponseWithDeal, - validateTargetingWithDeal: validateTargetingWithDeal + validateTargetingWithDeal: validateTargetingWithDeal, + validateBidRequestWithPrivacy: validateBidRequestWithPrivacy }; diff --git a/emx-digital/emx-digital-htb.js b/emx-digital/emx-digital-htb.js index e1337d42..924a6be5 100644 --- a/emx-digital/emx-digital-htb.js +++ b/emx-digital/emx-digital-htb.js @@ -93,7 +93,7 @@ function BRealTimeHtb(configs) { */ function __generateRequestObj(returnParcels) { var timeout = SpaceCamp.globalTimeout || 1500; - var version = '1.0.0'; + var version = '1.1.0'; var timestamp = System.now(); var baseUrl = Browser.getProtocol() + __endpoint + ('?t=' + timeout + '&ts=' + timestamp); @@ -102,8 +102,9 @@ function BRealTimeHtb(configs) { var pageUrl = Browser.getPageUrl(); var pageHost = Browser.getHostname(); var callbackId = System.generateUniqueId(); + var privacyEnabled = ComplianceService.isPrivacyEnabled(); var gdprStatus = ComplianceService.gdpr.getConsent(); - var gdprPrivacyEnabled = ComplianceService.isPrivacyEnabled(); + var ccpaStatus = ComplianceService.usp && ComplianceService.usp.getConsent(); /* ============================================================================= * STEP 2 | Generate Request URL @@ -151,7 +152,7 @@ function BRealTimeHtb(configs) { } }; - if (gdprPrivacyEnabled) { + if (privacyEnabled) { /* eslint-disable camelcase */ if (gdprStatus.hasOwnProperty('consentString')) { __emxData.user = { @@ -160,7 +161,6 @@ function BRealTimeHtb(configs) { } }; } - /* eslint-enable camelcase */ if (gdprStatus.hasOwnProperty('applies')) { __emxData.regs = { @@ -169,6 +169,12 @@ function BRealTimeHtb(configs) { } }; } + + if (ccpaStatus) { + __emxData.us_privacy = ccpaStatus; + } + + /* eslint-enable camelcase */ } /* -------------------------------------------------------------------------- */ From d584bbfa127ac0bdee90c7ea84908ddd68018b46 Mon Sep 17 00:00:00 2001 From: Nick Colletti Date: Tue, 7 Jan 2020 11:12:40 -0500 Subject: [PATCH 2/5] fix tests --- emx-digital/emx-digital-htb-system-tests.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/emx-digital/emx-digital-htb-system-tests.js b/emx-digital/emx-digital-htb-system-tests.js index 6052cc9e..30d0827d 100644 --- a/emx-digital/emx-digital-htb-system-tests.js +++ b/emx-digital/emx-digital-htb-system-tests.js @@ -186,11 +186,9 @@ function validateTargetingWithDeal(targetingMap) { } function validateBidRequestWithPrivacy(request) { - var r = request.query; - expect(r.gdpr).toBe('1'); - expect(r.gdpr_consent).toBe('TEST_GDPR_CONSENT_STRING'); - expect(r.us_privacy).toBeDefined(); - expect(r.us_privacy).toBe('1YNN'); + var req = JSON.parse(request.body); + expect(req.regs.ext.gdpr).toBe(1); + expect(req.user.ext.consent).toBe('TEST_GDPR_CONSENT_STRING'); } function getPassResponse(request) { From be027c679abec1eea3bf78e08d9dfd3838c0a301 Mon Sep 17 00:00:00 2001 From: Nick Colletti Date: Wed, 5 Feb 2020 11:45:04 -0500 Subject: [PATCH 3/5] target ccpa string --- emx-digital/emx-digital-htb.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emx-digital/emx-digital-htb.js b/emx-digital/emx-digital-htb.js index 924a6be5..72e00529 100644 --- a/emx-digital/emx-digital-htb.js +++ b/emx-digital/emx-digital-htb.js @@ -170,8 +170,8 @@ function BRealTimeHtb(configs) { }; } - if (ccpaStatus) { - __emxData.us_privacy = ccpaStatus; + if (ccpaStatus && ccpaStatus.hasOwnProperty('uspString')) { + __emxData.us_privacy = ccpaStatus.uspString; } /* eslint-enable camelcase */ From b36e66a464dffbe6fda0d87a1c5500b8be47e6a1 Mon Sep 17 00:00:00 2001 From: Rakesh Balakrishnan Date: Thu, 20 Aug 2020 10:27:53 -0700 Subject: [PATCH 4/5] Adding TCF2 test case --- emx-digital/emx-digital-htb-system-tests.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 }; From d56f687789abfa5bf7349d8eb5b8885546fb6525 Mon Sep 17 00:00:00 2001 From: Rakesh Balakrishnan Date: Tue, 13 Jul 2021 12:20:20 -0700 Subject: [PATCH 5/5] Adding liveramp uid support --- emx-digital/emx-digital-htb.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 {