Skip to content

Conversation

@prk-Jr
Copy link
Collaborator

@prk-Jr prk-Jr commented Feb 10, 2026

Third-party geo and DMA lookups add avoidable latency and introduce additional privacy and compliance risk. This change enables geo information to be derived from Fastly at the edge and passed through the Trusted Server instead of relying on browser-side APIs.

Centralizing geo handling reduces external dependencies, improves reliability when third-party services fail, and supports ongoing efforts to minimize client-side data exposure while preserving existing ad and bidding functionality.


Technical Implementation

To reliably pass server-side Geo signals to the client-side Prebid auction without race conditions or additional network calls, this PR refactors the Prebid integration to be configuration-driven:

Geo Injection

Decoupled Geo logic into a standalone module:

crates/common/src/geo.rs

  • Injects x-geo-* headers
  • Exposes a /first-party/geo endpoint

Configuration Injection

Refactored PrebidHtmlInjector:

crates/common/src/integrations/prebid.rs

  • Injects the entire Prebid configuration (including resolved Geo data) into:

    window.__tsjs_prebid

Synchronization

Updated the tsjs client library:

crates/js/lib/src/integrations/prebid/index.ts

  • Initializes Prebid.js using the injected configuration object
  • Ensures the auction always has access to the correct edge-derived location data immediately upon load
  • Eliminates asynchronous IP lookups and race-prone client-side fetching

Resolves: #280

Third-party geo and DMA lookups add avoidable latency and introduce
additional privacy and compliance risk. This change enables geo
information to be derived from Fastly at the edge and passed through
the Trusted Server instead of relying on browser-side APIs.

Centralizing geo handling reduces external dependencies, improves
reliability when third-party services fail, and supports ongoing
efforts to minimize client-side data exposure while preserving
existing ad and bidding functionality.

Resolves: #280
@prk-Jr prk-Jr self-assigned this Feb 10, 2026
Third-party geo and DMA lookups add avoidable latency and introduce additional privacy and compliance risk. This change enables geo information to be derived from Fastly at the edge and passed through the Trusted Server instead of relying on browser-side APIs.

Centralizing geo handling reduces external dependencies, improves reliability when third-party services fail, and supports ongoing efforts to minimize client-side data exposure while preserving existing ad and bidding functionality.

Resolves: #280
to resolve CI lint failure.
@prk-Jr prk-Jr marked this pull request as ready for review February 11, 2026 15:11
@prk-Jr prk-Jr requested review from ChristianPavilonis and aram356 and removed request for aram356 February 11, 2026 15:11
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.

Pass and Expose Geo / DMA info from Fastly to replace 3p Geo API calls

1 participant