Skip to content

OCM Bid Adapter: add bidder adapter, docs and tests#15324

Open
ocm-peter wants to merge 5 commits into
prebid:masterfrom
OCM-Digital-Media:claude/ocm-bid-adapter-ujnxgo
Open

OCM Bid Adapter: add bidder adapter, docs and tests#15324
ocm-peter wants to merge 5 commits into
prebid:masterfrom
OCM-Digital-Media:claude/ocm-bid-adapter-ujnxgo

Conversation

@ocm-peter

Copy link
Copy Markdown

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:

  • 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.

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

  • Test parameters for validating bids:
{
  bidder: 'ocm',
  params: {
    'publisherId': 'orangeclickmedia.com',
    'placementId': '65b49bb0cc723602'
  }
}

Other information

The bid adapter has already been tested and running on several sites of our network.

claude added 3 commits July 7, 2026 13:46
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

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

Copy link
Copy Markdown

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: 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".

Comment thread modules/ocmBidAdapter.js Outdated
Comment thread modules/ocmBidAdapter.js Outdated
Comment thread modules/ocmBidAdapter.md Outdated
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

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!

  • modules/ocmBidAdapter.js

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

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:

  • Changes to modules/ocmBidAdapter.js may need:
    • es.array.push
    • es.iterator.constructor
    • es.iterator.every
    • es.iterator.find
    • es.iterator.for-each
    • es.iterator.map
    • es.iterator.some
    • es.set.difference.v2
    • es.set.intersection.v2
    • es.set.is-disjoint-from.v2
    • es.set.is-subset-of.v2
    • es.set.is-superset-of.v2
    • es.set.symmetric-difference.v2
    • es.set.union.v2
    • esnext.iterator.constructor
    • esnext.iterator.every
    • esnext.iterator.find
    • esnext.iterator.for-each
    • esnext.iterator.map
    • esnext.iterator.some
    • esnext.set.difference.v2
    • esnext.set.intersection.v2
    • esnext.set.is-disjoint-from.v2
    • esnext.set.is-subset-of.v2
    • esnext.set.is-superset-of.v2
    • esnext.set.symmetric-difference.v2
    • esnext.set.union.v2
  • Changes to test/spec/modules/ocmBidAdapter_spec.js may need:
    • es.array.with
    • es.iterator.constructor
    • es.iterator.filter
    • es.iterator.map
    • es.json.stringify
    • esnext.array.with
    • esnext.iterator.constructor
    • esnext.iterator.filter
    • esnext.iterator.map
    • esnext.json.parse

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
@barecheck

barecheck Bot commented Jul 8, 2026

Copy link
Copy Markdown

Barecheck - Code coverage report

Total: 96.57%

Your code coverage diff: 0.01% ▴

Uncovered files and lines
FileLines
modules/ocmBidAdapter.js126, 132, 137, 142, 202-204, 206, 264, 506, 542-543, 553, 556

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

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!

  • modules/ocmBidAdapter.js

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

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:

  • Changes to modules/ocmBidAdapter.js may need:
    • es.array.push
    • es.iterator.constructor
    • es.iterator.every
    • es.iterator.find
    • es.iterator.for-each
    • es.iterator.map
    • es.iterator.some
    • es.set.difference.v2
    • es.set.intersection.v2
    • es.set.is-disjoint-from.v2
    • es.set.is-subset-of.v2
    • es.set.is-superset-of.v2
    • es.set.symmetric-difference.v2
    • es.set.union.v2
    • esnext.iterator.constructor
    • esnext.iterator.every
    • esnext.iterator.find
    • esnext.iterator.for-each
    • esnext.iterator.map
    • esnext.iterator.some
    • esnext.set.difference.v2
    • esnext.set.intersection.v2
    • esnext.set.is-disjoint-from.v2
    • esnext.set.is-subset-of.v2
    • esnext.set.is-superset-of.v2
    • esnext.set.symmetric-difference.v2
    • esnext.set.union.v2
  • Changes to test/spec/modules/ocmBidAdapter_spec.js may need:
    • es.array.with
    • es.iterator.constructor
    • es.iterator.filter
    • es.iterator.map
    • es.json.stringify
    • esnext.array.with
    • esnext.iterator.constructor
    • esnext.iterator.filter
    • esnext.iterator.map
    • esnext.json.parse

The best way to address this is to provide good test coverage, as normal PR checks run unit tests on older browsers.

@github-actions

Copy link
Copy Markdown

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!

  • modules/ocmBidAdapter.js

@github-actions

Copy link
Copy Markdown

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:

  • Changes to modules/ocmBidAdapter.js may need:
    • es.array.push
    • es.iterator.constructor
    • es.iterator.every
    • es.iterator.find
    • es.iterator.for-each
    • es.iterator.map
    • es.iterator.some
    • es.set.difference.v2
    • es.set.intersection.v2
    • es.set.is-disjoint-from.v2
    • es.set.is-subset-of.v2
    • es.set.is-superset-of.v2
    • es.set.symmetric-difference.v2
    • es.set.union.v2
    • esnext.iterator.constructor
    • esnext.iterator.every
    • esnext.iterator.find
    • esnext.iterator.for-each
    • esnext.iterator.map
    • esnext.iterator.some
    • esnext.set.difference.v2
    • esnext.set.intersection.v2
    • esnext.set.is-disjoint-from.v2
    • esnext.set.is-subset-of.v2
    • esnext.set.is-superset-of.v2
    • esnext.set.symmetric-difference.v2
    • esnext.set.union.v2
  • Changes to test/spec/modules/ocmBidAdapter_spec.js may need:
    • es.array.with
    • es.iterator.constructor
    • es.iterator.filter
    • es.iterator.map
    • es.json.stringify
    • esnext.array.with
    • esnext.iterator.constructor
    • esnext.iterator.filter
    • esnext.iterator.map
    • esnext.json.parse

The best way to address this is to provide good test coverage, as normal PR checks run unit tests on older browsers.

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.

3 participants