Skip to content

Install on a static HTML site

Paste one tag inside the head of every page, deploy, and watch the first visitor land on the Live globe.

A hand-written site needs nothing but the tag. There is no plugin, no build step and no npm package.

Where it goes

Open every page’s HTML and paste the tag inside <head>, just before </head>. If your pages share a header include or partial, paste it there once instead.

html
<script defer data-website-id="ws_XXXXXXXX" data-domain="yourstartup.com" src="https://statsy.co/js/script.js"></script>

data-website-id is your site key from the install screen. data-domain is the domain you are measuring; links to other hosts are then recorded as the outbound goal.

Confirm it works

Deploy, then open the site in a normal tab. The install screen turns green on the first pageview, and Live shows the visitor with their city and current page. Click through to a second page and watch the path change.

Every page, or none

The usual problem with a static site is a page that was copied before the tag existed. Search your source for statsy and count the matches against the number of pages you ship. A page without the tag simply never reports, and shows up as a gap in the Pages report rather than as an error.

Watch out. Never paste the tag twice on one page. Two tags mean two pageviews per visit, which doubles your event count as well as your numbers.

Last updated · Markdown version