From ff0e9362e09c9d709344dcc3230d03b6fdbe17bf Mon Sep 17 00:00:00 2001 From: Viktor Dreiling Date: Tue, 14 Mar 2023 13:30:41 +0100 Subject: [PATCH 1/9] Add support for bidswitch id --- modules/liveIntentIdSystem.js | 4 ++++ modules/userId/eids.js | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/modules/liveIntentIdSystem.js b/modules/liveIntentIdSystem.js index 9f45daeea29..fc6a8b02473 100644 --- a/modules/liveIntentIdSystem.js +++ b/modules/liveIntentIdSystem.js @@ -171,6 +171,10 @@ export const liveIntentIdSubmodule = { result.uid2 = { 'id': value.uid2 } } + if (value.bidswitch) { + result.bidswitch = { 'id': value.bidswitch } + } + return result } diff --git a/modules/userId/eids.js b/modules/userId/eids.js index a96dbaee4af..3d125407237 100644 --- a/modules/userId/eids.js +++ b/modules/userId/eids.js @@ -146,6 +146,15 @@ export const USER_IDS_CONFIG = { } }, + // bidswitchId + 'bidswitch': { + source: 'bidswitch.com', + atype: 508, + getValue: function(data) { + return data.id; + } + }, + // britepoolId 'britepoolid': { source: 'britepool.com', From 869a19861c48e1ab7eb6bd97d2c7ba39f31cf6a3 Mon Sep 17 00:00:00 2001 From: Viktor Dreiling Date: Tue, 14 Mar 2023 13:57:56 +0100 Subject: [PATCH 2/9] Add test --- test/spec/modules/eids_spec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/spec/modules/eids_spec.js b/test/spec/modules/eids_spec.js index f076866a080..f219095a64d 100644 --- a/test/spec/modules/eids_spec.js +++ b/test/spec/modules/eids_spec.js @@ -172,6 +172,21 @@ describe('eids array generation for known sub-modules', function() { }); }); + it('bidswitch', function() { + const userId = { + bidswitch: {'id': 'sample_id'} + }; + const newEids = createEidsArray(userId); + expect(newEids.length).to.equal(1); + expect(newEids[0]).to.deep.equal({ + source: 'bidswitch.com', + uids: [{ + id: 'sample_id', + atype: 508 + }] + }); + }); + it('liveIntentId; getValue call and NO ext', function() { const userId = { lipb: { From b53e68c4dfca5879843662ff4d3dfc766cbc7885 Mon Sep 17 00:00:00 2001 From: Viktor Dreiling Date: Tue, 14 Mar 2023 14:01:43 +0100 Subject: [PATCH 3/9] Update liveIntentIdSystem_spec.js --- test/spec/modules/liveIntentIdSystem_spec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/spec/modules/liveIntentIdSystem_spec.js b/test/spec/modules/liveIntentIdSystem_spec.js index 3c22cda1154..10a62499a9b 100644 --- a/test/spec/modules/liveIntentIdSystem_spec.js +++ b/test/spec/modules/liveIntentIdSystem_spec.js @@ -292,6 +292,11 @@ describe('LiveIntentId', function() { expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'uid2': 'bar'}, 'uid2': {'id': 'bar'}}); }); + it('should decode a bidswitch to a seperate object when present', function() { + const result = liveIntentIdSubmodule.decode({ nonId: 'foo', bidswitch: 'bar' }); + expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'uid2': 'bar'}, 'bidswitch': {'id': 'bar'}}); + }); + it('should decode values with uid2 but no nonId', function() { const result = liveIntentIdSubmodule.decode({ uid2: 'bar' }); expect(result).to.eql({'uid2': {'id': 'bar'}}); From 33550925438202f89d48b8c6cc2159c2415cf545 Mon Sep 17 00:00:00 2001 From: Viktor Dreiling Date: Tue, 14 Mar 2023 14:48:52 +0100 Subject: [PATCH 4/9] Fix test --- test/spec/modules/liveIntentIdSystem_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/spec/modules/liveIntentIdSystem_spec.js b/test/spec/modules/liveIntentIdSystem_spec.js index 10a62499a9b..2ef899de6bd 100644 --- a/test/spec/modules/liveIntentIdSystem_spec.js +++ b/test/spec/modules/liveIntentIdSystem_spec.js @@ -294,7 +294,7 @@ describe('LiveIntentId', function() { it('should decode a bidswitch to a seperate object when present', function() { const result = liveIntentIdSubmodule.decode({ nonId: 'foo', bidswitch: 'bar' }); - expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'uid2': 'bar'}, 'bidswitch': {'id': 'bar'}}); + expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'bidswitch': 'bar'}, 'bidswitch': {'id': 'bar'}}); }); it('should decode values with uid2 but no nonId', function() { From 547292e7ac0043ab049df102a92d0fa8be56e1fb Mon Sep 17 00:00:00 2001 From: Viktor Dreiling Date: Tue, 21 Mar 2023 09:37:54 +0100 Subject: [PATCH 5/9] Add medianet cookie --- modules/liveIntentIdSystem.js | 4 ++++ modules/userId/eids.js | 9 +++++++++ package-lock.json | 2 +- test/spec/modules/eids_spec.js | 15 +++++++++++++++ test/spec/modules/liveIntentIdSystem_spec.js | 7 ++++++- 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/modules/liveIntentIdSystem.js b/modules/liveIntentIdSystem.js index fc6a8b02473..232081af4ce 100644 --- a/modules/liveIntentIdSystem.js +++ b/modules/liveIntentIdSystem.js @@ -175,6 +175,10 @@ export const liveIntentIdSubmodule = { result.bidswitch = { 'id': value.bidswitch } } + if (value.medianet) { + result.medianet = { 'id': value.medianet } + } + return result } diff --git a/modules/userId/eids.js b/modules/userId/eids.js index 3d125407237..fcf5d4b9480 100644 --- a/modules/userId/eids.js +++ b/modules/userId/eids.js @@ -155,6 +155,15 @@ export const USER_IDS_CONFIG = { } }, + // medianetId + 'medianet': { + source: 'media.net', + atype: 3, + getValue: function(data) { + return data.id; + } + }, + // britepoolId 'britepoolid': { source: 'britepool.com', diff --git a/package-lock.json b/package-lock.json index b2f1cd00afe..bf477543ffd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "prebid.js", - "version": "7.36.0-pre", + "version": "7.41.0-pre", "license": "Apache-2.0", "dependencies": { "@babel/core": "^7.16.7", diff --git a/test/spec/modules/eids_spec.js b/test/spec/modules/eids_spec.js index f219095a64d..c7cf2781adf 100644 --- a/test/spec/modules/eids_spec.js +++ b/test/spec/modules/eids_spec.js @@ -187,6 +187,21 @@ describe('eids array generation for known sub-modules', function() { }); }); + it('medianet', function() { + const userId = { + medianet: {'id': 'sample_id'} + }; + const newEids = createEidsArray(userId); + expect(newEids.length).to.equal(1); + expect(newEids[0]).to.deep.equal({ + source: 'media.net', + uids: [{ + id: 'sample_id', + atype: 3 + }] + }); + }); + it('liveIntentId; getValue call and NO ext', function() { const userId = { lipb: { diff --git a/test/spec/modules/liveIntentIdSystem_spec.js b/test/spec/modules/liveIntentIdSystem_spec.js index 2ef899de6bd..96c3dbe0030 100644 --- a/test/spec/modules/liveIntentIdSystem_spec.js +++ b/test/spec/modules/liveIntentIdSystem_spec.js @@ -292,11 +292,16 @@ describe('LiveIntentId', function() { expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'uid2': 'bar'}, 'uid2': {'id': 'bar'}}); }); - it('should decode a bidswitch to a seperate object when present', function() { + it('should decode a bidswitch id to a seperate object when present', function() { const result = liveIntentIdSubmodule.decode({ nonId: 'foo', bidswitch: 'bar' }); expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'bidswitch': 'bar'}, 'bidswitch': {'id': 'bar'}}); }); + it('should decode a medianet id to a seperate object when present', function() { + const result = liveIntentIdSubmodule.decode({ nonId: 'foo', medianet: 'bar' }); + expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'medianet': 'bar'}, 'medianet': {'id': 'bar'}}); + }); + it('should decode values with uid2 but no nonId', function() { const result = liveIntentIdSubmodule.decode({ uid2: 'bar' }); expect(result).to.eql({'uid2': {'id': 'bar'}}); From f6b0a860d70adb92b967cdf9a579683de2f8843e Mon Sep 17 00:00:00 2001 From: Viktor Dreiling Date: Tue, 4 Apr 2023 15:11:01 +0200 Subject: [PATCH 6/9] Change atype from 508 to 3 --- modules/userId/eids.js | 2 +- test/spec/modules/eids_spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/userId/eids.js b/modules/userId/eids.js index fcf5d4b9480..6ab7cd97a0c 100644 --- a/modules/userId/eids.js +++ b/modules/userId/eids.js @@ -149,7 +149,7 @@ export const USER_IDS_CONFIG = { // bidswitchId 'bidswitch': { source: 'bidswitch.com', - atype: 508, + atype: 3, getValue: function(data) { return data.id; } diff --git a/test/spec/modules/eids_spec.js b/test/spec/modules/eids_spec.js index c7cf2781adf..e0a00046736 100644 --- a/test/spec/modules/eids_spec.js +++ b/test/spec/modules/eids_spec.js @@ -182,7 +182,7 @@ describe('eids array generation for known sub-modules', function() { source: 'bidswitch.com', uids: [{ id: 'sample_id', - atype: 508 + atype: 3 }] }); }); From bee3ff8b1d7d14700665fb13697eecda124664c5 Mon Sep 17 00:00:00 2001 From: Viktor Dreiling Date: Tue, 4 Apr 2023 15:14:13 +0200 Subject: [PATCH 7/9] Revert version change in package-lock.json --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index bf477543ffd..daff2e3fd02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "prebid.js", - "version": "7.41.0-pre", + "version": "7.42.0-pre", "license": "Apache-2.0", "dependencies": { "@babel/core": "^7.16.7", From bfb4c92b7dcedf8c4b42794ec2330fc04eb487c4 Mon Sep 17 00:00:00 2001 From: Viktor Dreiling <34981284+3link@users.noreply.github.com> Date: Tue, 11 Apr 2023 13:55:45 +0200 Subject: [PATCH 8/9] Add bidswitch.com and media.net examples --- modules/userId/eids.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/userId/eids.md b/modules/userId/eids.md index 83414cbe295..4909c83cb44 100644 --- a/modules/userId/eids.md +++ b/modules/userId/eids.md @@ -105,6 +105,22 @@ userIdAsEids = [ segments: ['s1', 's2'] } }, + + { + source: 'bidswitch.com', + uids: [{ + id: 'some-random-id-value', + atype: 3 + }] + }, + + { + source: 'media.net', + uids: [{ + id: 'some-random-id-value', + atype: 3 + }] + }, { source: 'merkleinc.com', From 8170d5d2833aa2fe71a6d8c061f5f5f8670469b3 Mon Sep 17 00:00:00 2001 From: Viktor Dreiling Date: Wed, 12 Apr 2023 15:22:23 +0200 Subject: [PATCH 9/9] Customer request: change bidswitch.com to bidswitch.net --- modules/userId/eids.js | 2 +- modules/userId/eids.md | 2 +- test/spec/modules/eids_spec.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/userId/eids.js b/modules/userId/eids.js index 6ab7cd97a0c..2f2d1ca7514 100644 --- a/modules/userId/eids.js +++ b/modules/userId/eids.js @@ -148,7 +148,7 @@ export const USER_IDS_CONFIG = { // bidswitchId 'bidswitch': { - source: 'bidswitch.com', + source: 'bidswitch.net', atype: 3, getValue: function(data) { return data.id; diff --git a/modules/userId/eids.md b/modules/userId/eids.md index 4909c83cb44..f3d487126a9 100644 --- a/modules/userId/eids.md +++ b/modules/userId/eids.md @@ -107,7 +107,7 @@ userIdAsEids = [ }, { - source: 'bidswitch.com', + source: 'bidswitch.net', uids: [{ id: 'some-random-id-value', atype: 3 diff --git a/test/spec/modules/eids_spec.js b/test/spec/modules/eids_spec.js index e0a00046736..e5e779479cc 100644 --- a/test/spec/modules/eids_spec.js +++ b/test/spec/modules/eids_spec.js @@ -179,7 +179,7 @@ describe('eids array generation for known sub-modules', function() { const newEids = createEidsArray(userId); expect(newEids.length).to.equal(1); expect(newEids[0]).to.deep.equal({ - source: 'bidswitch.com', + source: 'bidswitch.net', uids: [{ id: 'sample_id', atype: 3