HTML Script Tag

Detailed options and attributes for the client-side tracking script.

HTML Script Tag

The lightweight velo.js tracker works in any modern browser without external dependencies.

Standard Snippet

<script 
  defer 
  src="https://velostats.dev/velo.js" 
  data-site-key="YOUR_SITE_KEY">
</script>

Supported Script Attributes

Attribute Required Default Description
data-site-key Yes — The public identifier for your registered site.
data-endpoint No /api/v1/velo on script origin Custom beacon ingestion URL if proxying requests through a first-party path.
data-domains No All registered domains Comma-separated list of hostnames allowed to send beacons (e.g., example.com, app.example.com).
data-auto-track No true Set to "false" to disable automatic initial and SPA pageviews (useful when triggering window.velo('page') manually).
defer Recommended — Ensures the script does not block HTML parsing or initial paint.

Excluding Your Own Visits

To exclude your own browser from analytics while testing or administering your site, open your browser’s Developer Console on your site and run:

localStorage.setItem('velo_ignore', 'true');

To re-enable tracking for your browser, remove the key:

localStorage.removeItem('velo_ignore');

Note: velo.js also automatically ignores localhost, 127.*, and file:// URLs out of the box.

Content Security Policy (CSP)

If your website uses a Content Security Policy header, add the VeloStats domain to your policy directives:

Content-Security-Policy: 
  script-src 'self' https://velostats.dev;
  connect-src 'self' https://velostats.dev;