Skip to content
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

PAIR: Support for Generic TechLab Version #12146

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
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
32 changes: 19 additions & 13 deletions modules/pairIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import {MODULE_TYPE_UID} from '../src/activities/modules.js';

const MODULE_NAME = 'pairId';
const PAIR_ID_KEY = 'pairId';
const DEFAULT_LIVERAMP_PAIR_ID_KEY = '_lr_pairId';

const DEFAULT_STORAGE_PAID_ID_KEYS = {
liveramp: '_lr_pairId'
};

export const storage = getStorageManager({moduleType: MODULE_TYPE_UID, moduleName: MODULE_NAME});

Expand All @@ -35,11 +38,6 @@ export const pairIdSubmodule = {
* @type {string}
*/
name: MODULE_NAME,
/**
* used to specify vendor id
* @type {number}
*/
gvlid: 755,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this configurable. Should be the DSP

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not included in the bid request at all. this is the owner of the module. we need prebid to confirm.
the prefered thing to do is to leave as-is.

/**
* decode the stored id value for passing to bid requests
* @function
Expand All @@ -59,6 +57,7 @@ export const pairIdSubmodule = {
getId(config) {
const pairIdsString = pairIdFromLocalStorage(PAIR_ID_KEY) || pairIdFromCookie(PAIR_ID_KEY)
let ids = []

if (pairIdsString && typeof pairIdsString == 'string') {
try {
ids = ids.concat(JSON.parse(atob(pairIdsString)))
Expand All @@ -68,13 +67,19 @@ export const pairIdSubmodule = {
}

const configParams = (config && config.params) || {};
if (configParams && configParams.liveramp) {
let LRStorageLocation = configParams.liveramp.storageKey || DEFAULT_LIVERAMP_PAIR_ID_KEY;
const liverampValue = pairIdFromLocalStorage(LRStorageLocation) || pairIdFromCookie(LRStorageLocation);
const cleanRooms = Object.keys(configParams);

if (liverampValue) {
for (let i = 0; i < cleanRooms.length; i++) {
const cleanRoom = cleanRooms[i];
const cleanRoomParams = cleanRoom[i];

const cleanRoomStorageLocation = cleanRoomParams.storageKey || DEFAULT_STORAGE_PAID_ID_KEYS[cleanRoom];
const cleanRoomValue = pairIdFromLocalStorage(cleanRoomStorageLocation) || pairIdFromCookie(cleanRoomStorageLocation);

if (cleanRoomValue) {
try {
const parsedValue = atob(liverampValue);
const parsedValue = atob(cleanRoomValue);

if (parsedValue) {
const obj = JSON.parse(parsedValue);

Expand All @@ -90,19 +95,20 @@ export const pairIdSubmodule = {
logInfo('Pairid: Error parsing JSON: ', error);
}
} else {
logInfo('Pairid: liverampValue for pairId from storage is empty or null');
logInfo('Pairid: data clean room value for pairId from storage is empty or null');
}
}

if (ids.length == 0) {
logInfo('PairId not found.')
return undefined;
}

return {'id': ids};
},
eids: {
'pairId': {
source: 'google.com',
source: 'iabtechlab.com',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In future IAB may support another Alt ID, so the source for PAIR should clearly mention what it is.
Can we mention it as "pair-iab-tl.com"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't that what atype is for? like a single source can have multiple id types?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@pm-harshad-mane pm-harshad-mane Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

atype identifies the user agent types a user identifier is from.
IABTechLab may have another ID with same atype in future hence we should have clear identification in source that tells its a PAIR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@therevoltingx mentioned we will have a unique atype to identify eid as a PAIR

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this? I assumed it was the ID type which is now a techlab id type

atype: 571187
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirm that this value was assigned to pair protocol

},
}
Expand Down