# WordPress

Add the tag to every page of a WordPress site, with a plugin or from your theme.

The simplest way is a plugin that adds code to every page’s head, such as [WPCode](https://wordpress.org/plugins/insert-headers-and-footers/): under Code Snippets, then Header & Footer, paste the tag into Header and save. On WordPress.com, plugins need a paid plan.

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

Or add it from your theme’s `functions.php`, which works for block and classic themes alike. Use a child theme’s, so that updating the theme doesn’t remove the tag:

```
add_action('wp_head', function () {
  echo '<script async data-domain="example.com" src="https://fiveb.ar/js/tally.js"></script>';
});
```

If a plugin delays scripts until the visitor scrolls or clicks, to speed pages up, exclude `tally.js` from it. Otherwise a visitor who leaves without touching the page isn’t counted.

Once it’s live, [check it works](https://fiveb.ar/docs/install.md#check-it-works).

---

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