# Switching from Simple Analytics

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 Simple Analytics’:

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

Run both for a few weeks to compare the same days, then remove Simple Analytics’ tag. Its automated events script has nothing to replace: links to other sites, downloads and email links are counted with the tag alone, as [actions](https://fiveb.ar/docs/outbound-and-downloads.md), and so are forms sent.

## Events and goals

Each `sa_event()` call becomes a [`tally()`](https://fiveb.ar/docs/events.md) call with the same name, and its metadata as the data:

| Simple Analytics | fivebar |
| --- | --- |
| `sa_event('signup')` | `tally('signup')` |
| `sa_event('signup', { plan: 'pro' })` | `tally('signup', { plan: 'pro' })` |
| `window.sa_metadata = { author: 'Ada' }` | [`data-property-author="Ada"`](https://fiveb.ar/docs/script-attributes.md#data-property-name) on the tag |

An event keeps up to 8 names in its data: see [Data](https://fiveb.ar/docs/events.md#data). Every event is a goal already, so there’s nothing to set up for them. A goal for reaching a page, such as `/thanks`, becomes 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 Simple Analytics under Import in the site’s settings, with an API key. The dashboard then reaches back before fivebar’s first day: see [Importing from Simple Analytics](https://fiveb.ar/docs/import/simple-analytics.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.
