Skip to content

Comments

Mile Bid Adapter: Initial release#14388

Merged
jsnellbaker merged 1 commit intoprebid:masterfrom
automatad:master
Feb 11, 2026
Merged

Mile Bid Adapter: Initial release#14388
jsnellbaker merged 1 commit intoprebid:masterfrom
automatad:master

Conversation

@shashankatd
Copy link
Contributor

@shashankatd shashankatd commented Jan 28, 2026

Type of change

  • Bugfix

  • Feature

  • New bidder adapter

  • Updated bidder adapter

  • Code style update (formatting, local variables)

  • Refactoring (no functional changes, no api changes)

  • Build related changes

  • CI related changes

  • Does this change affect user-facing APIs or examples documented on http://prebid.org?

  • Other

Description of change

This PR introduces a new Mile bid adapter for Prebid.js, enabling publishers to access Mile demand sources.

  • Module Name: Mile Bid Adapter
  • Module Type: Bidder Adapter
  • Maintainer: tech@mile.tech

Other information

Prebid Dev Docs PR

@github-actions
Copy link

Tread carefully! This PR adds 98 linter errors (possibly disabled through directives):

  • modules/mileBidAdapter.ts (+92 errors)
  • test/spec/modules/mileBidAdapter_spec.js (+6 errors)

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4544783d98

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 43 to 44
const sizes = deepAccess(bid, 'mediaTypes.banner.sizes');
sizes.forEach((size: string | number[]) => {

Choose a reason for hiding this comment

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

P1 Badge Guard banner sizes before iterating floors

When an ad unit uses the legacy sizes field instead of mediaTypes.banner.sizes (still supported in Prebid), deepAccess returns undefined and sizes.forEach(...) throws, aborting buildRequests and preventing any bids from being sent. This should defensively fall back to bid.sizes or an empty array before iterating so auctions with older configs don’t crash.

Useful? React with 👍 / 👎.

Comment on lines +83 to +87
if (siteIdTracker === undefined) {
siteIdTracker = params.siteId;
} else if (siteIdTracker !== params.siteId) {
logError(`${BIDDER_CODE}: Site ID mismatch: ${siteIdTracker} !== ${params.siteId}`);
return false;

Choose a reason for hiding this comment

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

P2 Badge Avoid persisting site/publisher IDs across auctions

The module-scoped siteIdTracker/publisherIdTracker are set on the first valid bid and then used to reject later bids with different IDs; because these variables are never reset per auction, any SPA navigation or reconfiguration that changes siteId/publisherId will cause all subsequent Mile bids to be rejected. This silently drops demand in multi-tenant or multi-site setups and should be scoped to a single bidderRequest instead of global state.

Useful? React with 👍 / 👎.

Comment on lines 374 to 377
ajax(MILE_ANALYTICS_ENDPOINT, null, JSON.stringify([winNotificationData]), { method: 'POST'});

// @ts-expect-error - bid.nurl is not defined
ajax(bid.nurl, null, null, { method: 'GET' });

Choose a reason for hiding this comment

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

P2 Badge Guard nurl call in onBidWon

bid.nurl is optional and only added when the server response includes it, but onBidWon calls ajax(bid.nurl, ...) unconditionally. If a winning bid lacks nurl, this passes undefined into ajax and will throw during request construction, breaking the win notification path. Check for bid.nurl before making the GET request.

Useful? React with 👍 / 👎.

@github-actions
Copy link

Tread carefully! This PR adds 3 linter errors (possibly disabled through directives):

  • modules/mileBidAdapter.ts (+3 errors)

1 similar comment
@github-actions
Copy link

Tread carefully! This PR adds 3 linter errors (possibly disabled through directives):

  • modules/mileBidAdapter.ts (+3 errors)

@coveralls
Copy link
Collaborator

coveralls commented Jan 28, 2026

Pull Request Test Coverage Report for Build 21853777053

Details

  • 403 of 411 (98.05%) changed or added relevant lines in 2 files are covered.
  • 238 unchanged lines in 24 files lost coverage.
  • Overall coverage decreased (-0.01%) to 96.22%

Changes Missing Coverage Covered Lines Changed/Added Lines %
modules/mileBidAdapter.ts 118 126 93.65%
Files with Coverage Reduction New Missed Lines %
modules/pubmaticBidAdapter.js 1 87.58%
modules/topLevelPaapi.js 1 98.97%
libraries/medianetUtils/logger.js 2 83.78%
libraries/percentInView/percentInView.js 2 93.75%
modules/beopBidAdapter.js 2 94.44%
modules/koblerBidAdapter.js 2 97.92%
test/spec/activities/objectGuard_spec.js 2 98.78%
test/spec/modules/id5IdSystem_spec.js 2 99.58%
src/secureCreatives.js 3 91.01%
test/spec/unit/secureCreatives_spec.js 3 99.0%
Totals Coverage Status
Change from base Build 21826065111: -0.01%
Covered Lines: 209265
Relevant Lines: 217485

💛 - Coveralls

@shashankatd shashankatd force-pushed the master branch 4 times, most recently from 6096069 to a8f1479 Compare January 30, 2026 07:57
@github-actions
Copy link

Tread carefully! This PR adds 1 linter error (possibly disabled through directives):

  • test/spec/modules/mileBidAdapter_spec.js (+1 error)

1 similar comment
@github-actions
Copy link

Tread carefully! This PR adds 1 linter error (possibly disabled through directives):

  • test/spec/modules/mileBidAdapter_spec.js (+1 error)

@shashankatd shashankatd marked this pull request as draft January 30, 2026 08:28
@shashankatd shashankatd marked this pull request as ready for review February 2, 2026 06:46
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ccc6d330a2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +119 to +123
const sizes = deepAccess(bid, 'mediaTypes.banner.sizes') || [];
const floorPrice = getLowestFloorPrice(bid);

const imp: any = {
id: bid.bidId,

Choose a reason for hiding this comment

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

P1 Badge Populate banner format from legacy sizes

When an ad unit uses the legacy bid.sizes field (still supported in Prebid), deepAccess(bid, 'mediaTypes.banner.sizes') is undefined, so sizes becomes [] and the imp.banner.format array is empty. That yields an OpenRTB impression without any size information, which can cause Mile to reject the request or return no bids for legacy configs. Consider falling back to bid.sizes (or parseSizesInput) when mediaTypes.banner.sizes is absent.

Useful? React with 👍 / 👎.

Comment on lines +261 to +263
// OpenRTB 2.5 response format: seatbid[] contains bid[]
const seatbids = response.bids || [];

Choose a reason for hiding this comment

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

P1 Badge Parse standard OpenRTB seatbid responses

The response parser is labeled as “OpenRTB 2.5”, but it reads bids from response.bids and iterates that directly. Standard OpenRTB uses seatbid[].bid[]; if the Mile endpoint returns a compliant OpenRTB response, this code will ignore all bids and yield an empty bidResponses array. To avoid silently dropping bids, parse response.seatbid (and the nested bid arrays) before building bid responses.

Useful? React with 👍 / 👎.

Copy link
Collaborator

@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

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

@shashankatd do you have any test params for your bidder that would return a test bid, so I can verify the adapter's e2e workflow?

@shashankatd
Copy link
Contributor Author

@jsnellbaker I've updated the test parameters in mileBidAdapter.md. I've also added it below.

{
        bidder: 'mile',
        params: {
            placementId: 'test-placement-id',
            siteId: 'test-site-id',
            publisherId: 'test-publisher-id'
        }
}

@jsnellbaker
Copy link
Collaborator

Hi @shashankatd When I tried to use the test params on the hello_world test page, I saw the endpoint was returning a 404 error.

Can you please take a look?

Below is a copy of the URL and it's payload.
Url:
https://pbs.atmtd.com/mile/v1/request

Payload:

{"id":"f1a5a2b7-049c-4f1e-a0b4-9d8def008354","imp":[{"id":"c00cbe83-ff50-49cf-a003-aa50a1e70a6f","tagid":"test-placement-id","secure":1,"banner":{"format":[{"w":300,"h":250}]},"ext":{"adUnitCode":"div-gpt-ad-1460505748561-0","placementId":"test-placement-id","gpid":"/19968336/header-bid-tag-0"}}],"tmax":1000,"cur":["USD"],"site":{"id":"test-site-id","page":"http://test.localhost:9999/integrationExamples/gpt/hello_world.html?pbjs_debug=true","domain":"test.localhost:9999","ref":"","publisher":{"id":"test-publisher-id","domain":"test.localhost:9999"}},"user":{},"device":{"ua":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36","language":"en","dnt":0,"w":2560,"h":1440,"ext":{"vpw":2560,"vph":711},"sua":{"source":1,"platform":{"brand":"macOS"},"browsers":[{"brand":"Not(A:Brand","version":["8"]},{"brand":"Chromium","version":["144"]},{"brand":"Google Chrome","version":["144"]}],"mobile":0}},"source":{},"ext":{"prebid":{"channel":{"name":"pbjs","version":"10.25.0-pre"}}}}

@krunchakravarthy
Copy link

krunchakravarthy commented Feb 9, 2026

instead of test-site-id and test-placement-id , set test-site and test-placement in request-body.

{"id":"f1a5a2b7-049c-4f1e-a0b4-9d8def008354","imp":[{"id":"c00cbe83-ff50-49cf-a003-aa50a1e70a6f","tagid":"test-placement","secure":1,"banner":{"format":[{"w":300,"h":250}]},"ext":{"adUnitCode":"div-gpt-ad-1460505748561-0","placementId":"test-placement","gpid":"/19968336/header-bid-tag-0"}}],"tmax":1000,"cur":["USD"],"site":{"id":"test-site","page":"http://test.localhost:9999/integrationExamples/gpt/hello_world.html?pbjs_debug=true","domain":"test.localhost:9999","ref":"","publisher":{"id":"test-publisher","domain":"test.localhost:9999"}},"user":{},"device":{"ua":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36","language":"en","dnt":0,"w":2560,"h":1440,"ext":{"vpw":2560,"vph":711},"sua":{"source":1,"platform":{"brand":"macOS"},"browsers":[{"brand":"Not(A:Brand","version":["8"]},{"brand":"Chromium","version":["144"]},{"brand":"Google Chrome","version":["144"]}],"mobile":0}},"source":{},"ext":{"prebid":{"channel":{"name":"pbjs","version":"10.25.0-pre"}}}}

@shashankatd
Copy link
Contributor Author

@jsnellbaker I have updated the test parameters in the mileBidderAdapter markdown file.

Copy link
Collaborator

@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

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

Thanks for the clarification, the other params did return a bid response.

@jsnellbaker jsnellbaker merged commit 4273a96 into prebid:master Feb 11, 2026
102 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants