From 0d23d4bf3a22117de62796f2ee879664d794f503 Mon Sep 17 00:00:00 2001 From: azuryo Date: Tue, 5 Jul 2022 19:58:16 +0900 Subject: [PATCH 01/12] Microad Bid Adapter: Add IM-UID --- modules/microadBidAdapter.js | 6 ++++++ test/spec/modules/microadBidAdapter_spec.js | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/modules/microadBidAdapter.js b/modules/microadBidAdapter.js index 77710584f41..7c2ca4b756e 100644 --- a/modules/microadBidAdapter.js +++ b/modules/microadBidAdapter.js @@ -88,6 +88,12 @@ export const spec = { params['idl_env'] = idlEnv } + const imuid = deepAccess(bid, 'userId.imuid'); + if (imuid) { + params['aids'] = params['aids'] || [] + params['aids'].push({ type: 6, id: imuid }) + } + requests.push({ method: 'GET', url: ENDPOINT_URLS[ENVIRONMENT], diff --git a/test/spec/modules/microadBidAdapter_spec.js b/test/spec/modules/microadBidAdapter_spec.js index ff0b705594b..c074cf18c67 100644 --- a/test/spec/modules/microadBidAdapter_spec.js +++ b/test/spec/modules/microadBidAdapter_spec.js @@ -295,6 +295,21 @@ describe('microadBidAdapter', () => { ); }) }); + + it('should add IM-UID if it is available in request parameters', () => { + const bidRequestWithImuid = Object.assign({}, bidRequestTemplate, { + userId: {imuid: 'imuid-sample'} + }); + const requests = spec.buildRequests([bidRequestWithImuid], bidderRequest) + requests.forEach(request => { + expect(request.data).to.deep.equal( + Object.assign({}, expectedResultTemplate, { + cbt: request.data.cbt, + aids: [{type: 6, id: 'imuid-sample'}] + }) + ); + }) + }); }); describe('interpretResponse', () => { From 7fc4d9194e2f2a711690f32f0b136be125e5352a Mon Sep 17 00:00:00 2001 From: azuryo Date: Tue, 5 Jul 2022 20:00:08 +0900 Subject: [PATCH 02/12] Microad Bid Adapter: Add ID5 ID --- modules/microadBidAdapter.js | 17 ++++++++++++----- test/spec/modules/microadBidAdapter_spec.js | 15 +++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/modules/microadBidAdapter.js b/modules/microadBidAdapter.js index 7c2ca4b756e..8e266b1b1b4 100644 --- a/modules/microadBidAdapter.js +++ b/modules/microadBidAdapter.js @@ -22,6 +22,11 @@ const BANNER_CODE = 1; const NATIVE_CODE = 2; const VIDEO_CODE = 4; +const AUDIENCE_IDS = [ + {type: 6, bidKey: 'userId.imuid'}, + {type: 7, bidKey: 'userId.id5id.uid'} +] + function createCBT() { const randomValue = Math.floor(Math.random() * Math.pow(10, 18)).toString(16); const date = new Date().getTime().toString(16); @@ -88,11 +93,13 @@ export const spec = { params['idl_env'] = idlEnv } - const imuid = deepAccess(bid, 'userId.imuid'); - if (imuid) { - params['aids'] = params['aids'] || [] - params['aids'].push({ type: 6, id: imuid }) - } + AUDIENCE_IDS.forEach((audienceId) => { + const bidAudienceId = deepAccess(bid, audienceId.bidKey); + if (bidAudienceId) { + params['aids'] = params['aids'] || [] + params['aids'].push({ type: audienceId.type, id: bidAudienceId }) + } + }) requests.push({ method: 'GET', diff --git a/test/spec/modules/microadBidAdapter_spec.js b/test/spec/modules/microadBidAdapter_spec.js index c074cf18c67..a1f5170b6ec 100644 --- a/test/spec/modules/microadBidAdapter_spec.js +++ b/test/spec/modules/microadBidAdapter_spec.js @@ -310,6 +310,21 @@ describe('microadBidAdapter', () => { ); }) }); + + it('should add ID5 ID if it is available in request parameters', () => { + const bidRequestWithId5id = Object.assign({}, bidRequestTemplate, { + userId: {id5id: {uid: 'id5id-sample'}} + }); + const requests = spec.buildRequests([bidRequestWithId5id], bidderRequest) + requests.forEach(request => { + expect(request.data).to.deep.equal( + Object.assign({}, expectedResultTemplate, { + cbt: request.data.cbt, + aids: [{type: 7, id: 'id5id-sample'}] + }) + ); + }) + }); }); describe('interpretResponse', () => { From f75b295157fb45a2685faea816349caeccbabeca Mon Sep 17 00:00:00 2001 From: azuryo Date: Tue, 5 Jul 2022 20:00:19 +0900 Subject: [PATCH 03/12] Microad Bid Adapter: Add Unified ID --- modules/microadBidAdapter.js | 3 ++- test/spec/modules/microadBidAdapter_spec.js | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/microadBidAdapter.js b/modules/microadBidAdapter.js index 8e266b1b1b4..ef47e2b7c69 100644 --- a/modules/microadBidAdapter.js +++ b/modules/microadBidAdapter.js @@ -24,7 +24,8 @@ const VIDEO_CODE = 4; const AUDIENCE_IDS = [ {type: 6, bidKey: 'userId.imuid'}, - {type: 7, bidKey: 'userId.id5id.uid'} + {type: 7, bidKey: 'userId.id5id.uid'}, + {type: 8, bidKey: 'userId.tdid'} ] function createCBT() { diff --git a/test/spec/modules/microadBidAdapter_spec.js b/test/spec/modules/microadBidAdapter_spec.js index a1f5170b6ec..bfc2d774da7 100644 --- a/test/spec/modules/microadBidAdapter_spec.js +++ b/test/spec/modules/microadBidAdapter_spec.js @@ -325,6 +325,21 @@ describe('microadBidAdapter', () => { ); }) }); + + it('should add Unified ID if it is available in request parameters', () => { + const bidRequestWithId5id = Object.assign({}, bidRequestTemplate, { + userId: {tdid: 'unified-id-sample'} + }); + const requests = spec.buildRequests([bidRequestWithId5id], bidderRequest) + requests.forEach(request => { + expect(request.data).to.deep.equal( + Object.assign({}, expectedResultTemplate, { + cbt: request.data.cbt, + aids: [{type: 8, id: 'unified-id-sample'}] + }) + ); + }) + }); }); describe('interpretResponse', () => { From 84c857d5a645377cb0ed0790666275e878e36d7a Mon Sep 17 00:00:00 2001 From: azuryo Date: Tue, 5 Jul 2022 20:00:32 +0900 Subject: [PATCH 04/12] Microad Bid Adapter: Add Novatiq Hyper ID --- modules/microadBidAdapter.js | 5 +++-- test/spec/modules/microadBidAdapter_spec.js | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/modules/microadBidAdapter.js b/modules/microadBidAdapter.js index ef47e2b7c69..122d1914cc2 100644 --- a/modules/microadBidAdapter.js +++ b/modules/microadBidAdapter.js @@ -25,7 +25,8 @@ const VIDEO_CODE = 4; const AUDIENCE_IDS = [ {type: 6, bidKey: 'userId.imuid'}, {type: 7, bidKey: 'userId.id5id.uid'}, - {type: 8, bidKey: 'userId.tdid'} + {type: 8, bidKey: 'userId.tdid'}, + {type: 9, bidKey: 'userId.novatiq.snowflake'} ] function createCBT() { @@ -96,7 +97,7 @@ export const spec = { AUDIENCE_IDS.forEach((audienceId) => { const bidAudienceId = deepAccess(bid, audienceId.bidKey); - if (bidAudienceId) { + if (!isEmpty(bidAudienceId) && isStr(bidAudienceId)) { params['aids'] = params['aids'] || [] params['aids'].push({ type: audienceId.type, id: bidAudienceId }) } diff --git a/test/spec/modules/microadBidAdapter_spec.js b/test/spec/modules/microadBidAdapter_spec.js index bfc2d774da7..f9664e05711 100644 --- a/test/spec/modules/microadBidAdapter_spec.js +++ b/test/spec/modules/microadBidAdapter_spec.js @@ -340,6 +340,21 @@ describe('microadBidAdapter', () => { ); }) }); + + it('should add Novatiq Hyper ID if it is available in request parameters', () => { + const bidRequestWithNovatiq = Object.assign({}, bidRequestTemplate, { + userId: {novatiq: {snowflake: 'novatiq-id-sample'}} + }); + const requests = spec.buildRequests([bidRequestWithNovatiq], bidderRequest) + requests.forEach(request => { + expect(request.data).to.deep.equal( + Object.assign({}, expectedResultTemplate, { + cbt: request.data.cbt, + aids: [{type: 9, id: 'novatiq-id-sample'}] + }) + ); + }) + }); }); describe('interpretResponse', () => { From 1acda9bd8acc88a26eea445562a064cfe7fc407f Mon Sep 17 00:00:00 2001 From: azuryo Date: Tue, 5 Jul 2022 20:00:57 +0900 Subject: [PATCH 05/12] Microad Bid Adapter: Add Parrable ID --- modules/microadBidAdapter.js | 3 ++- test/spec/modules/microadBidAdapter_spec.js | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/microadBidAdapter.js b/modules/microadBidAdapter.js index 122d1914cc2..6c599088987 100644 --- a/modules/microadBidAdapter.js +++ b/modules/microadBidAdapter.js @@ -26,7 +26,8 @@ const AUDIENCE_IDS = [ {type: 6, bidKey: 'userId.imuid'}, {type: 7, bidKey: 'userId.id5id.uid'}, {type: 8, bidKey: 'userId.tdid'}, - {type: 9, bidKey: 'userId.novatiq.snowflake'} + {type: 9, bidKey: 'userId.novatiq.snowflake'}, + {type: 10, bidKey: 'userId.parrableId.eid'} ] function createCBT() { diff --git a/test/spec/modules/microadBidAdapter_spec.js b/test/spec/modules/microadBidAdapter_spec.js index f9664e05711..b6e9e3254c4 100644 --- a/test/spec/modules/microadBidAdapter_spec.js +++ b/test/spec/modules/microadBidAdapter_spec.js @@ -355,6 +355,21 @@ describe('microadBidAdapter', () => { ); }) }); + + it('should add Parrable ID if it is available in request parameters', () => { + const bidRequestWithNovatiq = Object.assign({}, bidRequestTemplate, { + userId: {parrableId: {eid: 'parrable-id-sample'}} + }); + const requests = spec.buildRequests([bidRequestWithNovatiq], bidderRequest) + requests.forEach(request => { + expect(request.data).to.deep.equal( + Object.assign({}, expectedResultTemplate, { + cbt: request.data.cbt, + aids: [{type: 10, id: 'parrable-id-sample'}] + }) + ); + }) + }); }); describe('interpretResponse', () => { From 9b3acfac9f2fde6545bfaa87a641b85a05eaf545 Mon Sep 17 00:00:00 2001 From: azuryo Date: Tue, 5 Jul 2022 20:01:05 +0900 Subject: [PATCH 06/12] Microad Bid Adapter: Add AudienceOne User ID --- modules/microadBidAdapter.js | 3 ++- test/spec/modules/microadBidAdapter_spec.js | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/microadBidAdapter.js b/modules/microadBidAdapter.js index 6c599088987..123bf79afc0 100644 --- a/modules/microadBidAdapter.js +++ b/modules/microadBidAdapter.js @@ -27,7 +27,8 @@ const AUDIENCE_IDS = [ {type: 7, bidKey: 'userId.id5id.uid'}, {type: 8, bidKey: 'userId.tdid'}, {type: 9, bidKey: 'userId.novatiq.snowflake'}, - {type: 10, bidKey: 'userId.parrableId.eid'} + {type: 10, bidKey: 'userId.parrableId.eid'}, + {type: 11, bidKey: 'userId.dacId.id'} ] function createCBT() { diff --git a/test/spec/modules/microadBidAdapter_spec.js b/test/spec/modules/microadBidAdapter_spec.js index b6e9e3254c4..68091d7b71b 100644 --- a/test/spec/modules/microadBidAdapter_spec.js +++ b/test/spec/modules/microadBidAdapter_spec.js @@ -370,6 +370,21 @@ describe('microadBidAdapter', () => { ); }) }); + + it('should add AudienceOne User ID if it is available in request parameters', () => { + const bidRequestWithNovatiq = Object.assign({}, bidRequestTemplate, { + userId: {dacId: {id: 'audiece-one-id-sample'}} + }); + const requests = spec.buildRequests([bidRequestWithNovatiq], bidderRequest) + requests.forEach(request => { + expect(request.data).to.deep.equal( + Object.assign({}, expectedResultTemplate, { + cbt: request.data.cbt, + aids: [{type: 11, id: 'audiece-one-id-sample'}] + }) + ); + }) + }); }); describe('interpretResponse', () => { From 16ac6ebe349faf07a8688f91f37ccc994265933f Mon Sep 17 00:00:00 2001 From: azuryo Date: Tue, 5 Jul 2022 20:01:13 +0900 Subject: [PATCH 07/12] Microad BidAdapter: Add Audience ID spec --- test/spec/modules/microadBidAdapter_spec.js | 123 ++++++-------------- 1 file changed, 36 insertions(+), 87 deletions(-) diff --git a/test/spec/modules/microadBidAdapter_spec.js b/test/spec/modules/microadBidAdapter_spec.js index 68091d7b71b..2839abdbe58 100644 --- a/test/spec/modules/microadBidAdapter_spec.js +++ b/test/spec/modules/microadBidAdapter_spec.js @@ -281,7 +281,7 @@ describe('microadBidAdapter', () => { }) }); - it('should not add Liveramp identity link if it is not available in request parameters', () => { + it('should not add Liveramp identity link and Audience ID if it is not available in request parameters', () => { const bidRequestWithLiveramp = Object.assign({}, bidRequestTemplate, { userId: {} }); @@ -296,95 +296,44 @@ describe('microadBidAdapter', () => { }) }); - it('should add IM-UID if it is available in request parameters', () => { - const bidRequestWithImuid = Object.assign({}, bidRequestTemplate, { - userId: {imuid: 'imuid-sample'} - }); - const requests = spec.buildRequests([bidRequestWithImuid], bidderRequest) - requests.forEach(request => { - expect(request.data).to.deep.equal( - Object.assign({}, expectedResultTemplate, { - cbt: request.data.cbt, - aids: [{type: 6, id: 'imuid-sample'}] - }) - ); - }) - }); - - it('should add ID5 ID if it is available in request parameters', () => { - const bidRequestWithId5id = Object.assign({}, bidRequestTemplate, { - userId: {id5id: {uid: 'id5id-sample'}} - }); - const requests = spec.buildRequests([bidRequestWithId5id], bidderRequest) - requests.forEach(request => { - expect(request.data).to.deep.equal( - Object.assign({}, expectedResultTemplate, { - cbt: request.data.cbt, - aids: [{type: 7, id: 'id5id-sample'}] - }) - ); - }) - }); - - it('should add Unified ID if it is available in request parameters', () => { - const bidRequestWithId5id = Object.assign({}, bidRequestTemplate, { - userId: {tdid: 'unified-id-sample'} - }); - const requests = spec.buildRequests([bidRequestWithId5id], bidderRequest) - requests.forEach(request => { - expect(request.data).to.deep.equal( - Object.assign({}, expectedResultTemplate, { - cbt: request.data.cbt, - aids: [{type: 8, id: 'unified-id-sample'}] - }) - ); - }) - }); - - it('should add Novatiq Hyper ID if it is available in request parameters', () => { - const bidRequestWithNovatiq = Object.assign({}, bidRequestTemplate, { - userId: {novatiq: {snowflake: 'novatiq-id-sample'}} - }); - const requests = spec.buildRequests([bidRequestWithNovatiq], bidderRequest) - requests.forEach(request => { - expect(request.data).to.deep.equal( - Object.assign({}, expectedResultTemplate, { - cbt: request.data.cbt, - aids: [{type: 9, id: 'novatiq-id-sample'}] - }) - ); - }) - }); - - it('should add Parrable ID if it is available in request parameters', () => { - const bidRequestWithNovatiq = Object.assign({}, bidRequestTemplate, { - userId: {parrableId: {eid: 'parrable-id-sample'}} - }); - const requests = spec.buildRequests([bidRequestWithNovatiq], bidderRequest) - requests.forEach(request => { - expect(request.data).to.deep.equal( - Object.assign({}, expectedResultTemplate, { - cbt: request.data.cbt, - aids: [{type: 10, id: 'parrable-id-sample'}] - }) - ); - }) - }); - - it('should add AudienceOne User ID if it is available in request parameters', () => { - const bidRequestWithNovatiq = Object.assign({}, bidRequestTemplate, { - userId: {dacId: {id: 'audiece-one-id-sample'}} - }); - const requests = spec.buildRequests([bidRequestWithNovatiq], bidderRequest) - requests.forEach(request => { - expect(request.data).to.deep.equal( - Object.assign({}, expectedResultTemplate, { + Object.entries({ + 'IM-UID': { + userId: {imuid: 'imuid-sample'}, + expected: [{type: 6, id: 'imuid-sample'}] + }, + 'ID5 ID': { + userId: {id5id: {uid: 'id5id-sample'}}, + expected: [{type: 7, id: 'id5id-sample'}] + }, + 'Unified ID': { + userId: {tdid: 'unified-sample'}, + expected: [{type: 8, id: 'unified-sample'}] + }, + 'Novatiq Snowflake ID': { + userId: {novatiq: {snowflake: 'novatiq-sample'}}, + expected: [{type: 9, id: 'novatiq-sample'}] + }, + 'Parrable ID': { + userId: {parrableId: {eid: 'parrable-sample'}}, + expected: [{type: 10, id: 'parrable-sample'}] + }, + 'AudienceOne User ID': { + userId: {dacId: {id: 'audience-one-sample'}}, + expected: [{type: 11, id: 'audience-one-sample'}] + } + }).forEach(([test, arg]) => { + it(`should add ${test} if it is available in request parameters`, () => { + const bidRequestWithUserId = { ...bidRequestTemplate, userId: arg.userId } + const requests = spec.buildRequests([bidRequestWithUserId], bidderRequest) + requests.forEach((request) => { + expect(request.data).to.deep.equal({ + ...expectedResultTemplate, cbt: request.data.cbt, - aids: [{type: 11, id: 'audiece-one-id-sample'}] + aids: arg.expected }) - ); + }) }) - }); + }) }); describe('interpretResponse', () => { From 88126f41a17d4041103171935b4ee7ecd33539e9 Mon Sep 17 00:00:00 2001 From: azuryo Date: Wed, 6 Jul 2022 16:06:59 +0900 Subject: [PATCH 08/12] Microad BidAdapter: Add Ramp ID in params --- modules/microadBidAdapter.js | 17 ++++++----- test/spec/modules/microadBidAdapter_spec.js | 34 +++++++-------------- 2 files changed, 20 insertions(+), 31 deletions(-) diff --git a/modules/microadBidAdapter.js b/modules/microadBidAdapter.js index 123bf79afc0..ea0dcca08df 100644 --- a/modules/microadBidAdapter.js +++ b/modules/microadBidAdapter.js @@ -28,7 +28,8 @@ const AUDIENCE_IDS = [ {type: 8, bidKey: 'userId.tdid'}, {type: 9, bidKey: 'userId.novatiq.snowflake'}, {type: 10, bidKey: 'userId.parrableId.eid'}, - {type: 11, bidKey: 'userId.dacId.id'} + {type: 11, bidKey: 'userId.dacId.id'}, + {type: 12, bidKey: 'userId.idl_env'} ] function createCBT() { @@ -92,18 +93,18 @@ export const spec = { } } - const idlEnv = deepAccess(bid, 'userId.idl_env') - if (!isEmpty(idlEnv) && isStr(idlEnv)) { - params['idl_env'] = idlEnv - } - + const aidsParams = [] AUDIENCE_IDS.forEach((audienceId) => { const bidAudienceId = deepAccess(bid, audienceId.bidKey); if (!isEmpty(bidAudienceId) && isStr(bidAudienceId)) { - params['aids'] = params['aids'] || [] - params['aids'].push({ type: audienceId.type, id: bidAudienceId }) + aidsParams.push({ type: audienceId.type, id: bidAudienceId }); + // Set Ramp ID + if (audienceId.type === 12) params['idl_env'] = bidAudienceId; } }) + if (aidsParams.length > 0) { + params['aids'] = JSON.stringify(aidsParams) + } requests.push({ method: 'GET', diff --git a/test/spec/modules/microadBidAdapter_spec.js b/test/spec/modules/microadBidAdapter_spec.js index 2839abdbe58..b4e9433990a 100644 --- a/test/spec/modules/microadBidAdapter_spec.js +++ b/test/spec/modules/microadBidAdapter_spec.js @@ -266,27 +266,11 @@ describe('microadBidAdapter', () => { }); }); - it('should add Liveramp identity link if it is available in request parameters', () => { - const bidRequestWithLiveramp = Object.assign({}, bidRequestTemplate, { - userId: {idl_env: 'idl-env-sample'} - }); - const requests = spec.buildRequests([bidRequestWithLiveramp], bidderRequest) - requests.forEach(request => { - expect(request.data).to.deep.equal( - Object.assign({}, expectedResultTemplate, { - cbt: request.data.cbt, - idl_env: 'idl-env-sample' - }) - ); - }) - }); - it('should not add Liveramp identity link and Audience ID if it is not available in request parameters', () => { const bidRequestWithLiveramp = Object.assign({}, bidRequestTemplate, { userId: {} }); const requests = spec.buildRequests([bidRequestWithLiveramp], bidderRequest) - const expectedResult = Object.assign({}, expectedResultTemplate) requests.forEach(request => { expect(request.data).to.deep.equal( Object.assign({}, expectedResultTemplate, { @@ -299,27 +283,31 @@ describe('microadBidAdapter', () => { Object.entries({ 'IM-UID': { userId: {imuid: 'imuid-sample'}, - expected: [{type: 6, id: 'imuid-sample'}] + expected: {aids: JSON.stringify([{type: 6, id: 'imuid-sample'}])} }, 'ID5 ID': { userId: {id5id: {uid: 'id5id-sample'}}, - expected: [{type: 7, id: 'id5id-sample'}] + expected: {aids: JSON.stringify([{type: 7, id: 'id5id-sample'}])} }, 'Unified ID': { userId: {tdid: 'unified-sample'}, - expected: [{type: 8, id: 'unified-sample'}] + expected: {aids: JSON.stringify([{type: 8, id: 'unified-sample'}])} }, 'Novatiq Snowflake ID': { userId: {novatiq: {snowflake: 'novatiq-sample'}}, - expected: [{type: 9, id: 'novatiq-sample'}] + expected: {aids: JSON.stringify([{type: 9, id: 'novatiq-sample'}])} }, 'Parrable ID': { userId: {parrableId: {eid: 'parrable-sample'}}, - expected: [{type: 10, id: 'parrable-sample'}] + expected: {aids: JSON.stringify([{type: 10, id: 'parrable-sample'}])} }, 'AudienceOne User ID': { userId: {dacId: {id: 'audience-one-sample'}}, - expected: [{type: 11, id: 'audience-one-sample'}] + expected: {aids: JSON.stringify([{type: 11, id: 'audience-one-sample'}])} + }, + 'Ramp ID and Liveramp identity': { + userId: {idl_env: 'idl-env-sample'}, + expected: {idl_env: 'idl-env-sample', aids: JSON.stringify([{type: 12, id: 'idl-env-sample'}])} } }).forEach(([test, arg]) => { it(`should add ${test} if it is available in request parameters`, () => { @@ -329,7 +317,7 @@ describe('microadBidAdapter', () => { expect(request.data).to.deep.equal({ ...expectedResultTemplate, cbt: request.data.cbt, - aids: arg.expected + ...arg.expected }) }) }) From 94eebbfe4fc41a0aa4cd59eb3db153c5ade9de97 Mon Sep 17 00:00:00 2001 From: azuryo Date: Thu, 7 Jul 2022 11:33:44 +0900 Subject: [PATCH 09/12] Microad BidAdapter: Fix Audience ID --- modules/microadBidAdapter.js | 14 +++++++------- test/spec/modules/microadBidAdapter_spec.js | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/microadBidAdapter.js b/modules/microadBidAdapter.js index ea0dcca08df..d28da400b32 100644 --- a/modules/microadBidAdapter.js +++ b/modules/microadBidAdapter.js @@ -24,12 +24,12 @@ const VIDEO_CODE = 4; const AUDIENCE_IDS = [ {type: 6, bidKey: 'userId.imuid'}, - {type: 7, bidKey: 'userId.id5id.uid'}, - {type: 8, bidKey: 'userId.tdid'}, - {type: 9, bidKey: 'userId.novatiq.snowflake'}, - {type: 10, bidKey: 'userId.parrableId.eid'}, - {type: 11, bidKey: 'userId.dacId.id'}, - {type: 12, bidKey: 'userId.idl_env'} + {type: 8, bidKey: 'userId.id5id.uid'}, + {type: 9, bidKey: 'userId.tdid'}, + {type: 10, bidKey: 'userId.novatiq.snowflake'}, + {type: 11, bidKey: 'userId.parrableId.eid'}, + {type: 12, bidKey: 'userId.dacId.id'}, + {type: 13, bidKey: 'userId.idl_env'} ] function createCBT() { @@ -99,7 +99,7 @@ export const spec = { if (!isEmpty(bidAudienceId) && isStr(bidAudienceId)) { aidsParams.push({ type: audienceId.type, id: bidAudienceId }); // Set Ramp ID - if (audienceId.type === 12) params['idl_env'] = bidAudienceId; + if (audienceId.type === 13) params['idl_env'] = bidAudienceId; } }) if (aidsParams.length > 0) { diff --git a/test/spec/modules/microadBidAdapter_spec.js b/test/spec/modules/microadBidAdapter_spec.js index b4e9433990a..f08e3f40582 100644 --- a/test/spec/modules/microadBidAdapter_spec.js +++ b/test/spec/modules/microadBidAdapter_spec.js @@ -287,27 +287,27 @@ describe('microadBidAdapter', () => { }, 'ID5 ID': { userId: {id5id: {uid: 'id5id-sample'}}, - expected: {aids: JSON.stringify([{type: 7, id: 'id5id-sample'}])} + expected: {aids: JSON.stringify([{type: 8, id: 'id5id-sample'}])} }, 'Unified ID': { userId: {tdid: 'unified-sample'}, - expected: {aids: JSON.stringify([{type: 8, id: 'unified-sample'}])} + expected: {aids: JSON.stringify([{type: 9, id: 'unified-sample'}])} }, 'Novatiq Snowflake ID': { userId: {novatiq: {snowflake: 'novatiq-sample'}}, - expected: {aids: JSON.stringify([{type: 9, id: 'novatiq-sample'}])} + expected: {aids: JSON.stringify([{type: 10, id: 'novatiq-sample'}])} }, 'Parrable ID': { userId: {parrableId: {eid: 'parrable-sample'}}, - expected: {aids: JSON.stringify([{type: 10, id: 'parrable-sample'}])} + expected: {aids: JSON.stringify([{type: 11, id: 'parrable-sample'}])} }, 'AudienceOne User ID': { userId: {dacId: {id: 'audience-one-sample'}}, - expected: {aids: JSON.stringify([{type: 11, id: 'audience-one-sample'}])} + expected: {aids: JSON.stringify([{type: 12, id: 'audience-one-sample'}])} }, 'Ramp ID and Liveramp identity': { userId: {idl_env: 'idl-env-sample'}, - expected: {idl_env: 'idl-env-sample', aids: JSON.stringify([{type: 12, id: 'idl-env-sample'}])} + expected: {idl_env: 'idl-env-sample', aids: JSON.stringify([{type: 13, id: 'idl-env-sample'}])} } }).forEach(([test, arg]) => { it(`should add ${test} if it is available in request parameters`, () => { From 7c139fca664537e150930c73955e51fb3e9389fd Mon Sep 17 00:00:00 2001 From: azuryo Date: Wed, 13 Jul 2022 18:09:40 +0900 Subject: [PATCH 10/12] Microad BidAdapter: Add Criteo ID and Shared ID --- modules/microadBidAdapter.js | 4 +++- test/spec/modules/microadBidAdapter_spec.js | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/microadBidAdapter.js b/modules/microadBidAdapter.js index d28da400b32..0321bc34c18 100644 --- a/modules/microadBidAdapter.js +++ b/modules/microadBidAdapter.js @@ -29,7 +29,9 @@ const AUDIENCE_IDS = [ {type: 10, bidKey: 'userId.novatiq.snowflake'}, {type: 11, bidKey: 'userId.parrableId.eid'}, {type: 12, bidKey: 'userId.dacId.id'}, - {type: 13, bidKey: 'userId.idl_env'} + {type: 13, bidKey: 'userId.idl_env'}, + {type: 14, bidKey: 'userId.criteoId'}, + {type: 15, bidKey: 'userId.pubcId'} ] function createCBT() { diff --git a/test/spec/modules/microadBidAdapter_spec.js b/test/spec/modules/microadBidAdapter_spec.js index f08e3f40582..bb5bac39ef3 100644 --- a/test/spec/modules/microadBidAdapter_spec.js +++ b/test/spec/modules/microadBidAdapter_spec.js @@ -308,6 +308,14 @@ describe('microadBidAdapter', () => { 'Ramp ID and Liveramp identity': { userId: {idl_env: 'idl-env-sample'}, expected: {idl_env: 'idl-env-sample', aids: JSON.stringify([{type: 13, id: 'idl-env-sample'}])} + }, + 'Criteo ID': { + userId: {criteoId: 'criteo-id-sample'}, + expected: {aids: JSON.stringify([{type: 14, id: 'criteo-id-sample'}])} + }, + 'Shared ID': { + userId: {pubcId: 'shared-id-sample'}, + expected: {aids: JSON.stringify([{type: 15, id: 'shared-id-sample'}])} } }).forEach(([test, arg]) => { it(`should add ${test} if it is available in request parameters`, () => { From 86b3ce5f11d4d77c49ab29f4e1d1bfc6cbc2e44d Mon Sep 17 00:00:00 2001 From: azuryo Date: Wed, 13 Jul 2022 20:26:35 +0900 Subject: [PATCH 11/12] Microad BidAdapter: Fix typo --- modules/microadBidAdapter.js | 2 +- test/spec/modules/microadBidAdapter_spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/microadBidAdapter.js b/modules/microadBidAdapter.js index 0321bc34c18..d5116b1dcb0 100644 --- a/modules/microadBidAdapter.js +++ b/modules/microadBidAdapter.js @@ -31,7 +31,7 @@ const AUDIENCE_IDS = [ {type: 12, bidKey: 'userId.dacId.id'}, {type: 13, bidKey: 'userId.idl_env'}, {type: 14, bidKey: 'userId.criteoId'}, - {type: 15, bidKey: 'userId.pubcId'} + {type: 15, bidKey: 'userId.pubcid'} ] function createCBT() { diff --git a/test/spec/modules/microadBidAdapter_spec.js b/test/spec/modules/microadBidAdapter_spec.js index bb5bac39ef3..5562cdc7842 100644 --- a/test/spec/modules/microadBidAdapter_spec.js +++ b/test/spec/modules/microadBidAdapter_spec.js @@ -314,7 +314,7 @@ describe('microadBidAdapter', () => { expected: {aids: JSON.stringify([{type: 14, id: 'criteo-id-sample'}])} }, 'Shared ID': { - userId: {pubcId: 'shared-id-sample'}, + userId: {pubcid: 'shared-id-sample'}, expected: {aids: JSON.stringify([{type: 15, id: 'shared-id-sample'}])} } }).forEach(([test, arg]) => { From 9ed2ded075d730a305e8cb6af186c56c28258f9c Mon Sep 17 00:00:00 2001 From: azuryo Date: Fri, 22 Jul 2022 11:39:16 +0900 Subject: [PATCH 12/12] Microad BidAdapter: Fix variable name --- test/spec/modules/microadBidAdapter_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/spec/modules/microadBidAdapter_spec.js b/test/spec/modules/microadBidAdapter_spec.js index 5562cdc7842..cca337c83f2 100644 --- a/test/spec/modules/microadBidAdapter_spec.js +++ b/test/spec/modules/microadBidAdapter_spec.js @@ -267,10 +267,10 @@ describe('microadBidAdapter', () => { }); it('should not add Liveramp identity link and Audience ID if it is not available in request parameters', () => { - const bidRequestWithLiveramp = Object.assign({}, bidRequestTemplate, { + const bidRequestWithOutLiveramp = Object.assign({}, bidRequestTemplate, { userId: {} }); - const requests = spec.buildRequests([bidRequestWithLiveramp], bidderRequest) + const requests = spec.buildRequests([bidRequestWithOutLiveramp], bidderRequest) requests.forEach(request => { expect(request.data).to.deep.equal( Object.assign({}, expectedResultTemplate, {