From 642803b541e19a145c2c93ec6a716d9ae86bde71 Mon Sep 17 00:00:00 2001 From: Renee Woo Date: Tue, 1 Jun 2021 14:10:44 +0800 Subject: [PATCH 1/8] Adapter does not seem capable of supporting advertiserDomains #6650 added response comment and some trivial code. --- modules/jixieBidAdapter.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/jixieBidAdapter.js b/modules/jixieBidAdapter.js index 7c6e0027482..798e84036db 100644 --- a/modules/jixieBidAdapter.js +++ b/modules/jixieBidAdapter.js @@ -240,6 +240,16 @@ export const spec = { let rendererScript = (oneBid.osparams.script ? oneBid.osparams.script : JX_OUTSTREAM_RENDERER_URL); bnd.renderer = createRenderer_(oneBid, rendererScript, jxOutstreamRender_); } + //a note on advertiserDomains: our adserver is not responding in + //openRTB-type json. so there is no need to copy from 'adomain' over + //to meta: advertiserDomains + //However, we will just make sure the property is there. + if (!bnd.meta) { + bnd.meta = {}; + } + if (!bnd.meta.advertiserDomains) { + bnd.meta.advertiserDomains = []; + } bidResponses.push(bnd); }); if (response.body.setids) { @@ -252,3 +262,4 @@ export const spec = { } registerBidder(spec); + From 103b8ae889047d710a21f84e1cfc675a8879e9d7 Mon Sep 17 00:00:00 2001 From: Renee Woo Date: Tue, 1 Jun 2021 14:24:20 +0800 Subject: [PATCH 2/8] removed a blank line at the end of file added a space behind the // in comments --- modules/jixieBidAdapter.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/jixieBidAdapter.js b/modules/jixieBidAdapter.js index 798e84036db..db6c9032e65 100644 --- a/modules/jixieBidAdapter.js +++ b/modules/jixieBidAdapter.js @@ -240,10 +240,10 @@ export const spec = { let rendererScript = (oneBid.osparams.script ? oneBid.osparams.script : JX_OUTSTREAM_RENDERER_URL); bnd.renderer = createRenderer_(oneBid, rendererScript, jxOutstreamRender_); } - //a note on advertiserDomains: our adserver is not responding in - //openRTB-type json. so there is no need to copy from 'adomain' over - //to meta: advertiserDomains - //However, we will just make sure the property is there. + // a note on advertiserDomains: our adserver is not responding in + // openRTB-type json. so there is no need to copy from 'adomain' over + // to meta: advertiserDomains + // However, we will just make sure the property is there. if (!bnd.meta) { bnd.meta = {}; } @@ -262,4 +262,3 @@ export const spec = { } registerBidder(spec); - From 704e9747bd9765250c4756e198e7ebde34cc9a0d Mon Sep 17 00:00:00 2001 From: Renee Woo Date: Wed, 2 Jun 2021 12:34:53 +0800 Subject: [PATCH 3/8] in response to comment from reviewer. add the aspect of advertiserdomain in unit tests --- test/spec/modules/jixieBidAdapter_spec.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/spec/modules/jixieBidAdapter_spec.js b/test/spec/modules/jixieBidAdapter_spec.js index 842f9e0ed30..ae58da30f64 100644 --- a/test/spec/modules/jixieBidAdapter_spec.js +++ b/test/spec/modules/jixieBidAdapter_spec.js @@ -281,7 +281,8 @@ describe('jixie Adapter', function () { }, 'vastUrl': 'https://ad.jixie.io/v1/video?creativeid=522' }, - // display ad returned here: + // display ad returned here: This one there is advertiserDomains + // in the response . Will be checked in the unit tests below { 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?', 'jxBidId': '600c9ae6fda1acb-028d5dee-2c83-44e3-bed1-b75002475cdf', @@ -411,6 +412,9 @@ describe('jixie Adapter', function () { expect(result[0].ttl).to.equal(300) expect(result[0].vastUrl).to.include('https://ad.jixie.io/v1/video?creativeid=') expect(result[0].trackingUrlBase).to.include('sync') + // We will always make sure the meta->advertiserDomains property is there + // If no info it is an empty array. + expect(result[0].meta.advertiserDomains.length).to.equal(0) // display ad expect(result[1].requestId).to.equal('600c9ae6fda1acb') @@ -422,6 +426,7 @@ describe('jixie Adapter', function () { expect(result[1].netRevenue).to.equal(true) expect(result[1].ttl).to.equal(300) expect(result[1].ad).to.include('jxoutstream') + expect(result[1].meta.advertiserDomains.length).to.equal(3) expect(result[1].trackingUrlBase).to.include('sync') // should pick up about using alternative outstream renderer @@ -436,6 +441,7 @@ describe('jixie Adapter', function () { expect(result[2].vastXml).to.include('') expect(result[2].trackingUrlBase).to.include('sync'); expect(result[2].renderer.id).to.equal('demoslot4-div') + expect(result[2].meta.advertiserDomains.length).to.equal(0) expect(result[2].renderer.url).to.equal(JX_OTHER_OUTSTREAM_RENDERER_URL); // should know to use default outstream renderer @@ -450,6 +456,7 @@ describe('jixie Adapter', function () { expect(result[3].vastXml).to.include('') expect(result[3].trackingUrlBase).to.include('sync'); expect(result[3].renderer.id).to.equal('demoslot2-div') + expect(result[3].meta.advertiserDomains.length).to.equal(0) expect(result[3].renderer.url).to.equal(JX_OUTSTREAM_RENDERER_URL) setLocalStorageSpy.restore(); From 7886688cf56ffd23d05c1986f807c9da9a70c86d Mon Sep 17 00:00:00 2001 From: jxdeveloper1 Date: Mon, 18 Oct 2021 16:14:20 +0800 Subject: [PATCH 4/8] added the code to get the keywords from the meta tags if available. --- modules/jixieBidAdapter.js | 10 ++++++++-- test/spec/modules/jixieBidAdapter_spec.js | 24 ++++++++++++----------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/modules/jixieBidAdapter.js b/modules/jixieBidAdapter.js index 0e05616465a..119fcdf142b 100644 --- a/modules/jixieBidAdapter.js +++ b/modules/jixieBidAdapter.js @@ -10,7 +10,7 @@ export const storage = getStorageManager(); const BIDDER_CODE = 'jixie'; const EVENTS_URL = 'https://hbtra.jixie.io/sync/hb?'; -const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.io/jxhboutstream.js'; +const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.media/jxhbrenderer.1.1.min.js'; const REQUESTS_URL = 'https://hb.jixie.io/v2/hbpost'; const sidTTLMins_ = 30; @@ -104,7 +104,8 @@ function getMiscDims_() { let ret = { pageurl: '', domain: '', - device: 'unknown' + device: 'unknown', + mkeywords: '' } try { let refererInfo_ = getRefererInfo(); @@ -112,6 +113,10 @@ function getMiscDims_() { ret.pageurl = url_; ret.domain = parseUrl(url_).host; ret.device = getDevice_(); + let keywords = document.getElementsByTagName('meta')['keywords']; + if (keywords && keywords.content) { + ret.mkeywords = keywords.content; + } } catch (error) {} return ret; } @@ -167,6 +172,7 @@ export const spec = { device: miscDims.device, domain: miscDims.domain, pageurl: miscDims.pageurl, + mkeywords: miscDims.mkeywords, bids: bids, cfg: jixieCfgBlob }, ids); diff --git a/test/spec/modules/jixieBidAdapter_spec.js b/test/spec/modules/jixieBidAdapter_spec.js index ae58da30f64..68de5c7a8fd 100644 --- a/test/spec/modules/jixieBidAdapter_spec.js +++ b/test/spec/modules/jixieBidAdapter_spec.js @@ -9,6 +9,7 @@ describe('jixie Adapter', function () { const device_ = 'desktop'; const timeout_ = 1000; const currency_ = 'USD'; + const keywords_ = ''; /** * Basic @@ -212,7 +213,7 @@ describe('jixie Adapter', function () { ); let miscDimsStub = sinon.stub(jixieaux, 'getMiscDims'); miscDimsStub - .returns({ device: device_, pageurl: pageurl_, domain: domain_ }); + .returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ }); // actual api call: const request = spec.buildRequests(bidRequests_, bidderRequest_); @@ -229,6 +230,7 @@ describe('jixie Adapter', function () { expect(payload).to.have.property('device', device_); expect(payload).to.have.property('domain', domain_); expect(payload).to.have.property('pageurl', pageurl_); + expect(payload).to.have.property('mkeywords', keywords_); expect(payload).to.have.property('timeout', timeout_); expect(payload).to.have.property('currency', currency_); expect(payload).to.have.property('bids').that.deep.equals(refBids_); @@ -243,15 +245,15 @@ describe('jixie Adapter', function () { /** * interpretResponse: */ - const JX_OTHER_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.io/dummyscript.js'; - const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.io/jxhboutstream.js'; + const JX_OTHER_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.media/dummyscript.js'; + const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.media/jxhbrenderer.1.1.min.js'; - const mockVastXml_ = `JXADSERVERAlway%20Live%20Prebid%20CreativeHybrid in-stream00:00:10`; + const mockVastXml_ = `JXADSERVERAlway%20Live%20Prebid%20CreativeHybrid in-stream00:00:10`; const responseBody_ = { 'bids': [ // video (vast tag url) returned here { - 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?', + 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?', 'jxBidId': '62847e4c696edcb-028d5dee-2c83-44e3-bed1-b75002475cdf', 'requestId': '62847e4c696edcb', 'cpm': 2.19, @@ -284,7 +286,7 @@ describe('jixie Adapter', function () { // display ad returned here: This one there is advertiserDomains // in the response . Will be checked in the unit tests below { - 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?', + 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?', 'jxBidId': '600c9ae6fda1acb-028d5dee-2c83-44e3-bed1-b75002475cdf', 'requestId': '600c9ae6fda1acb', 'cpm': 1.999, @@ -317,11 +319,11 @@ describe('jixie Adapter', function () { ], 'mediaType': 'BANNER' }, - 'ad': '
' + 'ad': '
' }, // outstream, jx non-default renderer specified: { - 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?', + 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?', 'jxBidId': '99bc539c81b00ce-028d5dee-2c83-44e3-bed1-b75002475cdf', 'requestId': '99bc539c81b00ce', 'cpm': 2.99, @@ -340,7 +342,7 @@ describe('jixie Adapter', function () { }, // outstream, jx default renderer: { - 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?', + 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?', 'jxBidId': '61bc539c81b00ce-028d5dee-2c83-44e3-bed1-b75002475cdf', 'requestId': '61bc539c81b00ce', 'cpm': 1.99, @@ -475,7 +477,7 @@ describe('jixie Adapter', function () { ajaxStub = sinon.stub(jixieaux, 'ajax'); miscDimsStub - .returns({ device: device_, pageurl: pageurl_, domain: domain_ }); + .returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ }); }) afterEach(function() { @@ -537,7 +539,7 @@ describe('jixie Adapter', function () { ajaxStub = sinon.stub(jixieaux, 'ajax'); miscDimsStub = sinon.stub(jixieaux, 'getMiscDims'); miscDimsStub - .returns({ device: device_, pageurl: pageurl_, domain: domain_ }); + .returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ }); }) afterEach(function() { From e3072fdde13fe1ea26eef5f82ca291b30e3695a5 Mon Sep 17 00:00:00 2001 From: Renee Woo Date: Mon, 25 Apr 2022 17:58:11 +0800 Subject: [PATCH 5/8] adding jixie adaptor to send tid and uid2 and publisher ids --- modules/jixieBidAdapter.js | 28 +++++++++++++ test/spec/modules/jixieBidAdapter_spec.js | 51 +++++++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/modules/jixieBidAdapter.js b/modules/jixieBidAdapter.js index de509853fed..844fb2c5092 100644 --- a/modules/jixieBidAdapter.js +++ b/modules/jixieBidAdapter.js @@ -121,6 +121,18 @@ function getMiscDims_() { return ret; } +function addUserId(eids, id, source, rti) { + if (id) { + if (rti) { + eids.push({ source, id, rti_partner: rti }); + } else { + eids.push({ source, id }); + } + } + return eids; + } + + // easier for replacement in the unit test export const internal = { getDevice: getDevice_, @@ -163,7 +175,22 @@ export const spec = { } let ids = fetchIds_(); + let eids = []; let miscDims = internal.getMiscDims(); + + if (validBidRequests[0].userId) { + addUserId(eids, deepAccess(validBidRequests[0], `userId.tdid`), 'adserver.org', 'TDID'); + addUserId(eids, deepAccess(validBidRequests[0], `userId.uid2.id`), 'uidapi.com', 'UID2'); + if (validBidRequests[0].userId.pubProvidedId) { + validBidRequests[0].userId.pubProvidedId.forEach(ppId => { + ppId.uids.forEach(uid => { + eids.push({ source: ppId.source, id: uid.id }); + }); + }); + } + + } + let transformedParams = Object.assign({}, { auctionid: bidderRequest.auctionId, timeout: bidderRequest.timeout, @@ -174,6 +201,7 @@ export const spec = { pageurl: miscDims.pageurl, mkeywords: miscDims.mkeywords, bids: bids, + eids: eids, cfg: jixieCfgBlob }, ids); return Object.assign({}, { diff --git a/test/spec/modules/jixieBidAdapter_spec.js b/test/spec/modules/jixieBidAdapter_spec.js index 68de5c7a8fd..d9ff3023ca7 100644 --- a/test/spec/modules/jixieBidAdapter_spec.js +++ b/test/spec/modules/jixieBidAdapter_spec.js @@ -240,6 +240,54 @@ describe('jixie Adapter', function () { getLocalStorageStub.restore(); miscDimsStub.restore(); });// it + + it('should populate eids when supported userIds are available', function () { + const oneSpecialBidReq = Object.assign({}, bidRequests_[0], { + userId: { + tdid: '11111111-2222-3333-4444-555555555555', + uid2: { id: 'AbCdEfGhIjKlMnO9qdQBW7qtMw8f1WTUvtkHe6u+fqLfhbtsqrJ697Z6YoI3IB9klGUv1wvlFIbwH7ELDlqQBGtj8AC1v7fMJ/Q45E7W90dts7UQLTDMLNmtHBRDXVb0Fpas4Vh3yN1jGVQNhzXC/RpGIVtZE8dCxcjfa7VfcTNcvxxxxx==' }, + pubProvidedId: [{ + source: 'puburl1.com', + uids: [{ + id: 'pubid1', + atype: 1, + ext: { + stype: 'ppuid' + } + }] + }, { + source: 'puburl2.com', + uids: [{ + id: 'pubid2' + }] + }] + } + }); + const request = spec.buildRequests([oneSpecialBidReq], bidderRequest_); + const payload = JSON.parse(request.data); + expect(payload.eids).to.deep.include({ + source: 'adserver.org', + id: '11111111-2222-3333-4444-555555555555', + rti_partner: 'TDID' + }); + + expect(payload.eids).to.deep.include({ + source: 'uidapi.com', + id: 'AbCdEfGhIjKlMnO9qdQBW7qtMw8f1WTUvtkHe6u+fqLfhbtsqrJ697Z6YoI3IB9klGUv1wvlFIbwH7ELDlqQBGtj8AC1v7fMJ/Q45E7W90dts7UQLTDMLNmtHBRDXVb0Fpas4Vh3yN1jGVQNhzXC/RpGIVtZE8dCxcjfa7VfcTNcvxxxxx==', + rti_partner: 'UID2' + }); + + expect(payload.eids).to.deep.include({ + source: 'puburl1.com', + id: 'pubid1' + }); + + expect(payload.eids).to.deep.include({ + source: 'puburl2.com', + id: 'pubid2' + }); + + }); });// describe /** @@ -603,4 +651,7 @@ describe('jixie Adapter', function () { getConfigStub.restore(); }) });// describe + + }); + \ No newline at end of file From e3e705deb9d12e8ff4ee6b898e17dcf9b6e8b4eb Mon Sep 17 00:00:00 2001 From: Renee Woo Date: Tue, 26 Apr 2022 10:25:43 +0800 Subject: [PATCH 6/8] changed to send all the ids to our backend. added a little comment --- modules/jixieBidAdapter.js | 39 ++++---- modules/jixieBidAdapter.md | 1 + test/spec/modules/jixieBidAdapter_spec.js | 111 +++++++++++++--------- 3 files changed, 83 insertions(+), 68 deletions(-) diff --git a/modules/jixieBidAdapter.js b/modules/jixieBidAdapter.js index 844fb2c5092..474acaa8e2e 100644 --- a/modules/jixieBidAdapter.js +++ b/modules/jixieBidAdapter.js @@ -6,6 +6,7 @@ import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { ajax } from '../src/ajax.js'; import { getRefererInfo } from '../src/refererDetection.js'; import { Renderer } from '../src/Renderer.js'; +import {createEidsArray} from './userId/eids.js'; const BIDDER_CODE = 'jixie'; export const storage = getStorageManager({bidderCode: BIDDER_CODE}); @@ -121,17 +122,16 @@ function getMiscDims_() { return ret; } -function addUserId(eids, id, source, rti) { - if (id) { - if (rti) { - eids.push({ source, id, rti_partner: rti }); - } else { - eids.push({ source, id }); - } +/* function addUserId(eids, id, source, rti) { + if (id) { + if (rti) { + eids.push({ source, id, rti_partner: rti }); + } else { + eids.push({ source, id }); } - return eids; } - + return eids; +} */ // easier for replacement in the unit test export const internal = { @@ -177,20 +177,15 @@ export const spec = { let ids = fetchIds_(); let eids = []; let miscDims = internal.getMiscDims(); - + + // all available user ids are sent to our backend in the standard array layout: if (validBidRequests[0].userId) { - addUserId(eids, deepAccess(validBidRequests[0], `userId.tdid`), 'adserver.org', 'TDID'); - addUserId(eids, deepAccess(validBidRequests[0], `userId.uid2.id`), 'uidapi.com', 'UID2'); - if (validBidRequests[0].userId.pubProvidedId) { - validBidRequests[0].userId.pubProvidedId.forEach(ppId => { - ppId.uids.forEach(uid => { - eids.push({ source: ppId.source, id: uid.id }); - }); - }); - } - + let eids1 = createEidsArray(validBidRequests[0].userId); + if (eids1.length) { + eids = eids1; + } } - + let transformedParams = Object.assign({}, { auctionid: bidderRequest.auctionId, timeout: bidderRequest.timeout, @@ -201,7 +196,7 @@ export const spec = { pageurl: miscDims.pageurl, mkeywords: miscDims.mkeywords, bids: bids, - eids: eids, + eids: eids, cfg: jixieCfgBlob }, ids); return Object.assign({}, { diff --git a/modules/jixieBidAdapter.md b/modules/jixieBidAdapter.md index d9c1f19541d..c0a1a965e87 100644 --- a/modules/jixieBidAdapter.md +++ b/modules/jixieBidAdapter.md @@ -7,6 +7,7 @@ Maintainer: contact@jixie.io # Description Module that connects to Jixie demand source to fetch bids. +All prebid-supported user ids are sent to Jixie endpoint, if available. # Test Parameters ``` diff --git a/test/spec/modules/jixieBidAdapter_spec.js b/test/spec/modules/jixieBidAdapter_spec.js index d9ff3023ca7..dc56c22a4c2 100644 --- a/test/spec/modules/jixieBidAdapter_spec.js +++ b/test/spec/modules/jixieBidAdapter_spec.js @@ -242,52 +242,74 @@ describe('jixie Adapter', function () { });// it it('should populate eids when supported userIds are available', function () { - const oneSpecialBidReq = Object.assign({}, bidRequests_[0], { - userId: { - tdid: '11111111-2222-3333-4444-555555555555', - uid2: { id: 'AbCdEfGhIjKlMnO9qdQBW7qtMw8f1WTUvtkHe6u+fqLfhbtsqrJ697Z6YoI3IB9klGUv1wvlFIbwH7ELDlqQBGtj8AC1v7fMJ/Q45E7W90dts7UQLTDMLNmtHBRDXVb0Fpas4Vh3yN1jGVQNhzXC/RpGIVtZE8dCxcjfa7VfcTNcvxxxxx==' }, - pubProvidedId: [{ - source: 'puburl1.com', - uids: [{ - id: 'pubid1', - atype: 1, - ext: { - stype: 'ppuid' - } - }] - }, { - source: 'puburl2.com', - uids: [{ - id: 'pubid2' - }] - }] - } - }); - const request = spec.buildRequests([oneSpecialBidReq], bidderRequest_); - const payload = JSON.parse(request.data); - expect(payload.eids).to.deep.include({ - source: 'adserver.org', - id: '11111111-2222-3333-4444-555555555555', - rti_partner: 'TDID' - }); - - expect(payload.eids).to.deep.include({ - source: 'uidapi.com', - id: 'AbCdEfGhIjKlMnO9qdQBW7qtMw8f1WTUvtkHe6u+fqLfhbtsqrJ697Z6YoI3IB9klGUv1wvlFIbwH7ELDlqQBGtj8AC1v7fMJ/Q45E7W90dts7UQLTDMLNmtHBRDXVb0Fpas4Vh3yN1jGVQNhzXC/RpGIVtZE8dCxcjfa7VfcTNcvxxxxx==', - rti_partner: 'UID2' - }); - - expect(payload.eids).to.deep.include({ + const oneSpecialBidReq = Object.assign({}, bidRequests_[0], { + userId: { + tdid: '11111111-2222-3333-4444-555555555555', + uid2: { id: 'AbCdEfGhIjKlMnO9qdQBW7qtMw8f1WTUvtkHe6u+fqLfhbtsqrJ697Z6YoI3IB9klGUv1wvlFIbwH7ELDlqQBGtj8AC1v7fMJ/Q45E7W90dts7UQLTDMLNmtHBRDXVb0Fpas4Vh3yN1jGVQNhzXC/RpGIVtZE8dCxcjfa7VfcTNcvxxxxx==' }, + pubProvidedId: [{ source: 'puburl1.com', - id: 'pubid1' - }); - - expect(payload.eids).to.deep.include({ + uids: [{ + id: 'pubid1', + atype: 1, + ext: { + stype: 'ppuid' + } + }] + }, { source: 'puburl2.com', - id: 'pubid2' - }); - + uids: [{ + id: 'pubid2' + }] + }] + } + }); + const request = spec.buildRequests([oneSpecialBidReq], bidderRequest_); + const payload = JSON.parse(request.data); + expect(payload.eids).to.deep.include({ + "source": "adserver.org", + "uids": [ + { + "id": "11111111-2222-3333-4444-555555555555", + "atype": 1, + "ext": { + "rtiPartner": "TDID" + } + } + ] + }); + expect(payload.eids).to.deep.include({ + "source": "uidapi.com", + "uids": [ + { + "id": "AbCdEfGhIjKlMnO9qdQBW7qtMw8f1WTUvtkHe6u+fqLfhbtsqrJ697Z6YoI3IB9klGUv1wvlFIbwH7ELDlqQBGtj8AC1v7fMJ/Q45E7W90dts7UQLTDMLNmtHBRDXVb0Fpas4Vh3yN1jGVQNhzXC/RpGIVtZE8dCxcjfa7VfcTNcvxxxxx==", + "atype": 3 + } + ] }); + + expect(payload.eids).to.deep.include({ + "source": "puburl1.com", + "uids": [ + { + "id": "pubid1", + "atype": 1, + "ext": { + "stype": "ppuid" + } + } + ] + }); + + expect(payload.eids).to.deep.include({ + "source": "puburl2.com", + "uids": [ + { + "id": "pubid2" + } + ] + }); + + }); });// describe /** @@ -651,7 +673,4 @@ describe('jixie Adapter', function () { getConfigStub.restore(); }) });// describe - - }); - \ No newline at end of file From c72035ebfabb855f75d1625aa849d2323685301c Mon Sep 17 00:00:00 2001 From: Renee Woo Date: Wed, 27 Apr 2022 21:22:26 +0800 Subject: [PATCH 7/8] send the config info of price granularity to our backend --- modules/jixieBidAdapter.js | 6 +++ test/spec/modules/jixieBidAdapter_spec.js | 66 ++++++++++++++++------- 2 files changed, 52 insertions(+), 20 deletions(-) diff --git a/modules/jixieBidAdapter.js b/modules/jixieBidAdapter.js index 474acaa8e2e..700d3276e06 100644 --- a/modules/jixieBidAdapter.js +++ b/modules/jixieBidAdapter.js @@ -185,6 +185,11 @@ export const spec = { eids = eids1; } } + // we want to send this blob of info to our backend: + let pg = config.getConfig('priceGranularity'); + if (!pg) { + pg = {}; + } let transformedParams = Object.assign({}, { auctionid: bidderRequest.auctionId, @@ -197,6 +202,7 @@ export const spec = { mkeywords: miscDims.mkeywords, bids: bids, eids: eids, + pricegranularity: pg, cfg: jixieCfgBlob }, ids); return Object.assign({}, { diff --git a/test/spec/modules/jixieBidAdapter_spec.js b/test/spec/modules/jixieBidAdapter_spec.js index dc56c22a4c2..0d68e0855ca 100644 --- a/test/spec/modules/jixieBidAdapter_spec.js +++ b/test/spec/modules/jixieBidAdapter_spec.js @@ -241,6 +241,33 @@ describe('jixie Adapter', function () { miscDimsStub.restore(); });// it + it('it should popular the pricegranularity when info is available', function () { + let content = { + "ranges": [{ + "max": 12, + "increment": 0.5 + }, + { + "max": 5, + "increment": 0.1 + }], + precision: 1 + }; + let getConfigStub = sinon.stub(config, 'getConfig'); + getConfigStub.callsFake(function fakeFn(prop) { + if (prop == 'priceGranularity') { + return content; + } + return null; + }); + + const oneSpecialBidReq = Object.assign({}, bidRequests_[0]); + const request = spec.buildRequests([oneSpecialBidReq], bidderRequest_); + const payload = JSON.parse(request.data); + getConfigStub.restore(); + expect(payload.pricegranularity).to.deep.include(content); + }); + it('should populate eids when supported userIds are available', function () { const oneSpecialBidReq = Object.assign({}, bidRequests_[0], { userId: { @@ -266,49 +293,48 @@ describe('jixie Adapter', function () { const request = spec.buildRequests([oneSpecialBidReq], bidderRequest_); const payload = JSON.parse(request.data); expect(payload.eids).to.deep.include({ - "source": "adserver.org", - "uids": [ + 'source': 'adserver.org', + 'uids': [ { - "id": "11111111-2222-3333-4444-555555555555", - "atype": 1, - "ext": { - "rtiPartner": "TDID" + 'id': '11111111-2222-3333-4444-555555555555', + 'atype': 1, + 'ext': { + 'rtiPartner': 'TDID' } } ] }); expect(payload.eids).to.deep.include({ - "source": "uidapi.com", - "uids": [ + 'source': 'uidapi.com', + 'uids': [ { - "id": "AbCdEfGhIjKlMnO9qdQBW7qtMw8f1WTUvtkHe6u+fqLfhbtsqrJ697Z6YoI3IB9klGUv1wvlFIbwH7ELDlqQBGtj8AC1v7fMJ/Q45E7W90dts7UQLTDMLNmtHBRDXVb0Fpas4Vh3yN1jGVQNhzXC/RpGIVtZE8dCxcjfa7VfcTNcvxxxxx==", - "atype": 3 + 'id': 'AbCdEfGhIjKlMnO9qdQBW7qtMw8f1WTUvtkHe6u+fqLfhbtsqrJ697Z6YoI3IB9klGUv1wvlFIbwH7ELDlqQBGtj8AC1v7fMJ/Q45E7W90dts7UQLTDMLNmtHBRDXVb0Fpas4Vh3yN1jGVQNhzXC/RpGIVtZE8dCxcjfa7VfcTNcvxxxxx==', + 'atype': 3 } ] }); expect(payload.eids).to.deep.include({ - "source": "puburl1.com", - "uids": [ + 'source': 'puburl1.com', + 'uids': [ { - "id": "pubid1", - "atype": 1, - "ext": { - "stype": "ppuid" + 'id': 'pubid1', + 'atype': 1, + 'ext': { + 'stype': 'ppuid' } } ] }); expect(payload.eids).to.deep.include({ - "source": "puburl2.com", - "uids": [ + 'source': 'puburl2.com', + 'uids': [ { - "id": "pubid2" + 'id': 'pubid2' } ] }); - }); });// describe From 6a856cd5d35024ba83c92a6eab7729cbd8e7a99c Mon Sep 17 00:00:00 2001 From: Renee Woo Date: Wed, 27 Apr 2022 21:46:41 +0800 Subject: [PATCH 8/8] corrected code formatting violations that failed some checks --- test/spec/modules/jixieBidAdapter_spec.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/spec/modules/jixieBidAdapter_spec.js b/test/spec/modules/jixieBidAdapter_spec.js index 0d68e0855ca..7af0372c22c 100644 --- a/test/spec/modules/jixieBidAdapter_spec.js +++ b/test/spec/modules/jixieBidAdapter_spec.js @@ -243,13 +243,13 @@ describe('jixie Adapter', function () { it('it should popular the pricegranularity when info is available', function () { let content = { - "ranges": [{ - "max": 12, - "increment": 0.5 + 'ranges': [{ + 'max': 12, + 'increment': 0.5 }, { - "max": 5, - "increment": 0.1 + 'max': 5, + 'increment': 0.1 }], precision: 1 };