Repository navigation
Define scroll and refresh auction strategy for server-side ad templates #702
Description
Context
The current POST /auction endpoint is stateless and has no slot-template awareness or GPT lifecycle integration. It can technically serve scroll/refresh requests (full consent pipeline runs, EC ID generated per-call), but:
- Caller must construct
adUnitsexplicitly — no template expansion fromcreative-opportunities.toml - No session threading — each call is independent
- No GPT
slotRenderEndedor refresh event coordination
Per the server-side ad templates design spec §4.6, slim-Prebid owns scroll and refresh client-side for Phase 1. slim-Prebid runs post-window.load, handles GPT refresh events, and runs client-side auctions for slots that have already rendered their initial TS-served impression.
Decisions needed
- Phase 1 (current): Confirm slim-Prebid as the scroll/refresh owner. Document that
/auctionis not the intended path for these events. - Phase 2 (future): Define whether a server-side refresh API makes sense — e.g. a slot-template-aware
POST /auction/refresh?slotIds=atf_sidebar_adthat expands fromcreative-opportunities.tomland returns updated bids without requiring the caller to know bidder params. - SPA navigation: Pure client-side SPAs (pushState routing) do not trigger TS page-level auctions. Document this gap and confirm slim-Prebid handles the SPA refresh case.
Action
- Add a comment to
auction/endpoints.rsclarifying that/auctionis for initial-render and programmatic use, not scroll/refresh - Document the slim-Prebid handoff contract in the tsjs GPT integration
- Track Phase 2 server-side refresh API as a follow-up (do not design now)
Parent: #677
Resolution
Phase 1 confirmed: slim-Prebid owns scroll and refresh client-side. Server-side has no scroll/refresh mechanism.
Current behavior by scenario:
- SPA navigation (
pushState/popstate): browser callsGET /__ts/page-bids?path=/new-route→ server runs freshbuild_auction_requestfor the new path → returns bids as JSON → slim-Prebid injects them. Scoped to navigation events only, not scroll. - Scroll (lazy-load): no server-side mechanism. Slim-Prebid fires new auctions on scroll events client-side via Prebid.js
requestBids. If slim-Prebid is not on the page (pure server-side mode), scroll ads do not auto-refresh. - Hard refresh: browser issues a fresh page load → full server-side auction runs from scratch as a normal publisher request — no special handling needed.
POST /auction/refresh: deferred — not implemented. Required before pure server-side deployments (no slim-Prebid) can support lazy-load scroll ads.
Key constraint for pure server-side mode: without slim-Prebid, scroll-triggered lazy-load auctions are blocked on POST /auction/refresh being implemented first.
Activity
Document scroll/refresh handoff contract between TS and slim-Prebid
Implement server-side ad slot templates with PBS and APS auction (IAB…
Add ts CLI ad-template config diagnostics and browser audit (#823)