# `PhoenixReplay.Recording.Traffic`
[🔗](https://github.com/elixir-vibe/phoenix_replay/blob/v0.6.2/lib/phoenix_replay/recording/traffic.ex#L1)

Where a visit came from, as Google Analytics tells it:

  * `:source` — the landing's `utm_source`, else the host of the site
    that referred it, else `"(direct)"`
  * `:medium` — its `utm_medium`, else `"referral"` when a site referred
    it, else `"(none)"`
  * `:campaign` — its `utm_campaign`, or `nil`

All are `nil` when the visit's landing was not kept, without
`PhoenixReplay.Plug` and the `:client` config. See
`PhoenixReplay.Recording.Client.traffic/1`.

# `t`

```elixir
@type t() :: %PhoenixReplay.Recording.Traffic{
  campaign: String.t() | nil,
  medium: String.t() | nil,
  source: String.t() | nil
}
```

# `from_legacy`

```elixir
@spec from_legacy(String.t()) :: t()
```

Reads a source saved before 0.6: `"google / cpc / spring"`, or a lone
referrer host or `utm_source`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
