Skip to content

Commit

Permalink
Add buyer data to Index bid responses
Browse files Browse the repository at this point in the history
Following format specified in
prebid#3115
  • Loading branch information
kelvin-chappell committed Mar 12, 2019
1 parent 0b39298 commit 39cf8e0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
5 changes: 5 additions & 0 deletions modules/ixBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ function parseBid(rawBid, currency) {
bid.currency = currency;
bid.creativeId = rawBid.hasOwnProperty('crid') ? rawBid.crid : '-';

bid.meta = {};
bid.meta.networkId = utils.deepAccess(rawBid, 'ext.dspid');
bid.meta.brandId = utils.deepAccess(rawBid, 'ext.advbrandid');
bid.meta.brandName = utils.deepAccess(rawBid, 'ext.advbrand');

return bid;
}

Expand Down
28 changes: 24 additions & 4 deletions test/spec/modules/ixBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,12 @@ describe('IndexexchangeAdapter', function () {
currency: 'USD',
ttl: 35,
netRevenue: true,
dealId: undefined
dealId: undefined,
meta: {
networkId: 50,
brandId: 303325,
brandName: 'OECTA'
}
}
];
const result = spec.interpretResponse({ body: DEFAULT_BANNER_BID_RESPONSE });
Expand All @@ -445,7 +450,12 @@ describe('IndexexchangeAdapter', function () {
currency: 'USD',
ttl: 35,
netRevenue: true,
dealId: undefined
dealId: undefined,
meta: {
networkId: 50,
brandId: 303325,
brandName: 'OECTA'
}
}
];
const result = spec.interpretResponse({ body: bidResponse });
Expand All @@ -466,7 +476,12 @@ describe('IndexexchangeAdapter', function () {
currency: 'JPY',
ttl: 35,
netRevenue: true,
dealId: undefined
dealId: undefined,
meta: {
networkId: 50,
brandId: 303325,
brandName: 'OECTA'
}
}
];
const result = spec.interpretResponse({ body: bidResponse });
Expand All @@ -487,7 +502,12 @@ describe('IndexexchangeAdapter', function () {
currency: 'USD',
ttl: 35,
netRevenue: true,
dealId: 'deal'
dealId: 'deal',
meta: {
networkId: 50,
brandId: 303325,
brandName: 'OECTA'
}
}
];
const result = spec.interpretResponse({ body: bidResponse });
Expand Down

0 comments on commit 39cf8e0

Please sign in to comment.