The tracker
Everything is available as DeltaAnalytics.<name>(…) once loaded, or dba('<name>', …) at any time.
| Call | What it does |
|---|---|
track(name, props?, { revenue?, currency? }?) | A custom event: track('Signup', { plan: 'pro' }, { revenue: 49, currency: 'EUR' }). Up to 30 properties; strings, numbers and booleans. A property sent as a number ({ items: 3 }, not { items: '3' }) can also be added up, averaged, or taken at its smallest or largest in a chart. |
identify(id, token?) | Ties the visit to your own id for a signed-in person. See signed-in people. Call it on every page while they are signed in; identify(null) on sign-out. |
consent(true \| false) | Your visitor agreed to (or withdrew from) analytics storage. See privacy. |
variant(key) | The variant of an experiment this person sees, or null (show the original). See experiments. |
flag(key) | Whether a feature flag is on for this person: its rollout, and its targeting (signed-in people only, people named). See experiments. |
pageview() | Count a pageview by hand (rarely needed: history changes are counted). |
notFound() | Count this page as a 404 (or add <meta name="dba-404"> to your 404 page). |
optOut(true \| false) | Stop (or start again) counting this browser. |
ready(fn) | Runs fn once the tracker has loaded: dba('ready', () => …) before then, at once after. |
Charts from your own events. Under Charts, count any event over the last hours or days, a calendar period or fixed days; add up or average a number it carries (track('Order', { total: 49.5, items: 3 }) gives the sum, the average basket and the largest order); split it by a property, a page or a country; and compare with the period before. Charts go on dashboards, and alerts watch them. Values your server measures (a count of users, a queue's length) go in through the API.
Counted on their own: pageviews, time on page and scroll depth (when the visitor leaves the page or hides the tab, and again with the time added each time they come back to it; a visible page sends a short heartbeat every five minutes so a long read stays one visit), outbound links, file downloads, JavaScript errors, Core Web Vitals (LCP, INP, CLS, FCP, TTFB), clicks for heatmaps with rage clicks and dead clicks. A page prerendered by the browser counts only once it is shown, and a page restored by the back button counts again.
Never sent: what anyone types, email addresses (masked wherever they appear), query parameters that look like secrets (token, key, code, password, email and more — add your own under Settings → Site), and IP addresses (used for the moment of counting, then dropped).