diff --git a/modules/connectIdSystem.js b/modules/connectIdSystem.js index 24ef8ad0af5..38c9c00b0ed 100644 --- a/modules/connectIdSystem.js +++ b/modules/connectIdSystem.js @@ -66,6 +66,11 @@ export const connectIdSubmodule = { us_privacy: consentData && consentData.uspConsent ? consentData.uspConsent : '' }; + if (connectIdSubmodule.isUnderGPPJurisdiction(consentData)) { + data.gpp = consentData.gppConsent.gppString; + data.gpp_sid = encodeURIComponent(consentData.gppConsent.applicableSections.join(',')); + } + INPUT_PARAM_KEYS.forEach(key => { if (typeof params[key] != 'undefined') { data[key] = params[key]; @@ -98,7 +103,7 @@ export const connectIdSubmodule = { }, /** - * Utility function that returns a boolean flag indicating if the opporunity + * Utility function that returns a boolean flag indicating if the opportunity * is subject to GDPR * @returns {Boolean} */ @@ -106,6 +111,15 @@ export const connectIdSubmodule = { return !!(consentData && consentData.gdpr && consentData.gdpr.gdprApplies); }, + /** + * Utility function that returns a boolean flag indicating if the opportunity + * is subject to GPP jurisdiction. + * @returns {Boolean} + */ + isUnderGPPJurisdiction(consentData) { + return !!(consentData && consentData.gppConsent && consentData.gppConsent.gppString); + }, + /** * Utility function that returns a boolean flag indicating if the user * has opeted out via the Yahoo easy-opt-out mechanism. diff --git a/test/spec/modules/connectIdSystem_spec.js b/test/spec/modules/connectIdSystem_spec.js index b2193f350ce..52639c39baf 100644 --- a/test/spec/modules/connectIdSystem_spec.js +++ b/test/spec/modules/connectIdSystem_spec.js @@ -31,7 +31,11 @@ describe('Yahoo ConnectID Submodule', () => { gdprApplies: 1, consentString: 'GDPR_CONSENT_STRING' }, - uspConsent: 'USP_CONSENT_STRING' + uspConsent: 'USP_CONSENT_STRING', + gppConsent: { + gppString: 'header~section6~section7', + applicableSections: [6, 7] + } }; }); @@ -157,7 +161,9 @@ describe('Yahoo ConnectID Submodule', () => { '1p': '0', gdpr: '1', gdpr_consent: consentData.gdpr.consentString, - us_privacy: consentData.uspConsent + us_privacy: consentData.uspConsent, + gpp: consentData.gppConsent.gppString, + gpp_sid: '6%2C7' }; const requestQueryParams = parseQS(ajaxStub.firstCall.args[0].split('?')[1]); @@ -178,7 +184,9 @@ describe('Yahoo ConnectID Submodule', () => { '1p': '0', gdpr: '1', gdpr_consent: consentData.gdpr.consentString, - us_privacy: consentData.uspConsent + us_privacy: consentData.uspConsent, + gpp: consentData.gppConsent.gppString, + gpp_sid: '6%2C7' }; const requestQueryParams = parseQS(ajaxStub.firstCall.args[0].split('?')[1]); @@ -201,7 +209,9 @@ describe('Yahoo ConnectID Submodule', () => { '1p': '0', gdpr: '1', gdpr_consent: consentData.gdpr.consentString, - us_privacy: consentData.uspConsent + us_privacy: consentData.uspConsent, + gpp: consentData.gppConsent.gppString, + gpp_sid: '6%2C7' }; const requestQueryParams = parseQS(ajaxStub.firstCall.args[0].split('?')[1]); @@ -221,7 +231,9 @@ describe('Yahoo ConnectID Submodule', () => { '1p': '0', gdpr: '1', gdpr_consent: consentData.gdpr.consentString, - us_privacy: consentData.uspConsent + us_privacy: consentData.uspConsent, + gpp: consentData.gppConsent.gppString, + gpp_sid: '6%2C7' }; const requestQueryParams = parseQS(ajaxStub.firstCall.args[0].split('?')[1]);