AdOcean Bid Adapter: support for optional, extra emitter parameters#14959
AdOcean Bid Adapter: support for optional, extra emitter parameters#14959mmuras-gemius wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for passing optional custom query parameters (emitterRequestParams) through the Adocean bidder adapter, including validation, URL construction, tests, and documentation updates.
Changes:
- Validate
params.emitterRequestParamsas a plain object inisBidRequestValid. - Append URL-encoded
emitterRequestParamsto the outgoing request URL. - Add unit tests and update adapter documentation with the new optional parameter.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/spec/modules/adoceanBidAdapter_spec.js | Adds tests for validation and URL appending/encoding of emitterRequestParams. |
| modules/adoceanBidAdapter.md | Documents the new optional emitterRequestParams configuration. |
| modules/adoceanBidAdapter.js | Implements validation and URL query-string injection for emitterRequestParams. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function buildEndpointUrl(emitter, payloadMap, emitterRequestParams) { | ||
| const payload = []; | ||
| _each(payloadMap, function(v, k) { | ||
| payload.push(k + '=' + (URL_SAFE_FIELDS[k] ? v : encodeURIComponent(v))); | ||
| }); | ||
|
|
||
| const randomizedPart = Math.random().toString().slice(2); | ||
| return 'https://' + emitter + '/_' + randomizedPart + '/ad.json?' + payload.join('&'); | ||
| let request = 'https://' + emitter + '/_' + randomizedPart + '/ad.json?' + payload.join('&'); | ||
| if (emitterRequestParams.length) { | ||
| request += '&' + emitterRequestParams.join('&'); | ||
| } | ||
| return request; | ||
| } |
| const emitterRequestParams = []; | ||
| if (bid.params.emitterRequestParams) { | ||
| _each(bid.params.emitterRequestParams, function(v, k) { | ||
| emitterRequestParams.push(encodeURIComponent(k) + '=' + encodeURIComponent(v)); | ||
| }); | ||
| } |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18eee8b321
ℹ️ 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".
| const emitterRequestParams = []; | ||
| if (bid.params.emitterRequestParams) { | ||
| _each(bid.params.emitterRequestParams, function(v, k) { | ||
| emitterRequestParams.push(encodeURIComponent(k) + '=' + encodeURIComponent(v)); |
There was a problem hiding this comment.
Reject emitterRequestParams that overwrite generated query fields
When a publisher config includes a key that the adapter already generates, such as id, slaves, gdpr, gdpr_consent, or aosize, this appends a second copy of that query parameter after the trusted value. For parsers that take the last value, the bidder can receive a different placement, consent flag, or size than Prebid computed; at minimum the request becomes ambiguous for those inputs. Since these are documented as extra parameters, please skip or reject keys that collide with the adapter payload before appending them.
Useful? React with 👍 / 👎.
Type of change
Description of change
New parameter: "emitterRequestParams" which allows to provide additional data for targeting.
Documentation
prebid/prebid.github.io#6586