Repository navigation
analytics: omit an empty referrer instead of sending "" - #378
Merged
Merged
Conversation
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.
mosherBT
approved these changes
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
getTrafficSource()returnsreferrer: ""when there is no referring hostname (direct traffic,no-referrerpolicies, 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 wholeoptable.prebid.auctionevent. A cacheddirectis 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
referreris left out when empty, including a""cached in sessionStorage by a version that sent it.trafficSourceand 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 libclean, prettier clean.