Track custom events
Send events from JavaScript or plain HTML attributes — plus the events Linqry records for you automatically.
From JavaScript
// window.linqry(eventName, properties?, revenueCents?)
window.linqry('signup-completed');
window.linqry('plan-selected', { plan: 'pro' });
window.linqry('purchase', { plan: 'pro' }, 4900); // $49.00Event names are 1–64 characters: letters, digits, space, _ . : / -. Pick a consistent scheme like noun-verb and stick to it, because names become the values you build funnels and goals from. Properties are a flat object, ≤ 20 keys, values ≤ 256 characters (nested values are stored as JSON strings). Revenue is always in the smallest currency unit (cents, paise, …).
From HTML, no JavaScript
Any element with data-linqry-event fires when clicked. Extra data-linqry-event-* attributes become event properties, and data-linqry-revenue attaches an amount in cents:
<button
data-linqry-event="cta-clicked"
data-linqry-event-location="pricing-page"
>
Get started
</button>
<!-- fires: cta-clicked { location: "pricing-page" } -->
<button data-linqry-event="purchase" data-linqry-revenue="4900">Buy</button>
<!-- fires: purchase with 4900 cents of revenue -->Events tracked automatically
| Event | When | Carries |
|---|---|---|
pageview | Every page load and SPA route change | URL, referrer (external only) |
pageleave | On every route change and when the visitor leaves | Time spent on the page being left |
outbound | A click on an http(s) link to another hostname | href of the external link |
Turning events into goals
Any event name or URL path can become a goal from the Goals page. You then get its completions and conversion rate for any date range. Events with revenue attached also flow into revenue attribution →