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
Copy your line of code
It looks like this. Yours has your site’s id in place of
your-site-id.<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.
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.<!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>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 on | Look here |
|---|---|
| Hand-written HTML | Each page, just before </head>. |
| WordPress | Your theme’s header template, or a plugin that adds “header scripts”. |
| Webflow | Site settings, Custom code, Head code. |
| Squarespace | Settings, Advanced, Code injection, Header. |
| Wix | Settings, Custom code. Add it to the head of all pages. |
| Shopify | Online Store, Themes, Edit code, theme.liquid, before </head>. |
| Ghost | Settings, Code injection, Site header. |
| Next.js, Nuxt, Astro, SvelteKit and similar | The 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
localhostor 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:
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
- Count sign-ups, downloads and clicks with goals.
- Learn what the numbers on the dashboard mean.
- Still seeing “Waiting for the first visit” after a minute? Go through the checklist.