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:

EventWhen
pageviewOn load and on SPA route changes.
cta_clickA data-vitrus-cta element is clicked.
outbound_clickAn external link is clicked.
form_submitA form is submitted — name and field count only.
scrollOn exit, with the deepest percentage reached (once per page).
form_abandonA field was focused and the form was never submitted.
rage_clickThree or more clicks on the same spot within 800 ms.
web_vitalsOn exit, with LCP, INP, CLS, FCP and TTFB.
errorAn 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.