# normalizeReferrer

**Kind:** Function

**Source:** [`atloria-monorepo/apps/api/src/analytics/utils/tracking-utils.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/api/src/analytics/utils/tracking-utils.ts#L76)

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

| Name | Type |
|---|---|
| `referrer` | `string | null | undefined` |

**Returns:** `string`
