Skip to content

AdOcean Bid Adapter: support for optional, extra emitter parameters#14959

Open
mmuras-gemius wants to merge 2 commits into
prebid:masterfrom
gemius:master
Open

AdOcean Bid Adapter: support for optional, extra emitter parameters#14959
mmuras-gemius wants to merge 2 commits into
prebid:masterfrom
gemius:master

Conversation

@mmuras-gemius
Copy link
Copy Markdown
Contributor

@mmuras-gemius mmuras-gemius commented May 28, 2026

Type of change

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

Description of change

New parameter: "emitterRequestParams" which allows to provide additional data for targeting.

Documentation

prebid/prebid.github.io#6586

Copilot AI review requested due to automatic review settings May 28, 2026 08:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.emitterRequestParams as a plain object in isBidRequestValid.
  • Append URL-encoded emitterRequestParams to 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.

Comment on lines +11 to 23
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;
}
Comment on lines +42 to +47
const emitterRequestParams = [];
if (bid.params.emitterRequestParams) {
_each(bid.params.emitterRequestParams, function(v, k) {
emitterRequestParams.push(encodeURIComponent(k) + '=' + encodeURIComponent(v));
});
}
Copy link
Copy Markdown

@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: 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));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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