From 36a65cb5649016a082e5b51c77f81f4e43d450d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Dur=C3=A1n?= Date: Wed, 4 Dec 2019 16:11:23 -0800 Subject: [PATCH 1/5] Send parameter indicating the protocol of the requesting page - `secure` parameter will equal `true` if the requesting page uses `https` and `false` if `http` is used Story: [#169824528](https://www.pivotaltracker.com/story/show/169824528) --- share-through/share-through-htb.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/share-through/share-through-htb.js b/share-through/share-through-htb.js index 87a299f4..ef66d40c 100644 --- a/share-through/share-through-htb.js +++ b/share-through/share-through-htb.js @@ -83,7 +83,7 @@ function ShareThroughHtb(configs) { * @return {object} */ function __generateRequestObj(returnParcels) { - var baseUrl = Browser.getProtocol() + '//btlr.sharethrough.com/t6oivhQt/v1'; + var baseUrl = 'https://btlr.sharethrough.com/t6oivhQt/v1'; var queryObj = { placement_key: returnParcels[0].xSlotRef.placementKey, @@ -94,6 +94,9 @@ function ShareThroughHtb(configs) { cbust: System.now() }; + var nonHttp = __getProtocol().indexOf('http') < 0; + queryObj.secure = nonHttp || (__getProtocol().indexOf('https') > -1); + var unifiedID = __getUnifiedID(returnParcels); if (unifiedID) { queryObj.ttduid = unifiedID; @@ -160,6 +163,10 @@ function ShareThroughHtb(configs) { } } + function __getProtocol() { + return document.location.protocol; + } + /* ============================================================================= * STEP 5 | Rendering Pixel * ----------------------------------------------------------------------------- @@ -385,7 +392,8 @@ function ShareThroughHtb(configs) { __baseClass = Partner(__profile, configs, null, { parseResponse: __parseResponse, generateRequestObj: __generateRequestObj, - b64EncodeUnicode: __b64EncodeUnicode + b64EncodeUnicode: __b64EncodeUnicode, + getProtocol: __getProtocol }); })(); From 1291b8d5eaeb6251f632de5caf273d8a2c0f4c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Dur=C3=A1n?= Date: Wed, 4 Dec 2019 21:01:39 -0800 Subject: [PATCH 2/5] Increment version --- share-through/CHANGES.md | 4 ++++ share-through/DOCUMENTATION.md | 2 +- share-through/share-through-htb-system-tests.js | 2 +- share-through/share-through-htb.js | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/share-through/CHANGES.md b/share-through/CHANGES.md index d848e8b4..646008a0 100644 --- a/share-through/CHANGES.md +++ b/share-through/CHANGES.md @@ -1,3 +1,7 @@ +# 2.2.0 +- Use an `https` endpoint +- Send `secure` param + # 2.1.2 - Add support for Unified ID in `__generateRequestObj` function of adapter code diff --git a/share-through/DOCUMENTATION.md b/share-through/DOCUMENTATION.md index 3767f24a..004b487e 100644 --- a/share-through/DOCUMENTATION.md +++ b/share-through/DOCUMENTATION.md @@ -50,7 +50,7 @@ bidId: "_fakeBidId", instant_play_capable: "true", hbSource: "indexExchange", - hbVersion: "2.1.2", + hbVersion: "2.2.0", cbust: System.now() }; ``` diff --git a/share-through/share-through-htb-system-tests.js b/share-through/share-through-htb-system-tests.js index e0c3f7e6..ddb176ee 100644 --- a/share-through/share-through-htb-system-tests.js +++ b/share-through/share-through-htb-system-tests.js @@ -44,7 +44,7 @@ function validateBidRequest(request) { expect(queryObj.placement_key).toEqual("abc123"); expect(queryObj.instant_play_capable).toBeDefined(); expect(queryObj.hbSource).toEqual("indexExchange"); - expect(queryObj.hbVersion).toEqual("2.1.2"); + expect(queryObj.hbVersion).toEqual("2.2.0"); expect(queryObj.cbust).toBeDefined(); expect(queryObj.consent_required).toEqual("false"); } diff --git a/share-through/share-through-htb.js b/share-through/share-through-htb.js index ef66d40c..6eb4dba2 100644 --- a/share-through/share-through-htb.js +++ b/share-through/share-through-htb.js @@ -90,7 +90,7 @@ function ShareThroughHtb(configs) { bidId: returnParcels[0].requestId, instant_play_capable: __canAutoPlayHTML5Video(), hbSource: "indexExchange", - hbVersion: "2.1.2", + hbVersion: "2.2.0", cbust: System.now() }; @@ -352,7 +352,7 @@ function ShareThroughHtb(configs) { partnerId: 'ShareThroughHtb', // PartnerName namespace: 'ShareThroughHtb', // Should be same as partnerName statsId: 'SHTH', // Unique partner identifier - version: '2.1.2', + version: '2.2.0', targetingType: 'slot', enabledAnalytics: { requestTime: true From 6d5ab4379db32b2633b5655c4d931413f8482c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Dur=C3=A1n?= Date: Wed, 4 Dec 2019 22:01:19 -0800 Subject: [PATCH 3/5] Update specs --- share-through/share-through-htb-system-tests.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share-through/share-through-htb-system-tests.js b/share-through/share-through-htb-system-tests.js index ddb176ee..7d9b0eeb 100644 --- a/share-through/share-through-htb-system-tests.js +++ b/share-through/share-through-htb-system-tests.js @@ -10,7 +10,7 @@ function getStatsId() { function getBidRequestRegex() { return { method: "GET", - urlRegex: /.*btlr\.sharethrough\.com\/t6oivhQt\/.*/ + urlRegex: /https:\/\/btlr\.sharethrough\.com\/t6oivhQt\/.*/ }; } @@ -47,6 +47,7 @@ function validateBidRequest(request) { expect(queryObj.hbVersion).toEqual("2.2.0"); expect(queryObj.cbust).toBeDefined(); expect(queryObj.consent_required).toEqual("false"); + expect(queryObj.secure).toBeDefined(); } function validateBidRequestWithPrivacy(request) { From 48409309882165f102a24864126d44cdb89ba877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Dur=C3=A1n?= Date: Wed, 4 Dec 2019 22:35:04 -0800 Subject: [PATCH 4/5] Cleanup --- share-through/share-through-htb-system-tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share-through/share-through-htb-system-tests.js b/share-through/share-through-htb-system-tests.js index 7d9b0eeb..666793f8 100644 --- a/share-through/share-through-htb-system-tests.js +++ b/share-through/share-through-htb-system-tests.js @@ -69,7 +69,7 @@ function getValidResponse(request, creative) { creatives: [ { adm: creative, - cpm: 2, + cpm: 2 } ] }); From 1967ee47a666e40a4ec0ed1dbd8eee8467fae793 Mon Sep 17 00:00:00 2001 From: ix-certification Date: Fri, 28 Feb 2020 14:19:16 -0500 Subject: [PATCH 5/5] EMX: Add CCPA Suport (#147) (#172) * Add US CCPA Support * fix tests * target ccpa string Co-authored-by: Nicholas Colletti <34142758+ncolletti@users.noreply.github.com> --- emx-digital/CHANGES.md | 3 +++ emx-digital/emx-digital-htb-system-tests.js | 9 ++++++++- emx-digital/emx-digital-htb.js | 14 ++++++++++---- 3 files changed, 21 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..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 */ } /* -------------------------------------------------------------------------- */