Skip to content

Commit

Permalink
Liveintent & UID2 ID systems: share EID configuration (#10559)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi authored Oct 3, 2023
1 parent 7600b38 commit bad2d69
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
14 changes: 14 additions & 0 deletions libraries/uid2Eids/uid2Eids.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const UID2_EIDS = {
'uid2': {
source: 'uidapi.com',
atype: 3,
getValue: function(data) {
return data.id;
},
getUidExt: function(data) {
if (data.ext) {
return data.ext;
}
}
}
}
2 changes: 2 additions & 0 deletions modules/liveIntentIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { LiveConnect } from 'live-connect-js'; // eslint-disable-line prebid/val
import { gdprDataHandler, uspDataHandler } from '../src/adapterManager.js';
import {getStorageManager} from '../src/storageManager.js';
import {MODULE_TYPE_UID} from '../src/activities/modules.js';
import {UID2_EIDS} from '../libraries/uid2Eids/uid2Eids.js';

const DEFAULT_AJAX_TIMEOUT = 5000
const EVENTS_TOPIC = 'pre_lips'
Expand Down Expand Up @@ -249,6 +250,7 @@ export const liveIntentIdSubmodule = {
return { callback: result };
},
eids: {
...UID2_EIDS,
'lipb': {
getValue: function(data) {
return data.lipbid;
Expand Down
16 changes: 2 additions & 14 deletions modules/uid2IdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {MODULE_TYPE_UID} from '../src/activities/modules.js';
// RE below lint exception: UID2 and EUID are separate modules, but the protocol is the same and shared code makes sense here.
// eslint-disable-next-line prebid/validate-imports
import { Uid2GetId, Uid2CodeVersion } from './uid2IdSystem_shared.js';
import {UID2_EIDS} from '../libraries/uid2Eids/uid2Eids.js';

const MODULE_NAME = 'uid2';
const MODULE_REVISION = Uid2CodeVersion;
Expand Down Expand Up @@ -83,20 +84,7 @@ export const uid2IdSubmodule = {
_logInfo(`UID2 getId returned`, result);
return result;
},
eids: {
'uid2': {
source: 'uidapi.com',
atype: 3,
getValue: function(data) {
return data.id;
},
getUidExt: function(data) {
if (data.ext) {
return data.ext;
}
}
},
},
eids: UID2_EIDS
};

function decodeImpl(value) {
Expand Down

0 comments on commit bad2d69

Please sign in to comment.