From dbb9c0aa40fa3972e68a8a7d485c3a4ced8152e4 Mon Sep 17 00:00:00 2001 From: jgan91 Date: Wed, 9 Jun 2021 10:46:48 +1000 Subject: [PATCH] add advertiserDomain to bid object --- modules/pxyzBidAdapter.js | 4 ++++ test/spec/modules/pxyzBidAdapter_spec.js | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/pxyzBidAdapter.js b/modules/pxyzBidAdapter.js index bd2189ccc39..9baff4d1533 100644 --- a/modules/pxyzBidAdapter.js +++ b/modules/pxyzBidAdapter.js @@ -133,6 +133,7 @@ export const spec = { } function newBid(bid, currency) { + const { adomain } = bid; return { requestId: bid.impid, mediaType: BANNER, @@ -144,6 +145,9 @@ function newBid(bid, currency) { ttl: 300, netRevenue: true, currency: currency, + meta: { + ...(adomain && adomain.length > 0 ? { advertiserDomains: adomain } : {}) + } }; } diff --git a/test/spec/modules/pxyzBidAdapter_spec.js b/test/spec/modules/pxyzBidAdapter_spec.js index 6d8c6056076..21dd252c909 100644 --- a/test/spec/modules/pxyzBidAdapter_spec.js +++ b/test/spec/modules/pxyzBidAdapter_spec.js @@ -191,11 +191,15 @@ describe('pxyzBidAdapter', function () { 'mediaType': 'banner', 'currency': 'AUD', 'ttl': 300, - 'netRevenue': true + 'netRevenue': true, + 'meta': { + advertiserDomains: ['pg.xyz'] + } } ]; let result = spec.interpretResponse({ body: response }, {bidderRequest}); expect(Object.keys(result[0])).to.have.members(Object.keys(expectedResponse[0])); + expect(result[0].meta.advertiserDomains).to.deep.equal(expectedResponse[0].meta.advertiserDomains); }); it('handles nobid response', function () {