OCM Bid Adapter: add bidder adapter, docs and tests#15324
Conversation
Add the OCM (Orange Click Media) bid adapter for Prebid.js submission, ported from the OCM prebid fork. The adapter supports Banner, Video (instream + outstream) and Native media types via the ORTB converter, resolves demand from an OCM Prebid Server stored request, attaches an outstream video renderer (OCM Video Player) loaded through Prebid's Renderer, registers PBS win/impression event trackers, and performs iframe-based user syncing through a POST-capable cookie_sync loader. Includes: - modules/ocmBidAdapter.js the adapter (spec + registerBidder) - modules/ocmBidAdapter.md module docs, params and test parameters - test/spec/modules/ocmBidAdapter_spec.js unit tests (47 tests) Prepared for upstream submission: dropped a dead variable initializer that tripped the stricter no-useless-assignment lint rule. gulp lint is clean and gulp test passes in both the default and all-features-disabled build variants. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsKJSstjJ7NytyjHHM5MTn
shouldAttachRenderer treated any mediaTypes.video.renderer object as a publisher-supplied renderer and skipped the OCM outstream renderer when it was not flagged backupOnly. That is wrong for the adapter's own documented override shape (mediaTypes.video.renderer.options), an options-only holder with no url/render: Prebid core's isRendererPreferredFromAdUnit only prefers an ad-unit/mediaType renderer that defines BOTH url and render, so such a bid was left with no renderer at all and could not display. Only defer to a real publisher renderer (url + render, not backupOnly); an options-only holder now correctly keeps the OCM renderer with the publisher's options merged into the player config. Add regression tests for the options-only override and the backupOnly cases (49 tests, passing in both the default and all-features-disabled builds; gulp lint clean). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsKJSstjJ7NytyjHHM5MTn
Populate the banner Test Parameters example with a working OCM publisher/placement so reviewers can exercise a real test bid through the OCM Prebid Server endpoint during submission review. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsKJSstjJ7NytyjHHM5MTn
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ffcbafc578
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Whoa there partner! This project is migrating to typescript. Consider changing the new JS files to TS, with well-defined types for what interacts with the prebid public API (for example: bid params and configuration). Thanks!
|
|
This PR introduces changes that may not work on all browsers. According to Babel, the following polyfills may be needed, and they are not automatically included:
The best way to address this is to provide good test coverage, as normal PR checks run unit tests on older browsers. |
…param types) Follow-up to the automated (codex) and reviewer feedback on the OCM adapter PR: - getUserSyncs now forwards the authorised sync policy to the cookie_sync loader: a `filter` of the allowed sync types (iframe always; image only when pixelEnabled) plus `coopSync=0`. Previously the loader received only bidders + limit, so PBS-returned image/redirect syncs (when only iframe was enabled) or cooperatively-synced bidders the publisher never authorised could still fire from inside the hidden loader iframe. - The cookie_sync `account` is now derived solely from the auction's echoed ext.account rather than a shared module-level scalar captured in buildRequests. The scalar was overwritten by any overlapping OCM auction (or second pbjs instance), leaking one publisher's account into another auction's sync. Removed the mutable syncAccount entirely. - Added modules/ocmBidAdapter.d.ts declaring OcmBidParams and augmenting the global BidderParams map for `ocm`, referenced from the adapter via a JSDoc import typedef (matching the yandex/vidazoo .d.ts convention), so the adapter's public bid params are typed for the TS migration. - Updated the spec and ocmBidAdapter.md to match. gulp lint: clean. gulp test --file test/spec/modules/ocmBidAdapter_spec.js: 51 tests passing. tsc --noEmit: clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M5ucxTBsRwQoH8DnEvLBxJ
|
Whoa there partner! This project is migrating to typescript. Consider changing the new JS files to TS, with well-defined types for what interacts with the prebid public API (for example: bid params and configuration). Thanks!
|
|
This PR introduces changes that may not work on all browsers. According to Babel, the following polyfills may be needed, and they are not automatically included:
The best way to address this is to provide good test coverage, as normal PR checks run unit tests on older browsers. |
|
Whoa there partner! This project is migrating to typescript. Consider changing the new JS files to TS, with well-defined types for what interacts with the prebid public API (for example: bid params and configuration). Thanks!
|
|
This PR introduces changes that may not work on all browsers. According to Babel, the following polyfills may be needed, and they are not automatically included:
The best way to address this is to provide good test coverage, as normal PR checks run unit tests on older browsers. |
Add the OCM (Orange Click Media) bid adapter for Prebid.js submission, ported from the OCM prebid fork. The adapter supports Banner, Video (outstream) and Native media types via the ORTB converter, resolves demand from an OCM Prebid Server stored request, attaches an outstream video renderer (OCM Video Player) loaded through Prebid's Renderer, registers PBS win/impression event trackers, and performs iframe-based user syncing through a POST-capable cookie_sync loader.
Includes:
Prepared for upstream submission: dropped a dead variable initializer that tripped the stricter no-useless-assignment lint rule. gulp lint is clean and gulp test passes in both the default and all-features-disabled build variants.
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 is an update of the old aliased OCM bid adapter (prev. aliased against adtelligent).
We're moving to an in-house bid adapter and prebid server.
Peter Lazaridis peter@orangeclickmedia.com
Other information
The bid adapter has already been tested and running on several sites of our network.