Skip to content

Commit

Permalink
IdentityLink - add logic for sending consent string (#4346)
Browse files Browse the repository at this point in the history
  • Loading branch information
mamatic authored and Isaac A. Dettman committed Oct 30, 2019
1 parent 9409959 commit 1231f72
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/identityLinkIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1231f72

Please sign in to comment.