From 005dcee0e599e32d7771c64a7bc3b99f705e8c6d Mon Sep 17 00:00:00 2001 From: Jonathan Go Date: Fri, 6 Dec 2019 10:55:31 -0500 Subject: [PATCH] added new param to sonobi adapter: keywords --- modules/sonobiBidAdapter.js | 6 ++++++ test/spec/modules/sonobiBidAdapter_spec.js | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/sonobiBidAdapter.js b/modules/sonobiBidAdapter.js index 3fb9a83d259..eea25d98d90 100644 --- a/modules/sonobiBidAdapter.js +++ b/modules/sonobiBidAdapter.js @@ -136,6 +136,12 @@ export const spec = { payload.userid = JSON.stringify(validBidRequests[0].userId); } + let keywords = validBidRequests[0].params.keywords; // a CSV of keywords + + if (keywords) { + payload.kw = keywords; + } + // If there is no key_maker data, then don't make the request. if (isEmpty(data)) { return null; diff --git a/test/spec/modules/sonobiBidAdapter_spec.js b/test/spec/modules/sonobiBidAdapter_spec.js index a6bf88cfc74..f0fd220255c 100644 --- a/test/spec/modules/sonobiBidAdapter_spec.js +++ b/test/spec/modules/sonobiBidAdapter_spec.js @@ -262,6 +262,7 @@ describe('SonobiBidAdapter', function () { }, 'bidder': 'sonobi', 'params': { + 'keywords': 'sports,news,some_other_keyword', 'placement_id': '1a2b3c4d5e6f1a2b3c4d', 'sizes': [[300, 250], [300, 600]], 'floor': '1.25', @@ -341,7 +342,7 @@ describe('SonobiBidAdapter', function () { expect(bidRequests.data.digkeyv).to.be.undefined; sandbox.restore(); delete window.DigiTrust; - }) + }); it('should return a properly formatted request', function () { const bidRequests = spec.buildRequests(bidRequest, bidderRequests) @@ -539,6 +540,11 @@ describe('SonobiBidAdapter', function () { expect(bidRequests.data.s).not.to.be.empty; expect(bidRequests.data.userid).to.equal(undefined); }); + + it('should return a properly formatted request with keywrods included as a csv of strings', function() { + const bidRequests = spec.buildRequests(bidRequest, bidderRequests); + expect(bidRequests.data.kw).to.equal('sports,news,some_other_keyword'); + }); }) describe('.interpretResponse', function () {