diff --git a/src/adapters/pulsepoint.js b/src/adapters/pulsepoint.js index ef82b05f4e5..42479b895a3 100644 --- a/src/adapters/pulsepoint.js +++ b/src/adapters/pulsepoint.js @@ -19,21 +19,28 @@ var PulsePointAdapter = function PulsePointAdapter() { var bids = params.bids; for (var i = 0; i < bids.length; i++) { var bidRequest = bids[i]; - var callback = bidResponseCallback(bidRequest); - var ppBidRequest = new window.pp.Ad({ - cf: bidRequest.params.cf, - cp: bidRequest.params.cp, - ct: bidRequest.params.ct, - cn: 1, - ca: window.pp.requestActions.BID, - cu: bidUrl, - adUnitId: bidRequest.placementCode, - callback: callback - }); + var ppBidRequest = new window.pp.Ad(bidRequestOptions(bidRequest)); ppBidRequest.display(); } } + function bidRequestOptions(bidRequest) { + var callback = bidResponseCallback(bidRequest); + var options = { + cn: 1, + ca: window.pp.requestActions.BID, + cu: bidUrl, + adUnitId: bidRequest.placementCode, + callback: callback + }; + for(var param in bidRequest.params) { + if(bidRequest.params.hasOwnProperty(param)) { + options[param] = bidRequest.params[param]; + } + } + return options; + } + function bidResponseCallback(bid) { return function (bidResponse) { bidResponseAvailable(bid, bidResponse); diff --git a/test/spec/adapters/pulsepoint_spec.js b/test/spec/adapters/pulsepoint_spec.js index 96755a36207..9c901cd149b 100644 --- a/test/spec/adapters/pulsepoint_spec.js +++ b/test/spec/adapters/pulsepoint_spec.js @@ -44,7 +44,9 @@ describe("PulsePoint Adapter Tests", () => { params: { cp: "p10000", ct: "t10000", - cf: "300x250" + cf: "300x250", + param1: "value1", + param2: 2 } },{ placementCode: "/DfpAccount2/slot2", @@ -79,6 +81,8 @@ describe("PulsePoint Adapter Tests", () => { expect(requests[0].cu).to.equal('http://bid.contextweb.com/header/tag'); expect(requests[0].adUnitId).to.equal('/DfpAccount1/slot1'); expect(requests[0]).to.have.property('callback'); + expect(requests[0].param1).to.equal('value1'); + expect(requests[0].param2).to.equal(2); // //slot 2 expect(requests[1].cp).to.equal('p20000'); expect(requests[1].ct).to.equal('t20000');