Skip to content

analytics: omit an empty referrer instead of sending "" - #378

Merged
jplaroche merged 2 commits into
masterfrom
fix/omit-empty-referrer
Oct 28, 2026
Merged

jplaroche merged 2 commits into
masterfrom
fix/omit-empty-referrer

Conversation

@jplaroche

@jplaroche jplaroche commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

getTrafficSource() returns referrer: "" when there is no referring hostname (direct traffic, no-referrer policies, in-app browsers). Both analytics add-ons spread it into the witness properties, and a witness event with an empty property value is rejected with a 400, dropping the whole optable.prebid.auction event. A cached direct is reused across internal navigation, so every auction of a direct session is lost.

Seen in production after the ascendeum bundle moved to 0.65.0: ~16% of its witness calls returned 400, all from osdk=web-v0.65.0. Introduced in #348 (v0.63.3).

Fix

referrer is left out when empty, including a "" cached in sessionStorage by a version that sent it. trafficSource and the session caching are unchanged.

Testing

  • pnpm exec jest: 36 suites, 680 tests pass (2 new cases for direct/paid without a referrer and for a stale cached empty referrer).
  • tsc -b lib clean, prettier clean.

getTrafficSource() returned referrer: "" when there is no referring
hostname (direct traffic, no-referrer policies, in-app browsers). Both
analytics add-ons spread it into the witness properties, and the edge
rejects an empty property value (MinPropertyVLen = 1) with a 400, so the
whole optable.prebid.auction event is dropped. A cached direct is reused
across internal navigation, so every auction of a direct session is lost.

Seen in production after the ascendeum bundle moved to 0.65.0: ~16% of its
witness calls returned 400, all from osdk=web-v0.65.0.

referrer is now left out when empty, including a "" cached in
sessionStorage by a version that sent it. trafficSource is unchanged.
@jplaroche
jplaroche marked this pull request as ready for review October 28, 2026 18:26
@jplaroche
jplaroche requested review from a team as code owners October 28, 2026 18:26
@jplaroche
jplaroche merged commit 240661e into master Oct 28, 2026
14 checks passed
@jplaroche
jplaroche deleted the fix/omit-empty-referrer branch October 28, 2026 18:30
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.

2 participants