Skip to content

Commit

Permalink
Sonobi - removed unneeded query params (prebid#4735)
Browse files Browse the repository at this point in the history
* removed tdid query param since it is passed in the userid obj

* removed pub common id being passed to hfa
  • Loading branch information
JonGoSonobi authored and hellsingblack committed Mar 5, 2020
1 parent b847f03 commit 0e51057
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 62 deletions.
8 changes: 0 additions & 8 deletions modules/sonobiBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,6 @@ export const spec = {

if (deepAccess(validBidRequests[0], 'params.hfa')) {
payload.hfa = deepAccess(validBidRequests[0], 'params.hfa');
} else if (deepAccess(validBidRequests[0], 'userId.pubcid')) {
payload.hfa = `PRE-${validBidRequests[0].userId.pubcid}`;
} else if (deepAccess(validBidRequests[0], 'crumbs.pubcid')) {
payload.hfa = `PRE-${validBidRequests[0].crumbs.pubcid}`;
}

if (deepAccess(validBidRequests[0], 'userId.tdid')) {
payload.tdid = validBidRequests[0].userId.tdid;
}

if (validBidRequests[0].params.referrer) {
Expand Down
54 changes: 0 additions & 54 deletions test/spec/modules/sonobiBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,62 +436,8 @@ describe('SonobiBidAdapter', function () {
it('should return null if there is nothing to bid on', function () {
const bidRequests = spec.buildRequests([{params: {}}], bidderRequests)
expect(bidRequests).to.equal(null);
})

it('should return a properly formatted request with commonid as hfa', function () {
delete bidRequest[0].params.hfa;
delete bidRequest[1].params.hfa;
bidRequest[0].crumbs = {'pubcid': 'abcd-efg-0101'};
bidRequest[1].crumbs = {'pubcid': 'abcd-efg-0101'};
const bidRequests = spec.buildRequests(bidRequest, bidderRequests);
expect(bidRequests.url).to.equal('https://apex.go.sonobi.com/trinity.json');
expect(bidRequests.method).to.equal('GET');
expect(bidRequests.data.ref).not.to.be.empty;
expect(bidRequests.data.s).not.to.be.empty;
expect(bidRequests.data.hfa).to.equal('PRE-abcd-efg-0101');
});

it('should return a properly formatted request with commonid from User ID as hfa', function () {
delete bidRequest[0].params.hfa;
delete bidRequest[1].params.hfa;
bidRequest[0].userId = {'pubcid': 'abcd-efg-0101'};
bidRequest[1].userId = {'pubcid': 'abcd-efg-0101'};
const bidRequests = spec.buildRequests(bidRequest, bidderRequests);
expect(bidRequests.url).to.equal('https://apex.go.sonobi.com/trinity.json');
expect(bidRequests.method).to.equal('GET');
expect(bidRequests.data.ref).not.to.be.empty;
expect(bidRequests.data.s).not.to.be.empty;
expect(bidRequests.data.hfa).to.equal('PRE-abcd-efg-0101');
delete bidRequest[0].userId;
delete bidRequest[1].userId;
})

it('should return a properly formatted request with unified id from User ID as tdid', function () {
delete bidRequest[0].params.tdid;
delete bidRequest[1].params.tdid;
bidRequest[0].userId = {'tdid': 'td-abcd-efg-0101'};
bidRequest[1].userId = {'tdid': 'td-abcd-efg-0101'};
const bidRequests = spec.buildRequests(bidRequest, bidderRequests);
expect(bidRequests.url).to.equal('https://apex.go.sonobi.com/trinity.json');
expect(bidRequests.method).to.equal('GET');
expect(bidRequests.data.ref).not.to.be.empty;
expect(bidRequests.data.s).not.to.be.empty;
expect(bidRequests.data.tdid).to.equal('td-abcd-efg-0101');
})

it('should return a properly formatted request with hfa preferred over commonid', function () {
bidRequest[0].params.hfa = 'hfakey';
bidRequest[1].params.hfa = 'hfakey';
bidRequest[0].crumbs = {'pubcid': 'abcd-efg-0101'};
bidRequest[1].crumbs = {'pubcid': 'abcd-efg-0101'};
const bidRequests = spec.buildRequests(bidRequest, bidderRequests)
expect(bidRequests.url).to.equal('https://apex.go.sonobi.com/trinity.json')
expect(bidRequests.method).to.equal('GET')
expect(bidRequests.data.ref).not.to.be.empty
expect(bidRequests.data.s).not.to.be.empty
expect(bidRequests.data.hfa).to.equal('hfakey')
})

it('should set ius as 0 if Sonobi cannot drop iframe pixels', function () {
userSync.canBidderRegisterSync.returns(false);
const bidRequests = spec.buildRequests(bidRequest, bidderRequests);
Expand Down

0 comments on commit 0e51057

Please sign in to comment.