# Switching from Fathom

Swap the tag, carry your events and goals across, and bring the site’s history with it.

## Add the tag

[Add the site](https://fiveb.ar/docs/install.md#add-the-site), then put fivebar’s tag in the `<head>` of every page, beside Fathom’s:

```
<script async data-domain="example.com" src="https://fiveb.ar/js/tally.js"></script>
```

Where Fathom’s tag names the site by its ID, fivebar’s names it by its domain. Run both for a few weeks to compare the same days, then remove Fathom’s tag.

A single-page app needs nothing like Fathom’s `data-spa`: fivebar counts each page it moves to. Links to other sites, downloads and forms sent are counted with the tag alone, as [actions](https://fiveb.ar/docs/outbound-and-downloads.md). Addresses you blocked in Fathom go under [Excluded traffic](https://fiveb.ar/docs/excluding-traffic.md) in the site’s settings.

## Events and goals

Each `fathom.trackEvent()` call becomes a [`tally()`](https://fiveb.ar/docs/events.md) call with the same name:

| Fathom | fivebar |
| --- | --- |
| `fathom.trackEvent('Signup')` | `tally('Signup')` |
| `fathom.trackEvent('Purchase', { _value: 1999 })` | `tally('Purchase', { revenue: 19.99, currency: 'GBP' })` |
| `fathom.trackGoal('ABCD1234', 0)` | `tally('Signup')`, named for what it counts |

Fathom’s `_value` is in cents. fivebar’s [revenue](https://fiveb.ar/docs/goals.md#revenue) is the amount itself, with its currency beside it.

Every event is a goal already, so there’s nothing to set up for them. To count the visits that reach a page, such as `/thanks`, add a [page goal](https://fiveb.ar/docs/goals.md#page-goals) in the site’s settings, with `*` for anything.

## Bring the history over

Once fivebar is counting, choose Import from Fathom under Import in the site’s settings, with an API token and the site’s ID. The dashboard then reaches back before fivebar’s first day: see [Importing from Fathom](https://fiveb.ar/docs/import/fathom.md).

---

fivebar is web analytics without cookies, at https://fiveb.ar. Every page of its docs is listed at https://fiveb.ar/docs/index.md.
