Skip to content

normalizeReferrer

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/apps/api/src/analytics/utils/tracking-utils.ts

Map a raw referrer URL into a small, normalized source bucket so that https://www.google.com/search?q=foo and https://google.com/ both roll up under "google" in the dashboard. Unknown hosts collapse to the bare hostname so we can still see long-tail sources.

Signature

ts
function normalizeReferrer(referrer: string | null | undefined): string

Parameters

NameType
referrer`string

Returns: string

Was this page helpful?

Download as PDF