Skip to content

Commit

Permalink
identityLinkIdSystem - liveramp - bug fix setting tcf consent string …
Browse files Browse the repository at this point in the history
…in 3p call (#10778)
  • Loading branch information
mamatic authored Dec 1, 2023
1 parent 2de3f87 commit 16133c5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
3 changes: 1 addition & 2 deletions modules/identityLinkIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export const identityLinkSubmodule = {
}
const hasGdpr = (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) ? 1 : 0;
const gdprConsentString = hasGdpr ? consentData.consentString : '';
const tcfPolicyV2 = utils.deepAccess(consentData, 'vendorData.tcfPolicyVersion') === 2;
// use protocol relative urls for http or https
if (hasGdpr && (!gdprConsentString || gdprConsentString === '')) {
utils.logInfo('identityLink: Consent string is required to call envelope API.');
Expand All @@ -64,7 +63,7 @@ export const identityLinkSubmodule = {
const gppString = gppData && gppData.gppString ? gppData.gppString : false;
const gppSectionId = gppData && gppData.gppString && gppData.applicableSections.length > 0 && gppData.applicableSections[0] !== -1 ? gppData.applicableSections[0] : false;
const hasGpp = gppString && gppSectionId;
const url = `https://api.rlcdn.com/api/identity/envelope?pid=${configParams.pid}${hasGdpr ? (tcfPolicyV2 ? '&ct=4&cv=' : '&ct=1&cv=') + gdprConsentString : ''}${hasGpp ? '&gpp=' + gppString + '&gpp_sid=' + gppSectionId : ''}`;
const url = `https://api.rlcdn.com/api/identity/envelope?pid=${configParams.pid}${hasGdpr ? '&ct=4&cv=' + gdprConsentString : ''}${hasGpp ? '&gpp=' + gppString + '&gpp_sid=' + gppSectionId : ''}`;
let resp;
resp = function (callback) {
// Check ats during callback so it has a chance to initialise.
Expand Down
18 changes: 0 additions & 18 deletions test/spec/modules/identityLinkIdSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,6 @@ describe('IdentityLinkId tests', function () {
expect(submoduleCallback).to.be.undefined;
});

it('should call the LiveRamp envelope endpoint with IAB consent string v1', function () {
let callBackSpy = sinon.spy();
let consentData = {
gdprApplies: true,
consentString: 'BOkIpDSOkIpDSADABAENCc-AAAApOAFAAMAAsAMIAcAA_g'
};
let submoduleCallback = identityLinkSubmodule.getId(defaultConfigParams, consentData).callback;
submoduleCallback(callBackSpy);
let request = server.requests[0];
expect(request.url).to.be.eq('https://api.rlcdn.com/api/identity/envelope?pid=14&ct=1&cv=BOkIpDSOkIpDSADABAENCc-AAAApOAFAAMAAsAMIAcAA_g');
request.respond(
200,
responseHeader,
JSON.stringify({})
);
expect(callBackSpy.calledOnce).to.be.true;
});

it('should call the LiveRamp envelope endpoint with IAB consent string v2', function () {
let callBackSpy = sinon.spy();
let consentData = {
Expand Down

0 comments on commit 16133c5

Please sign in to comment.