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

Eids liveintent ext fix #4944

Merged
merged 37 commits into from
Mar 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
33762d1
added support for pubcommon, digitrust, id5id
pm-harshad-mane Sep 12, 2019
0722354
added support for IdentityLink
pm-harshad-mane Sep 13, 2019
f2c32c0
changed the source for id5
pm-harshad-mane Sep 13, 2019
37163d1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 13, 2019
eaed987
added unit test cases
pm-harshad-mane Sep 13, 2019
602ee7e
changed source param for identityLink
pm-harshad-mane Sep 16, 2019
b6fcd36
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 23, 2019
58381f3
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 26, 2019
c9fb11b
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Oct 10, 2019
8ece7fd
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Oct 16, 2019
28d12a0
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Oct 16, 2019
05a55e1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Oct 31, 2019
e8b10d5
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Nov 5, 2019
870085f
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Nov 12, 2019
844ce4e
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Nov 12, 2019
704eca3
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Nov 13, 2019
2565cb9
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 4, 2019
1d75bd4
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 4, 2019
6adde1e
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 6, 2019
477c98a
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 9, 2019
cef5422
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 10, 2019
c110a7d
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jan 9, 2020
e8fb062
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 5, 2020
d77cd71
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 17, 2020
817ce3f
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 24, 2020
cda825e
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 26, 2020
f34a3ec
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 27, 2020
f106dc8
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 4, 2020
1f6937e
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 6, 2020
06ffe84
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 6, 2020
95597fa
fixing liveintent-segments
pm-harshad-mane Mar 6, 2020
d1cac19
added example of generated eids array
pm-harshad-mane Mar 10, 2020
772b9fa
formating
pm-harshad-mane Mar 10, 2020
387342c
Merge remote-tracking branch 'upstream/master' into eids_liveintent_e…
pm-harshad-mane Mar 10, 2020
88f2d6c
commeneted a console log; avoiding lint error
pm-harshad-mane Mar 10, 2020
e578a7d
fixed breaking test-cases
pm-harshad-mane Mar 10, 2020
97f8019
Merge remote-tracking branch 'upstream/master' into eids_liveintent_e…
pm-harshad-mane Mar 10, 2020
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
25 changes: 18 additions & 7 deletions modules/userId/eids.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const USER_IDS_CONFIG = {
'tdid': {
source: 'adserver.org',
atype: 1,
ext: function() {
getUidExt: function() {
return {
rtiPartner: 'TDID'
};
Expand Down Expand Up @@ -47,7 +47,7 @@ const USER_IDS_CONFIG = {
},
source: 'liveintent.com',
atype: 1,
ext: function(data) {
getEidExt: function(data) {
if (Array.isArray(data.segments) && data.segments.length) {
return {
segments: data.segments
Expand Down Expand Up @@ -88,16 +88,27 @@ const USER_IDS_CONFIG = {
function createEidObject(userIdData, subModuleKey) {
const conf = USER_IDS_CONFIG[subModuleKey];
if (conf && userIdData) {
let eid = {};
eid.source = conf['source'];
const value = utils.isFn(conf['getValue']) ? conf['getValue'](userIdData) : userIdData;
if (value) {
const uid = { id: value, atype: conf['atype'] };
if (utils.isFn(conf['ext'])) {
const ext = conf['ext'](userIdData);
if (ext) {
uid.ext = ext;
// getUidExt
if (utils.isFn(conf['getUidExt'])) {
const uidExt = conf['getUidExt'](userIdData);
if (uidExt) {
uid.ext = uidExt;
}
}
return { source: conf['source'], uids: [uid] };
eid.uids = [uid];
// getEidExt
if (utils.isFn(conf['getEidExt'])) {
const eidExt = conf['getEidExt'](userIdData);
if (eidExt) {
eid.ext = eidExt;
}
}
return eid;
}
}
return null;
Expand Down
90 changes: 90 additions & 0 deletions modules/userId/eids.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
## Example of eids array generated by UserId Module.
```
userIdAsEids = [
{
source: 'pubcid.org',
uids: [{
id: 'some-random-id-value',
atype: 1
}]
},
{
source: 'adserver.org',
uids: [{
id: 'some-random-id-value',
atype: 1,
ext: {
rtiPartner: 'TDID'
}
}]
},
{
source: 'id5-sync.com',
uids: [{
id: 'some-random-id-value',
atype: 1
}]
},
{
source: 'parrable.com',
uids: [{
id: 'some-random-id-value',
atype: 1
}]
},
{
source: 'liveramp.com',
uids: [{
id: 'some-random-id-value',
atype: 1
}]
},
{
source: 'liveintent.com',
uids: [{
id: 'some-random-id-value',
atype: 1
}],
ext: {
segments: ['s1', 's2']
}
},
{
source: 'britepool.com',
uids: [{
id: 'some-random-id-value',
atype: 1
}]
},
{
source: 'digitru.st',
uids: [{
id: 'some-random-id-value',
atype: 1
}]
},
{
source: 'criteo.com',
uids: [{
id: 'some-random-id-value',
atype: 1
}]
},
{
source: 'netid.de',
uids: [{
id: 'some-random-id-value',
atype: 1
}]
}
]
```
3 changes: 2 additions & 1 deletion test/spec/modules/eids_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ describe('eids array generation for known sub-modules', function() {
expect(newEids.length).to.equal(1);
expect(newEids[0]).to.deep.equal({
source: 'liveintent.com',
uids: [{id: 'some-random-id-value', atype: 1, ext: {segments: ['s1', 's2']}}]
uids: [{id: 'some-random-id-value', atype: 1}],
ext: {segments: ['s1', 's2']}
});
});

Expand Down
6 changes: 4 additions & 2 deletions test/spec/modules/userId_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,8 @@ describe('User ID', function() {
expect(bid.userId.lipb.segments).to.include('123');
expect(bid.userIdAsEids[0]).to.deep.equal({
source: 'liveintent.com',
uids: [{id: 'random-ls-identifier', atype: 1, ext: {segments: ['123']}}]
uids: [{id: 'random-ls-identifier', atype: 1}],
ext: {segments: ['123']}
});
});
});
Expand All @@ -875,7 +876,8 @@ describe('User ID', function() {
expect(bid.userId.lipb.segments).to.include('123');
expect(bid.userIdAsEids[0]).to.deep.equal({
source: 'liveintent.com',
uids: [{id: 'random-cookie-identifier', atype: 1, ext: {segments: ['123']}}]
uids: [{id: 'random-cookie-identifier', atype: 1}],
ext: {segments: ['123']}
});
});
});
Expand Down