Skip to content

Liveintent id module: no more id cookies. #13404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions libraries/liveIntentId/externalIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,6 @@ function initializeClient(configParams) {
timeout: configParams.ajaxTimeout ?? DEFAULT_AJAX_TIMEOUT
}

let idCookieSettings
if (configParams.fpid != null) {
const fpidConfig = configParams.fpid
let source
if (fpidConfig.strategy === 'html5') {
source = 'local_storage'
} else {
source = fpidConfig.strategy
}
idCookieSettings = { idCookieSettings: { type: 'provided', source, key: fpidConfig.name } };
} else {
idCookieSettings = {}
}

function loadConsent() {
const consent = {}
const usPrivacyString = uspDataHandler.getConsentData();
Expand Down Expand Up @@ -93,7 +79,6 @@ function initializeClient(configParams) {
consent,
partnerCookies,
collectSettings,
...idCookieSettings,
resolveSettings
})

Expand Down
5 changes: 0 additions & 5 deletions libraries/liveIntentId/idSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ function initializeLiveConnect(configParams) {
}

configParams = configParams || {};
const fpidConfig = configParams.fpid || {};

const publisherId = configParams.publisherId || 'any';
const identityResolutionConfig = {
Expand Down Expand Up @@ -120,10 +119,6 @@ function initializeLiveConnect(configParams) {
liveConnectConfig.identifiersToResolve = configParams.identifiersToResolve || [];
liveConnectConfig.fireEventDelay = configParams.fireEventDelay;

liveConnectConfig.idCookie = {};
liveConnectConfig.idCookie.name = fpidConfig.name;
liveConnectConfig.idCookie.strategy = fpidConfig.strategy == 'html5' ? 'localStorage' : fpidConfig.strategy;

const usPrivacyString = uspDataHandler.getConsentData();
if (usPrivacyString) {
liveConnectConfig.usPrivacyString = usPrivacyString;
Expand Down
18 changes: 1 addition & 17 deletions libraries/liveIntentId/shared.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {UID1_EIDS} from '../uid1Eids/uid1Eids.js';
import {UID2_EIDS} from '../uid2Eids/uid2Eids.js';
import { getRefererInfo } from '../../src/refererDetection.js';
import { coppaDataHandler } from '../../src/adapterManager.js';
import { isNumber } from '../../src/utils.js'

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

export function parseRequestedAttributes(overrides) {
function renameAttribute(attribute) {
if (attribute === 'fpid') {
return 'idCookie';
} else {
return attribute;
};
}
function createParameterArray(config) {
return Object.entries(config).flatMap(([k, v]) => (typeof v === 'boolean' && v) ? [renameAttribute(k)] : []);
return Object.entries(config).flatMap(([k, v]) => (typeof v === 'boolean' && v) ? [k] : []);
}
if (typeof overrides === 'object') {
return createParameterArray({...DEFAULT_REQUESTED_ATTRIBUTES, ...overrides});
Expand Down Expand Up @@ -119,14 +111,6 @@ function composeIdObject(value) {
result.sovrn = { 'id': value.sovrn, ext: { provider: LI_PROVIDER_DOMAIN } }
}

if (value.idCookie) {
if (!coppaDataHandler.getCoppa()) {
result.lipb = { ...result.lipb, fpid: value.idCookie };
result.fpid = { 'id': value.idCookie };
}
delete result.lipb.idCookie;
}

if (value.thetradedesk) {
result.lipb = {...result.lipb, tdid: value.thetradedesk}
result.tdid = { 'id': value.thetradedesk, ext: { rtiPartner: 'TDID', provider: getRefererInfo().domain || LI_PROVIDER_DOMAIN } }
Expand Down
47 changes: 0 additions & 47 deletions test/spec/modules/liveIntentExternalIdSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,53 +405,6 @@ describe('LiveIntentExternalId', function() {
})
});

it('should decode a idCookie as fpid if it exists and coppa is false', function() {
coppaConsentDataStub.returns(false)
const result = liveIntentExternalIdSubmodule.decode({ nonId: 'foo', idCookie: 'bar' }, defaultConfigParams);
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'fpid': 'bar'}, 'fpid': {'id': 'bar'}});
});

it('should not decode a idCookie as fpid if it exists and coppa is true', function() {
coppaConsentDataStub.returns(true)
const result = liveIntentExternalIdSubmodule.decode({ nonId: 'foo', idCookie: 'bar' }, defaultConfigParams);
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo'}})
});

it('should resolve fpid from cookie', function() {
const cookieName = 'testcookie'
liveIntentExternalIdSubmodule.getId({ params: {
...defaultConfigParams.params,
fpid: { 'strategy': 'cookie', 'name': cookieName },
requestedAttributesOverrides: { 'fpid': true } }
}).callback(() => {});

expect(window.liQHub).to.have.length(2)
expect(window.liQHub[0]).to.eql({
clientDetails: { name: 'prebid', version: '$prebid.version$' },
clientRef: {},
collectSettings: { timeout: DEFAULT_AJAX_TIMEOUT },
consent: {},
integration: { distributorId: defaultConfigParams.distributorId, publisherId: PUBLISHER_ID, type: 'custom' },
partnerCookies: new Set(),
resolveSettings: { identityPartner: 'prebid', timeout: DEFAULT_AJAX_TIMEOUT },
idCookieSettings: { type: 'provided', key: 'testcookie', source: 'cookie' },
type: 'register_client'
})

const resolveCommand = window.liQHub[1]

// functions cannot be reasonably compared, remove them
delete resolveCommand.onSuccess[0].callback
delete resolveCommand.onFailure

expect(resolveCommand).to.eql({
clientRef: {},
onSuccess: [{ type: 'callback' }],
requestedAttributes: [ 'nonId', 'idCookie' ],
type: 'resolve'
})
});

it('should decode a sharethrough id to a separate object when present', function() {
const result = liveIntentExternalIdSubmodule.decode({ nonId: 'foo', sharethrough: 'bar' }, defaultConfigParams);
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'sharethrough': 'bar'}, 'sharethrough': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
Expand Down
5 changes: 0 additions & 5 deletions test/spec/modules/liveIntentIdMinimalSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,6 @@ describe('LiveIntentMinimalId', function() {
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'sonobi': 'bar'}, 'sonobi': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
});

it('should decode a triplelift id to a separate object when present', function() {
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', triplelift: 'bar' }, defaultConfigParams);
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'triplelift': 'bar'}, 'triplelift': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
});

it('should decode a zetassp id to a separate object when present', function() {
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', zetassp: 'bar' }, defaultConfigParams);
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'zetassp': 'bar'}, 'zetassp': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
Expand Down
40 changes: 0 additions & 40 deletions test/spec/modules/liveIntentIdSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,46 +497,6 @@ describe('LiveIntentId', function() {
expect(callBackSpy.calledOnce).to.be.true;
});

it('should decode a idCookie as fpid if it exists and coppa is false', function() {
coppaConsentDataStub.returns(false)
const result = liveIntentIdSubmodule.decode({nonId: 'foo', idCookie: 'bar'}, defaultConfigParams)
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'fpid': 'bar'}, 'fpid': {'id': 'bar'}})
});

it('should not decode a idCookie as fpid if it exists and coppa is true', function() {
coppaConsentDataStub.returns(true)
const result = liveIntentIdSubmodule.decode({nonId: 'foo', idCookie: 'bar'}, defaultConfigParams)
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo'}})
});

it('should resolve fpid from cookie', async function() {
const expectedValue = 'someValue'
const cookieName = 'testcookie'
getCookieStub.withArgs(cookieName).returns(expectedValue)
const config = { params: {
...defaultConfigParams.params,
fpid: { 'strategy': 'cookie', 'name': cookieName },
requestedAttributesOverrides: { 'fpid': true } }
}
const submoduleCallback = liveIntentIdSubmodule.getId(config).callback;
const decodedResult = new Promise(resolve => {
submoduleCallback((x) => resolve(liveIntentIdSubmodule.decode(x, config)));
});
const request = idxRequests()[0];
expect(request.url).to.match(/https:\/\/idx.liadm.com\/idex\/prebid\/89899\?.*cd=.localhost.*&ic=someValue.*&resolve=nonId.*/);
request.respond(
200,
responseHeader,
JSON.stringify({})
);

const result = await decodedResult
expect(result).to.be.eql({
lipb: { 'fpid': expectedValue },
fpid: { id: expectedValue }
});
});

it('should decode a sharethrough id to a separate object when present', function() {
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', sharethrough: 'bar' }, defaultConfigParams);
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'sharethrough': 'bar'}, 'sharethrough': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
Expand Down
Loading