Skip to content

Preserve request-scoped Prebid ad units across GPT refreshes #911

Description

@ChristianPavilonis

Description

The managed Prebid integration can lose publisher bidder parameters and banner zone metadata when handling GPT refreshes.

Publishers may pass ad units only through pbjs.requestBids({ adUnits }), leaving pbjs.adUnits empty. The integration currently folds those request-scoped bidder definitions into the trustedServer bid before dispatch. When a later GPT refresh reconstructs an ad unit from pbjs.adUnits, it can therefore send a new /auction request with empty bidderParams and no zone.

A related case occurs when a publisher calls googletag.pubads().refresh() synchronously from bidsBackHandler to deliver the auction result. Treating that delivery refresh as a new independent auction produces an immediate duplicate request with incomplete ad-unit data.

Expected behavior

  • Preserve immutable request-scoped publisher ad-unit metadata before folding bids into trustedServer.
  • Do not treat a synchronous GPT refresh used to deliver a completed publisher auction as a new auction.
  • Reconstruct later independent refresh auctions with the original bidder parameters, client bids, and banner zone.
  • Prevent synthetic refresh units from overwriting valid publisher snapshots.
  • Continue handling malformed or missing bids arrays without throwing.

Reproduction outline

  1. Keep pbjs.adUnits empty.
  2. Call pbjs.requestBids({ adUnits, bidsBackHandler }) with bidder params and a banner zone supplied only in the request-scoped ad unit.
  3. Call GPT refresh synchronously from bidsBackHandler.
  4. Observe an immediate second /auction request with empty bidder params and missing zone.
  5. Trigger a later independent GPT refresh and observe the same missing metadata.

Acceptance criteria

  • The publisher auction produces one server auction request, with no immediate delivery-refresh duplicate.
  • A later independent GPT refresh starts one auction and retains the original bidder params and zone.
  • Nested bidder-param objects are isolated from later mutation.
  • Regression tests cover malformed bids, synthetic-unit recursion, synchronous delivery refreshes, and deferred independent refreshes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions