# Gatsby

Add the tag to every page of a Gatsby site, from gatsby-ssr.js.

Add the tag to every page’s head from `gatsby-ssr.js`, at the root of your site, with `onRenderBody`:

```
import React from 'react';

export const onRenderBody = ({ setHeadComponents }) => {
  setHeadComponents([
    <script key="fivebar" async data-domain="example.com" src="https://fiveb.ar/js/tally.js" />,
  ]);
};
```

Rebuild the site for it to take effect. Gatsby moves between pages without loading them, and each is counted as a [single-page app](https://fiveb.ar/docs/single-page-apps.md)’s. See [Gatsby’s server rendering APIs](https://www.gatsbyjs.com/docs/reference/config-files/gatsby-ssr/).

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.
