Skip to content

Prebid Integration

Integrates Yaleo placements into Prebid.js using the yaleo bidder adapter from the official Prebid.js repository (v10+).

See Yaleo Bid Adapter for bidder params and integration details.

js/apps/yaleo-bidder/server is an Express server that handles OpenRTB requests from Prebid.js. It fetches placement configuration and ads from Xandr, then serializes the result as pre-rendered HTML returned as a Prebid bid.

js/apps/yaleo-bidder/client is injected into the pre-rendered HTML and hydrates the placement once it is rendered in the publisher page. It handles dynamic behavior: dispatching analytics events, adjusting the host iframe size, and applying parent page media queries to the iframe.

When the placement grows taller than its slot and a cross-origin frame (a GAM SafeFrame) keeps the client from resizing the slot frame itself, the client asks the page’s Prebid.js to do it with Prebid’s resizeNativeHeight message (message: 'Prebid Native'). The slot keeps its width; fluid (1x1) bids take the full slot width.

This needs:

  • a GAM creative that declares ucTagData as a global, as the stock Prebid Universal Creative template does, because it carries the bid’s adId;
  • a Prebid.js build with the NATIVE feature. A build without it ignores the message, and the placement stays at the slot size.

Prebid finds the bid by its adId. A page that sets Prebid’s minBidCacheTTL drops bids once their TTL has passed, so a placement that grows after that keeps its last size.

Without a global ucTagData, as with htag’s Universal Creative template, the client grows the slot with a SafeFrame $sf.ext.expand overlay.

Dark theme can be forced when the server renders the placement HTML:

  1. Per ad unit — set forceDarkTheme: true in the yaleo bidder params.
  2. Request-wide — set device.ext.darkmode: 1 on the OpenRTB request (via Prebid ortb2). The server maps this to dark theme for every placement that does not set forceDarkTheme.

Per-ad-unit forceDarkTheme takes precedence over device.ext.darkmode.

When neither is set, the hydrated client may still enable dark theme via publisher-specific detectors, and via prefers-color-scheme on known dark-theme sites.

See Yaleo Bid Adapter → Dark Theme for configuration examples.

A Prebid.js adapter that runs all placement and ad fetching logic client-side, with rendering provided by https://cdn.adnz.co/yaleo/prebid.js (part of js/apps/yaleo).

See Yaleo Legacy Bid Adapter for params.

See Migration from Legacy Adapter for migration steps.

  • Multi-ad placements were not supported. Prebid.js does not allow sequential requests within a single auction. For multi-ad placements, the placement configuration (which includes the number of ads) must be fetched first, followed by a separate ad request — a flow the legacy adapter could not support.
  • Could not be published in the official Prebid.js repository. The adapter explicitly loaded an external JS script, which violates Prebid.js required adapter rules.
  • Required redundant parameters. Publishers had to specify the Xandr tag ID explicitly, even though it is already part of the Yaleo placement configuration.