From 3707c0755fa03fdb577e73592372e77fe6f7ed18 Mon Sep 17 00:00:00 2001 From: illiamilshtein Date: Wed, 10 Jun 2026 13:28:35 +0300 Subject: [PATCH 1/3] Enhance: Add support for test ads and dynamic endpoint configuration in StartIO Bid Adapter --- modules/startioBidAdapter.js | 16 +++++++++- test/spec/modules/startioBidAdapter_spec.js | 33 +++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/modules/startioBidAdapter.js b/modules/startioBidAdapter.js index 621c342b8c8..849e857a520 100644 --- a/modules/startioBidAdapter.js +++ b/modules/startioBidAdapter.js @@ -9,6 +9,7 @@ const BIDDER_CODE = 'startio'; const METHOD = 'POST'; const GVLID = 1216; const ENDPOINT_URL = `https://pbc-rtb.startappnetwork.com/1.3/2.5/getbid?account=pbc`; +const TEST_ENDPOINT_URL = `https://alx-rtb.startappnetwork.com/1.3/2.5/getbid?account=pbc&testAdsEnabled=true`; const IFRAME_URL = 'https://cs.startappnetwork.com/sync?p=m4b8b3y4'; const converter = ortbConverter({ @@ -26,6 +27,11 @@ const converter = ortbConverter({ imp.bidfloorcur = 'USD'; } + const placementId = bidRequest.params?.placementId; + if (placementId != null) { + imp.tagid = String(placementId); + } + return imp; }, request(buildRequest, imps, bidderRequest, context) { @@ -42,6 +48,10 @@ const converter = ortbConverter({ request.ext = request.ext || {}; request.ext.prebid = request.ext.prebid || {}; + if (bidParams?.test) { + request.test = 1; + } + const ortb = bidderRequest.ortb2; request.regs ??= {}; request.regs.coppa = ortb?.regs?.coppa; @@ -107,6 +117,10 @@ function isValidBidFloorCurrency(bid) { return !bid.ortb2Imp?.bidfloorcur || bid.ortb2Imp.bidfloorcur === 'USD'; } +function getEndpointUrl(bidRequest) { + return bidRequest.params?.testAdsEnabled ? TEST_ENDPOINT_URL : ENDPOINT_URL; +} + export const spec = { code: BIDDER_CODE, supportedMediaTypes: [VIDEO, BANNER, NATIVE], @@ -124,7 +138,7 @@ export const spec = { return { method: METHOD, - url: ENDPOINT_URL, + url: getEndpointUrl(bidRequest), options: { contentType: 'text/plain', withCredentials: true, diff --git a/test/spec/modules/startioBidAdapter_spec.js b/test/spec/modules/startioBidAdapter_spec.js index 59de4368485..29a02028bbd 100644 --- a/test/spec/modules/startioBidAdapter_spec.js +++ b/test/spec/modules/startioBidAdapter_spec.js @@ -322,6 +322,39 @@ describe('Prebid Adapter: Startio', function () { expect(request.imp[0].banner.battr).to.deep.equal([3, 4]); }); + it('should map params.placementId to imp.tagid', function () { + let bidRequest = deepClone(DEFAULT_REQUEST_DATA); + bidRequest.params.placementId = 'placement-abc'; + + const request = spec.buildRequests([bidRequest], DEFAULT_BIDDER_REQUEST)[0].data; + + expect(request.imp[0].tagid).to.equal('placement-abc'); + }); + + it('should set request.test only when params.test is truthy', function () { + let bidRequest = deepClone(DEFAULT_REQUEST_DATA); + + let request = spec.buildRequests([bidRequest], DEFAULT_BIDDER_REQUEST)[0].data; + expect(request.test).to.equal(0); + + bidRequest.params.test = true; + request = spec.buildRequests([bidRequest], DEFAULT_BIDDER_REQUEST)[0].data; + expect(request.test).to.equal(1); + }); + + it('should hit production by default and the test endpoint when params.testAdsEnabled is set', function () { + let bidRequest = deepClone(DEFAULT_REQUEST_DATA); + + let request = spec.buildRequests([bidRequest], DEFAULT_BIDDER_REQUEST)[0]; + expect(request.url).to.include('pbc-rtb.startappnetwork.com'); + expect(request.url).to.not.include('testAdsEnabled'); + + bidRequest.params.testAdsEnabled = true; + request = spec.buildRequests([bidRequest], DEFAULT_BIDDER_REQUEST)[0]; + expect(request.url).to.include('alx-rtb.startappnetwork.com'); + expect(request.url).to.include('testAdsEnabled=true'); + }); + if (FEATURES.VIDEO) { it('should build request for video media type', function () { const bidRequest = VALID_MEDIA_TYPES_REQUESTS[VIDEO][0]; From afbe46435ffa04fcb276ade5ed577f61f28badb2 Mon Sep 17 00:00:00 2001 From: illiamilshtein Date: Thu, 11 Jun 2026 12:33:36 +0300 Subject: [PATCH 2/3] Refactor: Simplify testAdsEnabled logic by appending query param to the production endpoint --- modules/startioBidAdapter.js | 3 +-- test/spec/modules/startioBidAdapter_spec.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/startioBidAdapter.js b/modules/startioBidAdapter.js index 849e857a520..f9150c3ead3 100644 --- a/modules/startioBidAdapter.js +++ b/modules/startioBidAdapter.js @@ -9,7 +9,6 @@ const BIDDER_CODE = 'startio'; const METHOD = 'POST'; const GVLID = 1216; const ENDPOINT_URL = `https://pbc-rtb.startappnetwork.com/1.3/2.5/getbid?account=pbc`; -const TEST_ENDPOINT_URL = `https://alx-rtb.startappnetwork.com/1.3/2.5/getbid?account=pbc&testAdsEnabled=true`; const IFRAME_URL = 'https://cs.startappnetwork.com/sync?p=m4b8b3y4'; const converter = ortbConverter({ @@ -118,7 +117,7 @@ function isValidBidFloorCurrency(bid) { } function getEndpointUrl(bidRequest) { - return bidRequest.params?.testAdsEnabled ? TEST_ENDPOINT_URL : ENDPOINT_URL; + return bidRequest.params?.testAdsEnabled ? `${ENDPOINT_URL}&testAdsEnabled=true` : ENDPOINT_URL; } export const spec = { diff --git a/test/spec/modules/startioBidAdapter_spec.js b/test/spec/modules/startioBidAdapter_spec.js index 29a02028bbd..5bcf2d067b2 100644 --- a/test/spec/modules/startioBidAdapter_spec.js +++ b/test/spec/modules/startioBidAdapter_spec.js @@ -342,7 +342,7 @@ describe('Prebid Adapter: Startio', function () { expect(request.test).to.equal(1); }); - it('should hit production by default and the test endpoint when params.testAdsEnabled is set', function () { + it('should append testAdsEnabled=true to the endpoint only when params.testAdsEnabled is set', function () { let bidRequest = deepClone(DEFAULT_REQUEST_DATA); let request = spec.buildRequests([bidRequest], DEFAULT_BIDDER_REQUEST)[0]; @@ -351,7 +351,7 @@ describe('Prebid Adapter: Startio', function () { bidRequest.params.testAdsEnabled = true; request = spec.buildRequests([bidRequest], DEFAULT_BIDDER_REQUEST)[0]; - expect(request.url).to.include('alx-rtb.startappnetwork.com'); + expect(request.url).to.include('pbc-rtb.startappnetwork.com'); expect(request.url).to.include('testAdsEnabled=true'); }); From fca390d52eb6670e9132256a339db3d789e92976 Mon Sep 17 00:00:00 2001 From: illiamilshtein Date: Mon, 15 Jun 2026 11:09:35 +0300 Subject: [PATCH 3/3] Enhance: Advertise Prebid channel name and version in StartIO Bid Adapter requests --- modules/startioBidAdapter.js | 1 + test/spec/modules/startioBidAdapter_spec.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/modules/startioBidAdapter.js b/modules/startioBidAdapter.js index f9150c3ead3..92493efffd2 100644 --- a/modules/startioBidAdapter.js +++ b/modules/startioBidAdapter.js @@ -46,6 +46,7 @@ const converter = ortbConverter({ } request.ext = request.ext || {}; request.ext.prebid = request.ext.prebid || {}; + request.ext.prebid.channel = { name: 'pbjs', version: '$prebid.version$' }; if (bidParams?.test) { request.test = 1; diff --git a/test/spec/modules/startioBidAdapter_spec.js b/test/spec/modules/startioBidAdapter_spec.js index 5bcf2d067b2..5aa917132ac 100644 --- a/test/spec/modules/startioBidAdapter_spec.js +++ b/test/spec/modules/startioBidAdapter_spec.js @@ -322,6 +322,14 @@ describe('Prebid Adapter: Startio', function () { expect(request.imp[0].banner.battr).to.deep.equal([3, 4]); }); + it('should advertise the prebid channel (name + version) so the endpoint can identify the version', function () { + const request = spec.buildRequests([DEFAULT_REQUEST_DATA], DEFAULT_BIDDER_REQUEST)[0].data; + + expect(request.ext.prebid.channel).to.be.an('object'); + expect(request.ext.prebid.channel.name).to.equal('pbjs'); + expect(request.ext.prebid.channel.version).to.be.a('string').that.is.not.empty; + }); + it('should map params.placementId to imp.tagid', function () { let bidRequest = deepClone(DEFAULT_REQUEST_DATA); bidRequest.params.placementId = 'placement-abc';