diff --git a/modules/identityLinkIdSystem.js b/modules/identityLinkIdSystem.js index a269799e92a..ffbfe466035 100644 --- a/modules/identityLinkIdSystem.js +++ b/modules/identityLinkIdSystem.js @@ -28,16 +28,19 @@ export const identityLinkSubmodule = { /** * performs action to obtain id and return a value in the callback's response argument * @function + * @param {ConsentData} [consentData] * @param {SubmoduleParams} [configParams] * @returns {IdResponse|undefined} */ - getId(configParams) { + getId(configParams, consentData) { if (!configParams || typeof configParams.pid !== 'string') { utils.logError('identityLink submodule requires partner id to be defined'); return; } + const hasGdpr = (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) ? 1 : 0; + const gdprConsentString = hasGdpr ? consentData.consentString : ''; // use protocol relative urls for http or https - const url = `https://api.rlcdn.com/api/identity/envelope?pid=${configParams.pid}`; + const url = `https://api.rlcdn.com/api/identity/envelope?pid=${configParams.pid}${hasGdpr ? '&ct=1&cv=' + gdprConsentString : ''}`; let resp; // if ats library is initialised, use it to retrieve envelope. If not use standard third party endpoint if (window.ats) {