Measuring
Custom events
Without writing code: HTML attributes
Add data-vitrus to an element and clicking it sends an event.
data-vitrus-event-* attributes become event properties:
<button data-vitrus="plan_selected" data-vitrus-event-plan="pro" data-vitrus-event-placement="hero">Choose Pro</button>
Mark your CTAs
Elements carrying data-vitrus-cta emit a
cta_click event — conversion rate and the default funnel both use it, with
no further configuration.
<a href="/signup" data-vitrus-cta>Start free</a>
From code
vitrus("signup", { plan: "pro", source: "landing" });
Event names may contain A-Z a-z 0-9 _ . : - and are capped at 80
characters. Property values may be a string, number, boolean or null — nested objects are
rejected (payload bloat and personal-data risk).
Collected automatically
You do not need to write code for any of these:
| Event | When |
|---|---|
pageview | On load and on SPA route changes. |
cta_click | A data-vitrus-cta element is clicked. |
outbound_click | An external link is clicked. |
form_submit | A form is submitted — name and field count only. |
scroll | On exit, with the deepest percentage reached (once per page). |
form_abandon | A field was focused and the form was never submitted. |
rage_click | Three or more clicks on the same spot within 800 ms. |
web_vitals | On exit, with LCP, INP, CLS, FCP and TTFB. |
error | An uncaught error or unhandled rejection. |
Form abandonment never sends values. Only the field name goes out
(
phone), never what was typed into it. Password and hidden fields are
not observed at all.