All guides
The one tag that works everywhere, where to paste it, and how to confirm the first pageview arrived.
Statsy is one script tag. It is about 3 KB gzipped, loads deferred, and never blocks a paint. Every site gets a public site key that starts with ws_; the install screen prints the tag with your own key already filled in.
<script defer data-website-id="ws_XXXXXXXX" data-domain="yourstartup.com" src="https://statsy.co/js/script.js"></script>Paste it inside <head> on every page, in the layout or base template rather than a single page. Keep defer, do not change the site key, and do not add the tag twice.
The two attributes that matter
data-website-idis your site key. It is required.data-domainis the site’s main domain. Links to any other host count as outbound clicks.
Every other attribute is optional and documented in the script reference.
Confirm it works
Deploy, then open your site
Load any page of the real domain once in a normal browser tab.
Watch the install screen or Live
The install screen turns green as soon as the first pageview arrives. Live shows the same visitor on the globe, with their city and the page they are on.
Click around
A second page should appear within a few seconds. Single-page apps count client-side navigation too, so the path in Live should follow you. See Single-page apps and route changes.
Watch out. Beacons are only accepted from the site’s domain and its subdomains, plus any additional domains you added in Site settings › General. A preview host such as
yoursite.webflow.iooryourapp.vercel.appis dropped until you add it. See Subdomains and multiple domains.
Serve it from your own domain
Every guide below also works with a first-party proxy host. Set one in Site settings › Tracking and the src becomes https://s.yourstartup.com/js/script.js instead, which ad blockers leave alone. See Serve the script from your own domain.
Pick your platform
- Hand-written pages and templates: HTML, Hugo, Docusaurus.
- JavaScript frameworks: Next.js, React, Vue, Nuxt, SvelteKit, Astro, Remix.
- Site builders and CMSs: WordPress, Shopify, Webflow, Framer, Squarespace, Wix, Ghost, Carrd, Bubble, Google Tag Manager.
- Server frameworks: Laravel, Django, Rails.
- AI builders: Lovable, v0, Bolt, Replit.
Tip. Onboarding has a ready-made prompt for AI coding agents and an email template for asking a developer to install the tag. Both carry your real site key.
Last updated · Markdown version