From 51aee0c098feb03b0a233631c52f0a9cff251a75 Mon Sep 17 00:00:00 2001 From: David Reischer Date: Mon, 26 Nov 2018 10:48:54 +0000 Subject: [PATCH 1/2] Add advertiser ID for Index, OpenX and PubMatic --- modules/ixBidAdapter.js | 5 +++++ modules/openxBidAdapter.js | 3 +++ modules/pubmaticBidAdapter.js | 7 ++++++- test/spec/modules/ixBidAdapter_spec.js | 28 ++++++++++++++++++++++---- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/modules/ixBidAdapter.js b/modules/ixBidAdapter.js index c09a35e4d67..b5c5546a16e 100644 --- a/modules/ixBidAdapter.js +++ b/modules/ixBidAdapter.js @@ -87,6 +87,11 @@ function parseBid(rawBid, currency) { bid.netRevenue = NET_REVENUE; bid.currency = currency; bid.creativeId = rawBid.hasOwnProperty('crid') ? rawBid.crid : '-'; + bid.ix = { + advbrandid: utils.deepAccess(rawBid, 'ext.advbrandid'), + advbrand: utils.deepAccess(rawBid, 'ext.advbrand'), + adomain: rawBid.adomain + }; return bid; } diff --git a/modules/openxBidAdapter.js b/modules/openxBidAdapter.js index 7119d669cb4..5aeca550f3f 100644 --- a/modules/openxBidAdapter.js +++ b/modules/openxBidAdapter.js @@ -114,6 +114,9 @@ function createBannerBidResponses(oxResponseObj, {bids, startTime}) { bidResponse.tbd = adUnit.tbd; } bidResponse.ts = adUnit.ts; + bidResponse.openx = { + brand_id: adUnit.brand_id + }; bidResponses.push(bidResponse); diff --git a/modules/pubmaticBidAdapter.js b/modules/pubmaticBidAdapter.js index 354addc6def..538f36cf15c 100644 --- a/modules/pubmaticBidAdapter.js +++ b/modules/pubmaticBidAdapter.js @@ -492,7 +492,12 @@ export const spec = { netRevenue: NET_REVENUE, ttl: 300, referrer: utils.getTopWindowUrl(), - ad: bid.adm + ad: bid.adm, + pubmatic: { + dspid: utils.deepAccess(bid, 'ext.dspid'), + advid: utils.deepAccess(bid, 'ext.advid'), + adomain: bid.adomain, + } }; let parsedRequest = JSON.parse(request.data); if (parsedRequest.imp && parsedRequest.imp.length > 0) { diff --git a/test/spec/modules/ixBidAdapter_spec.js b/test/spec/modules/ixBidAdapter_spec.js index 8e0df9959ef..4319670c46e 100644 --- a/test/spec/modules/ixBidAdapter_spec.js +++ b/test/spec/modules/ixBidAdapter_spec.js @@ -416,7 +416,12 @@ describe('IndexexchangeAdapter', function () { currency: 'USD', ttl: 35, netRevenue: true, - dealId: undefined + dealId: undefined, + ix: { + advbrandid: 303325, + advbrand: 'OECTA', + adomain: ['www.abc.com'] + } } ]; const result = spec.interpretResponse({ body: DEFAULT_BANNER_BID_RESPONSE }); @@ -437,7 +442,12 @@ describe('IndexexchangeAdapter', function () { currency: 'USD', ttl: 35, netRevenue: true, - dealId: undefined + dealId: undefined, + ix: { + advbrandid: 303325, + advbrand: 'OECTA', + adomain: ['www.abc.com'] + } } ]; const result = spec.interpretResponse({ body: bidResponse }); @@ -458,7 +468,12 @@ describe('IndexexchangeAdapter', function () { currency: 'JPY', ttl: 35, netRevenue: true, - dealId: undefined + dealId: undefined, + ix: { + advbrandid: 303325, + advbrand: 'OECTA', + adomain: ['www.abc.com'] + } } ]; const result = spec.interpretResponse({ body: bidResponse }); @@ -479,7 +494,12 @@ describe('IndexexchangeAdapter', function () { currency: 'USD', ttl: 35, netRevenue: true, - dealId: 'deal' + dealId: 'deal', + ix: { + advbrandid: 303325, + advbrand: 'OECTA', + adomain: ['www.abc.com'] + } } ]; const result = spec.interpretResponse({ body: bidResponse }); From 101844182d5c92f0d87b6f64eb943d35a8e14819 Mon Sep 17 00:00:00 2001 From: David Reischer Date: Fri, 15 Mar 2019 12:12:16 +0000 Subject: [PATCH 2/2] adding DSP ID for IX --- modules/ixBidAdapter.js | 1 + test/spec/modules/ixBidAdapter_spec.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/modules/ixBidAdapter.js b/modules/ixBidAdapter.js index 0433c539de4..af9f1d2abe9 100644 --- a/modules/ixBidAdapter.js +++ b/modules/ixBidAdapter.js @@ -77,6 +77,7 @@ function parseBid(rawBid, currency) { bid.currency = currency; bid.creativeId = rawBid.hasOwnProperty('crid') ? rawBid.crid : '-'; bid.ix = { + dspid: utils.deepAccess(rawBid, 'ext.dspid'), advbrandid: utils.deepAccess(rawBid, 'ext.advbrandid'), advbrand: utils.deepAccess(rawBid, 'ext.advbrand'), adomain: rawBid.adomain diff --git a/test/spec/modules/ixBidAdapter_spec.js b/test/spec/modules/ixBidAdapter_spec.js index 670bb57b9c3..0a0618aba33 100644 --- a/test/spec/modules/ixBidAdapter_spec.js +++ b/test/spec/modules/ixBidAdapter_spec.js @@ -426,6 +426,7 @@ describe('IndexexchangeAdapter', function () { netRevenue: true, dealId: undefined, ix: { + dspid: 50, advbrandid: 303325, advbrand: 'OECTA', adomain: ['www.abc.com'] @@ -452,6 +453,7 @@ describe('IndexexchangeAdapter', function () { netRevenue: true, dealId: undefined, ix: { + dspid: 50, advbrandid: 303325, advbrand: 'OECTA', adomain: ['www.abc.com'] @@ -478,6 +480,7 @@ describe('IndexexchangeAdapter', function () { netRevenue: true, dealId: undefined, ix: { + dspid: 50, advbrandid: 303325, advbrand: 'OECTA', adomain: ['www.abc.com'] @@ -504,6 +507,7 @@ describe('IndexexchangeAdapter', function () { netRevenue: true, dealId: 'deal', ix: { + dspid: 50, advbrandid: 303325, advbrand: 'OECTA', adomain: ['www.abc.com']