Docs
Plain HTML
Works with any site or static generator. One line, before the closing </head> tag.
Add the snippet
Paste this just before </head> on every page (or in your shared layout/template):
<script defer src="http://localhost:3000/analytics.js" data-website-id="YOUR_TRACKING_ID"></script>The script is deferred and non-blocking — it never slows down your page or affects Core Web Vitals.
Single-page apps
No extra work: the script hooks pushState, replaceState and popstate, so client-side navigations are tracked automatically.
Track custom events
Call the global lumen function with a name and optional properties:
lumen("Signup", { plan: "pro" });Outbound link clicks and file downloads are tracked automatically — no extra code.
Verify
Reload the page and open the site's real-time view in your dashboard. The event should appear within seconds.