diff --git a/modules/connatixBidAdapter.js b/modules/connatixBidAdapter.js index df56ad580bc..7524cd4e194 100644 --- a/modules/connatixBidAdapter.js +++ b/modules/connatixBidAdapter.js @@ -117,13 +117,12 @@ export const spec = { interpretResponse: (serverResponse) => { const responseBody = serverResponse.body; const bids = responseBody.Bids; - const playerId = responseBody.PlayerId; - const customerId = responseBody.CustomerId; - if (!isArray(bids) || !playerId || !customerId) { + if (!isArray(bids)) { return []; } + const referrer = responseBody.Referrer; return bids.map(bidResponse => ({ requestId: bidResponse.RequestId, cpm: bidResponse.Cpm, @@ -134,8 +133,8 @@ export const spec = { width: bidResponse.Width, height: bidResponse.Height, creativeId: bidResponse.CreativeId, - referrer: bidResponse.Referrer, ad: bidResponse.Ad, + referrer: referrer, })); }, diff --git a/modules/connatixBidAdapter.md b/modules/connatixBidAdapter.md index 7ac04a64245..595c294e311 100644 --- a/modules/connatixBidAdapter.md +++ b/modules/connatixBidAdapter.md @@ -9,7 +9,24 @@ Maintainer: prebid_integration@connatix.com # Description Connects to Connatix demand source to fetch bids. -Please use ```connatix``` as the bidder code. +Please use ```connatix``` as the bidder code. + +# Configuration +Connatix requires that ```iframe``` is used for user syncing. + +Example configuration: +``` +pbjs.setConfig({ + userSync: { + filterSettings: { + iframe: { + bidders: '*', // represents all bidders + filter: 'include' + } + } + } +}); +``` # Test Parameters ``` diff --git a/test/spec/modules/connatixBidAdapter_spec.js b/test/spec/modules/connatixBidAdapter_spec.js index 16ead9f9458..78f6a9d410d 100644 --- a/test/spec/modules/connatixBidAdapter_spec.js +++ b/test/spec/modules/connatixBidAdapter_spec.js @@ -135,14 +135,12 @@ describe('connatixBidAdapter', function () { describe('interpretResponse', function () { const CustomerId = '99f20d18-c4b4-4a28-3d8e-d43e2c8cb4ac'; const PlayerId = 'e4984e88-9ff4-45a3-8b9d-33aabcad634f'; - const Bid = {Cpm: 0.1, LineItems: [], RequestId: '2f897340c4eaa3', Ttl: 86400}; + const Bid = {Cpm: 0.1, RequestId: '2f897340c4eaa3', Ttl: 86400, CustomerId, PlayerId}; let serverResponse; this.beforeEach(function () { serverResponse = { body: { - CustomerId, - PlayerId, Bids: [ Bid ] }, headers: function() { } @@ -162,18 +160,6 @@ describe('connatixBidAdapter', function () { expect(response).to.be.an('array').that.is.empty; }); - it('Should return an empty array if CustomerId is null', function () { - serverResponse.body.CustomerId = null; - const response = spec.interpretResponse(serverResponse); - expect(response).to.be.an('array').that.is.empty; - }); - - it('Should return an empty array if PlayerId is null', function () { - serverResponse.body.PlayerId = null; - const response = spec.interpretResponse(serverResponse); - expect(response).to.be.an('array').that.is.empty; - }); - it('Should return one bid response for one bid', function() { const bidResponses = spec.interpretResponse(serverResponse); expect(bidResponses.length).to.equal(1); @@ -212,12 +198,10 @@ describe('connatixBidAdapter', function () { const CustomerId = '99f20d18-c4b4-4a28-3d8e-d43e2c8cb4ac'; const PlayerId = 'e4984e88-9ff4-45a3-8b9d-33aabcad634f'; const UserSyncEndpoint = 'https://connatix.com/sync' - const Bid = {Cpm: 0.1, LineItems: [], RequestId: '2f897340c4eaa3', Ttl: 86400}; + const Bid = {Cpm: 0.1, RequestId: '2f897340c4eaa3', Ttl: 86400, CustomerId, PlayerId}; const serverResponse = { body: { - CustomerId, - PlayerId, UserSyncEndpoint, Bids: [ Bid ] },