Docs Install the script

Get started

Install the script

Add one line of code to your website and see your first visitor in the dashboard within seconds.

Before you start

You need an account and a site in it. Sign up, then add your domain on the dashboard. Fivebar shows you the line of code for that site, with its id already filled in, and waits for your first visitor.

Three steps

  1. Copy your line of code

    It looks like this. Yours has your site’s id in place of your-site-id.

    HTML
    <script defer src="https://script.fivebar.eu/latest.js" data-site="your-site-id"></script>

    You find it on the site’s page in the dashboard: on the install screen while the site is new, and under “Site settings” afterwards.

  2. Paste it into the head of every page

    It belongs between <head> and </head>. Most websites have one shared template or one settings box for that, so you paste it once and every page gets it.

    HTML
    <!doctype html>
    <html>
      <head>
        <title>My website</title>
        <script defer src="https://script.fivebar.eu/latest.js" data-site="your-site-id"></script>
      </head>
      <body>
        ...
      </body>
    </html>
  3. Open your website

    Visit your live site in a new tab. Your own visit is enough: the dashboard notices it within a few seconds and switches from the install screen to your numbers. There is nothing to confirm or click.

Where to paste it

Site builders name the place differently, and their menus change over time. Look for a setting that adds custom code to the page head (not the body, and not a single page). Some builders only allow custom code on paid plans.

If your site runs onLook here
Hand-written HTMLEach page, just before </head>.
WordPressYour theme’s header template, or a plugin that adds “header scripts”.
WebflowSite settings, Custom code, Head code.
SquarespaceSettings, Advanced, Code injection, Header.
WixSettings, Custom code. Add it to the head of all pages.
ShopifyOnline Store, Themes, Edit code, theme.liquid, before </head>.
GhostSettings, Code injection, Site header.
Next.js, Nuxt, Astro, SvelteKit and similarThe root layout or document, so it is on every page once. Page changes without a reload are counted automatically.

Which addresses are counted

A site counts pages on the domain you entered and on every subdomain of it. If you added example.com, then www.example.com, blog.example.com and shop.example.com all count towards the same dashboard.

Pageviews from anywhere else are refused, even with the right code on the page. That covers:

  • Another domain. A copy of your site on example.org, or a preview address from your hosting company, is a different website. Add it as its own site if you want it counted.
  • Your own computer. Pages opened on localhost or straight from a file are never counted, so developing your site does not inflate the numbers.

The id in your line of code is not a secret. Anyone can read it in your page’s source, and this rule is why that is harmless: copied onto someone else’s website, it counts nothing.

If your site has a Content Security Policy

Most sites do not, and can skip this. If yours sends a Content-Security-Policy header, the browser blocks the script until the policy allows it. Add Fivebar’s address to these two rules:

Content-Security-Policy
script-src https://script.fivebar.eu;
connect-src https://script.fivebar.eu;

The first lets the script load, the second lets it send pageviews.

Next