From zero to tracking in a minute.
sonex is one lightweight script. No SDK, no cookies, no consent banner. Install it, then track exactly what matters with a tiny API.
Install the tracker
Add the script to your site's <head>. Pageviews start recording immediately, no build step required.
<script defer
src="https://trysonex.com/sonex.js"
data-website-id="REPLACE_WITH_WEBSITE_ID"></script> Track custom events
Call the global API for anything you want to measure, or declare events right in your markup with data attributes.
// fire a custom event from anywhere
window.sonex.track("signup", { plan: "pro" });
// attach a stable id to the current visitor (optional)
window.sonex.identify("user_123", { plan: "pro" }); Or track declaratively
Add data-sonex-event to any element. Extra data-sonex-event-* attributes become event properties.
<button
data-sonex-event="cta-click"
data-sonex-event-position="hero">
Start free
</button> Configuration
Tune collection with data attributes on the script tag. All optional.
- data-website-id
- Your website id from the dashboard. Required.
- data-host-url
- Override where events are sent. Defaults to the script's origin.
- data-auto-track="false"
- Disable automatic pageview tracking and drive it yourself.
- data-do-not-track="true"
- Honor the browser Do Not Track signal and skip those visits.
- data-exclude-search="true"
- Strip query strings from recorded URLs.
- data-exclude-hash="true"
- Strip hash fragments from recorded URLs.
- data-domains="a.com,b.com"
- Only collect on these hostnames.
- data-web-vitals="true"
- Also report Core Web Vitals (CLS, LCP, INP, FCP, TTFB).
- data-tag
- Label events with a tag to segment later.
Privacy is the default
sonex never sets a cookie, never fingerprints, and stores no personal data. There is nothing to configure for GDPR, PECR or CCPA, and Do Not Track is always respected.
Read the privacy model