Skip to content

Test mode added for Portal Prebid Test Site (publisher simulation)#7

Open
IlliaMil wants to merge 4 commits into
masterfrom
test-mode-added
Open

Test mode added for Portal Prebid Test Site (publisher simulation)#7
IlliaMil wants to merge 4 commits into
masterfrom
test-mode-added

Conversation

@IlliaMil

Copy link
Copy Markdown

No description provided.

@greptile-apps

greptile-apps Bot commented Jun 10, 2026

Copy link
Copy Markdown

Greptile Summary

This PR extends the Startio bid adapter with test-mode support for publisher simulation environments, plus two minor data-mapping improvements. No structural changes to the bidding flow are made.

  • Channel metadata: request.ext.prebid.channel is now populated with {name: 'pbjs', version: '$prebid.version$'} so the endpoint can identify the Prebid.js version making the call.
  • placementIdimp.tagid: When params.placementId is provided, it is mapped (as a string) to imp.tagid in the OpenRTB impression, which is the standard field for placement identification.
  • Test-mode flags: params.test sets request.test = 1 in the ORTB payload, and params.testAdsEnabled appends &testAdsEnabled=true to the endpoint URL so the SSP can return test creatives without affecting production billing.

Confidence Score: 5/5

The changes are additive and isolated to test-mode opt-in paths; production bid requests are unaffected unless a publisher explicitly sets the new params.

All three new features (channel metadata, tagid mapping, test flags) follow existing patterns in the adapter and only activate when the publisher sets the corresponding params. The getEndpointUrl helper correctly extends the already-querystring-bearing ENDPOINT_URL with &testAdsEnabled=true. A previously noted issue around request.test not being explicitly set to 0 in the default case is the only open gap, and it is confined to a test assertion rather than production behavior.

test/spec/modules/startioBidAdapter_spec.js — the expect(request.test).to.equal(0) assertion in the default case may behave differently depending on whether ortbConverter initializes the field.

Important Files Changed

Filename Overview
modules/startioBidAdapter.js Adds placementId→tagid mapping, prebid channel metadata, per-bid test mode flag (request.test), and a dynamic endpoint URL helper for testAdsEnabled; logic is straightforward with one already-noted gap around the unconditional test:0 assignment.
test/spec/modules/startioBidAdapter_spec.js Four new test cases cover channel metadata, tagid mapping, test-mode flag, and testAdsEnabled URL injection; test for request.test===0 in the default case may fail if ortbConverter does not initialize the field to 0.

Sequence Diagram

sequenceDiagram
    participant Page as Publisher Page
    participant Adapter as startioBidAdapter
    participant SSP as Start.io SSP

    Page->>Adapter: "buildRequests(bidRequests)<br/>params: {test, testAdsEnabled, placementId}"
    Adapter->>Adapter: "converter.toORTB()<br/>→ imp.tagid = placementId<br/>→ request.ext.prebid.channel = {pbjs, version}<br/>→ request.test = 1 (if params.test)"
    alt "params.testAdsEnabled = true"
        Adapter->>SSP: "POST /getbid?account=pbc&testAdsEnabled=true"
    else normal request
        Adapter->>SSP: "POST /getbid?account=pbc"
    end
    SSP-->>Adapter: BidResponse (test creatives or live)
    Adapter->>Page: interpretResponse → bids
Loading

Reviews (3): Last reviewed commit: "Enhance: Advertise Prebid channel name a..." | Re-trigger Greptile

Comment thread modules/startioBidAdapter.js
Comment on lines +50 to +52
if (bidParams?.test) {
request.test = 1;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is bidParams.test different from bidRequest.params.testAdsEnabled on purpose?
It sounds like they should be the same variable (otherwise they might not be synced, and it'll cause an unexpected behavior)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants