Skip to content

Script installed but no data

The tag is on the page and nothing shows up: domain mismatches, caching, staging environments, bots, clocks and exclusions.

Start by working out which half of the trip is failing: the script not sending, or the server not accepting. The Network tab answers that in one look. Filter for collect and reload a page.

No request to /api/collect at all

Then the script never ran. The usual reasons:

  • The tag is not on the page. View source rather than trusting your template. A tag in a component that only renders on some routes is a common miss.
  • Caching. A CDN or page cache is serving the old HTML. Purge it, and hard-reload with the cache disabled.
  • Do Not Track or Global Privacy Control. By default the script sends nothing at all from those browsers. Test in a browser without them, or set data-ignore-dnt="true" if you want those visits counted.
  • This browser opted out. If statsy_optout is set to 1 in local storage, nothing is sent from it.
  • A blocker. See Ad blockers.
  • A blocked script source. See Content Security Policy.

Note. The tracking script never writes to the console, by design. An empty console is not evidence of anything — trust the Network tab instead.

The request returns 202 and still nothing appears

202 means “received”, not “recorded”. The beacon is checked after it is accepted, and anything that fails is dropped without an error, so that a stolen site key cannot be used to inject traffic or probe your setup. Work through these in order.

CauseHow to check
The page host does not match the siteThe host must be the site’s domain, a subdomain of it, or one of its extra domains. www. is ignored. Add other hosts under Site settings › Tracking.
You are on localhostHits from localhost, 127.0.0.1 and ::1 are not accepted by the hosted service. Test on a real hostname.
You are opening a file directlyA file:// page has no host, so its beacons are dropped.
You look like a botHeadless Chrome, Playwright, Puppeteer, Selenium, Lighthouse, curl, Postman, uptime monitors and link-preview fetchers are all counted as bots, as is an empty user agent. They appear under the bots report, not under visitors.
The path or IP is excludedCheck excludePaths and excludeIps in Site settings.
The device clock is wrongEvents timestamped more than 24 hours in the past, or more than a minute in the future, are discarded.

Staging counted as production

If your staging site runs the same tag on a subdomain of your main domain, its traffic is accepted and mixed in. Use a separate site in Statsy for staging, or leave the tag out of non-production builds.

Some pages record and others do not

  • Check that the tag is in the layout every route uses, not just the home page.
  • On a single-page app, navigation is tracked automatically through the History API. If your router uses hash URLs, add data-hash-routing="true".
  • Pages served from a different host need that host in the site’s extra domains.

Wrong data-domain, without an error

data-domain also decides which links count as leaving your site. Set it wrongly and your own internal links are recorded as outbound clicks while real external links are not. If your outbound numbers look absurd, check that attribute first.

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

Last updated · Markdown version