diff --git a/modules/sovrnBidAdapter.js b/modules/sovrnBidAdapter.js index 13f04395afa..d13331b9179 100644 --- a/modules/sovrnBidAdapter.js +++ b/modules/sovrnBidAdapter.js @@ -23,7 +23,9 @@ export const spec = { */ buildRequests: function(bidReqs) { let sovrnImps = []; + let iv; utils._each(bidReqs, function (bid) { + iv = iv || utils.getBidIdParameter('iv', bid.params); sovrnImps.push({ id: bid.bidId, banner: { w: 1, h: 1 }, @@ -36,9 +38,11 @@ export const spec = { imp: sovrnImps, site: { domain: window.location.host, - page: window.location.pathname + location.search + location.hash + page: window.location.host + window.location.pathname + location.search + location.hash } }; + if (iv) sovrnBidReq.iv = iv; + return { method: 'POST', url: `//ap.lijit.com/rtb/bid?src=${REPO_AND_VERSION}`, diff --git a/test/spec/modules/sovrnBidAdapter_spec.js b/test/spec/modules/sovrnBidAdapter_spec.js index 43307f35527..5fc7cb6a62a 100644 --- a/test/spec/modules/sovrnBidAdapter_spec.js +++ b/test/spec/modules/sovrnBidAdapter_spec.js @@ -40,7 +40,7 @@ describe('sovrnBidAdapter', function() { }); describe('buildRequests', () => { - let bidRequests = [{ + const bidRequests = [{ 'bidder': 'sovrn', 'params': { 'tagid': '403370' @@ -63,6 +63,26 @@ describe('sovrnBidAdapter', function() { it('attaches source and version to endpoint URL as query params', () => { expect(request.url).to.equal(ENDPOINT) }); + + it('sends \'iv\' as query param if present', () => { + const ivBidRequests = [{ + 'bidder': 'sovrn', + 'params': { + 'tagid': '403370', + 'iv': 'vet' + }, + 'adUnitCode': 'adunit-code', + 'sizes': [ + [300, 250] + ], + 'bidId': '30b31c1838de1e', + 'bidderRequestId': '22edbae2733bf6', + 'auctionId': '1d1a030790a475' + }]; + const request = spec.buildRequests(ivBidRequests); + + expect(request.data).to.contain('"iv":"vet"') + }) }); describe('interpretResponse', () => {