Skip to content

Commit cbe5876

Browse files
SuperIzyailya
andauthored
DATA-23357: Liveintent no more id cookies. (#13404)
Co-authored-by: ilya <[email protected]>
1 parent 8a42cb4 commit cbe5876

File tree

6 files changed

+1
-129
lines changed

6 files changed

+1
-129
lines changed

libraries/liveIntentId/externalIdSystem.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,6 @@ function initializeClient(configParams) {
5252
timeout: configParams.ajaxTimeout ?? DEFAULT_AJAX_TIMEOUT
5353
}
5454

55-
let idCookieSettings
56-
if (configParams.fpid != null) {
57-
const fpidConfig = configParams.fpid
58-
let source
59-
if (fpidConfig.strategy === 'html5') {
60-
source = 'local_storage'
61-
} else {
62-
source = fpidConfig.strategy
63-
}
64-
idCookieSettings = { idCookieSettings: { type: 'provided', source, key: fpidConfig.name } };
65-
} else {
66-
idCookieSettings = {}
67-
}
68-
6955
function loadConsent() {
7056
const consent = {}
7157
const usPrivacyString = uspDataHandler.getConsentData();
@@ -93,7 +79,6 @@ function initializeClient(configParams) {
9379
consent,
9480
partnerCookies,
9581
collectSettings,
96-
...idCookieSettings,
9782
resolveSettings
9883
})
9984

libraries/liveIntentId/idSystem.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ function initializeLiveConnect(configParams) {
8888
}
8989

9090
configParams = configParams || {};
91-
const fpidConfig = configParams.fpid || {};
9291

9392
const publisherId = configParams.publisherId || 'any';
9493
const identityResolutionConfig = {
@@ -120,10 +119,6 @@ function initializeLiveConnect(configParams) {
120119
liveConnectConfig.identifiersToResolve = configParams.identifiersToResolve || [];
121120
liveConnectConfig.fireEventDelay = configParams.fireEventDelay;
122121

123-
liveConnectConfig.idCookie = {};
124-
liveConnectConfig.idCookie.name = fpidConfig.name;
125-
liveConnectConfig.idCookie.strategy = fpidConfig.strategy == 'html5' ? 'localStorage' : fpidConfig.strategy;
126-
127122
const usPrivacyString = uspDataHandler.getConsentData();
128123
if (usPrivacyString) {
129124
liveConnectConfig.usPrivacyString = usPrivacyString;

libraries/liveIntentId/shared.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {UID1_EIDS} from '../uid1Eids/uid1Eids.js';
22
import {UID2_EIDS} from '../uid2Eids/uid2Eids.js';
33
import { getRefererInfo } from '../../src/refererDetection.js';
4-
import { coppaDataHandler } from '../../src/adapterManager.js';
54
import { isNumber } from '../../src/utils.js'
65

76
export const PRIMARY_IDS = ['libp'];
@@ -14,15 +13,8 @@ export const DEFAULT_REQUESTED_ATTRIBUTES = { 'nonId': true };
1413
export const DEFAULT_TREATMENT_RATE = 0.95;
1514

1615
export function parseRequestedAttributes(overrides) {
17-
function renameAttribute(attribute) {
18-
if (attribute === 'fpid') {
19-
return 'idCookie';
20-
} else {
21-
return attribute;
22-
};
23-
}
2416
function createParameterArray(config) {
25-
return Object.entries(config).flatMap(([k, v]) => (typeof v === 'boolean' && v) ? [renameAttribute(k)] : []);
17+
return Object.entries(config).flatMap(([k, v]) => (typeof v === 'boolean' && v) ? [k] : []);
2618
}
2719
if (typeof overrides === 'object') {
2820
return createParameterArray({...DEFAULT_REQUESTED_ATTRIBUTES, ...overrides});
@@ -119,14 +111,6 @@ function composeIdObject(value) {
119111
result.sovrn = { 'id': value.sovrn, ext: { provider: LI_PROVIDER_DOMAIN } }
120112
}
121113

122-
if (value.idCookie) {
123-
if (!coppaDataHandler.getCoppa()) {
124-
result.lipb = { ...result.lipb, fpid: value.idCookie };
125-
result.fpid = { 'id': value.idCookie };
126-
}
127-
delete result.lipb.idCookie;
128-
}
129-
130114
if (value.thetradedesk) {
131115
result.lipb = {...result.lipb, tdid: value.thetradedesk}
132116
result.tdid = { 'id': value.thetradedesk, ext: { rtiPartner: 'TDID', provider: getRefererInfo().domain || LI_PROVIDER_DOMAIN } }

test/spec/modules/liveIntentExternalIdSystem_spec.js

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -405,53 +405,6 @@ describe('LiveIntentExternalId', function() {
405405
})
406406
});
407407

408-
it('should decode a idCookie as fpid if it exists and coppa is false', function() {
409-
coppaConsentDataStub.returns(false)
410-
const result = liveIntentExternalIdSubmodule.decode({ nonId: 'foo', idCookie: 'bar' }, defaultConfigParams);
411-
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'fpid': 'bar'}, 'fpid': {'id': 'bar'}});
412-
});
413-
414-
it('should not decode a idCookie as fpid if it exists and coppa is true', function() {
415-
coppaConsentDataStub.returns(true)
416-
const result = liveIntentExternalIdSubmodule.decode({ nonId: 'foo', idCookie: 'bar' }, defaultConfigParams);
417-
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo'}})
418-
});
419-
420-
it('should resolve fpid from cookie', function() {
421-
const cookieName = 'testcookie'
422-
liveIntentExternalIdSubmodule.getId({ params: {
423-
...defaultConfigParams.params,
424-
fpid: { 'strategy': 'cookie', 'name': cookieName },
425-
requestedAttributesOverrides: { 'fpid': true } }
426-
}).callback(() => {});
427-
428-
expect(window.liQHub).to.have.length(2)
429-
expect(window.liQHub[0]).to.eql({
430-
clientDetails: { name: 'prebid', version: '$prebid.version$' },
431-
clientRef: {},
432-
collectSettings: { timeout: DEFAULT_AJAX_TIMEOUT },
433-
consent: {},
434-
integration: { distributorId: defaultConfigParams.distributorId, publisherId: PUBLISHER_ID, type: 'custom' },
435-
partnerCookies: new Set(),
436-
resolveSettings: { identityPartner: 'prebid', timeout: DEFAULT_AJAX_TIMEOUT },
437-
idCookieSettings: { type: 'provided', key: 'testcookie', source: 'cookie' },
438-
type: 'register_client'
439-
})
440-
441-
const resolveCommand = window.liQHub[1]
442-
443-
// functions cannot be reasonably compared, remove them
444-
delete resolveCommand.onSuccess[0].callback
445-
delete resolveCommand.onFailure
446-
447-
expect(resolveCommand).to.eql({
448-
clientRef: {},
449-
onSuccess: [{ type: 'callback' }],
450-
requestedAttributes: [ 'nonId', 'idCookie' ],
451-
type: 'resolve'
452-
})
453-
});
454-
455408
it('should decode a sharethrough id to a separate object when present', function() {
456409
const result = liveIntentExternalIdSubmodule.decode({ nonId: 'foo', sharethrough: 'bar' }, defaultConfigParams);
457410
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'sharethrough': 'bar'}, 'sharethrough': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});

test/spec/modules/liveIntentIdMinimalSystem_spec.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,6 @@ describe('LiveIntentMinimalId', function() {
324324
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'sonobi': 'bar'}, 'sonobi': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
325325
});
326326

327-
it('should decode a triplelift id to a separate object when present', function() {
328-
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', triplelift: 'bar' }, defaultConfigParams);
329-
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'triplelift': 'bar'}, 'triplelift': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
330-
});
331-
332327
it('should decode a zetassp id to a separate object when present', function() {
333328
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', zetassp: 'bar' }, defaultConfigParams);
334329
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'zetassp': 'bar'}, 'zetassp': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});

test/spec/modules/liveIntentIdSystem_spec.js

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -497,46 +497,6 @@ describe('LiveIntentId', function() {
497497
expect(callBackSpy.calledOnce).to.be.true;
498498
});
499499

500-
it('should decode a idCookie as fpid if it exists and coppa is false', function() {
501-
coppaConsentDataStub.returns(false)
502-
const result = liveIntentIdSubmodule.decode({nonId: 'foo', idCookie: 'bar'}, defaultConfigParams)
503-
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'fpid': 'bar'}, 'fpid': {'id': 'bar'}})
504-
});
505-
506-
it('should not decode a idCookie as fpid if it exists and coppa is true', function() {
507-
coppaConsentDataStub.returns(true)
508-
const result = liveIntentIdSubmodule.decode({nonId: 'foo', idCookie: 'bar'}, defaultConfigParams)
509-
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo'}})
510-
});
511-
512-
it('should resolve fpid from cookie', async function() {
513-
const expectedValue = 'someValue'
514-
const cookieName = 'testcookie'
515-
getCookieStub.withArgs(cookieName).returns(expectedValue)
516-
const config = { params: {
517-
...defaultConfigParams.params,
518-
fpid: { 'strategy': 'cookie', 'name': cookieName },
519-
requestedAttributesOverrides: { 'fpid': true } }
520-
}
521-
const submoduleCallback = liveIntentIdSubmodule.getId(config).callback;
522-
const decodedResult = new Promise(resolve => {
523-
submoduleCallback((x) => resolve(liveIntentIdSubmodule.decode(x, config)));
524-
});
525-
const request = idxRequests()[0];
526-
expect(request.url).to.match(/https:\/\/idx.liadm.com\/idex\/prebid\/89899\?.*cd=.localhost.*&ic=someValue.*&resolve=nonId.*/);
527-
request.respond(
528-
200,
529-
responseHeader,
530-
JSON.stringify({})
531-
);
532-
533-
const result = await decodedResult
534-
expect(result).to.be.eql({
535-
lipb: { 'fpid': expectedValue },
536-
fpid: { id: expectedValue }
537-
});
538-
});
539-
540500
it('should decode a sharethrough id to a separate object when present', function() {
541501
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', sharethrough: 'bar' }, defaultConfigParams);
542502
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'sharethrough': 'bar'}, 'sharethrough': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});

0 commit comments

Comments
 (0)