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..30d0827d 100644 --- a/emx-digital/emx-digital-htb-system-tests.js +++ b/emx-digital/emx-digital-htb-system-tests.js @@ -185,6 +185,12 @@ function validateTargetingWithDeal(targetingMap) { })); } +function validateBidRequestWithPrivacy(request) { + 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) { var response = { request: request }; @@ -203,5 +209,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..72e00529 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 && ccpaStatus.hasOwnProperty('uspString')) { + __emxData.us_privacy = ccpaStatus.uspString; + } + + /* eslint-enable camelcase */ } /* -------------------------------------------------------------------------- */