← Documentation

Track events

On top of pageviews, you can track things like button clicks, form submits, or video plays. Do it with data attributes (no code) or JavaScript.

Limits

  • Event names: up to 50 characters.
  • You must always provide an event name; you can’t send only custom data.

Data attributes

Add data-intrily-event="event-name" to the element. On click, Intrily sends that event. Example for a button:

<button id="signup-button" data-intrily-event="Signup button">Sign up</button>

Optional: attach extra fields with data-intrily-event-*. The part after the hyphen becomes the key:

data-intrily-event="Signup button" data-intrily-event-email="user@example.com" data-intrily-event-id="123"

That sends { email: 'user@example.com', id: '123' } along with the event.

Heads up

  • Values from data attributes are always strings. For numbers, booleans, or dates, use intrily.track() in JavaScript.
  • With data attributes, the tracker’s click handler may run instead of (or before) your own—test if you have existing click logic.

JavaScript

Call window.intrily.track('Event name') when the action happens. Same outcome as the data-attribute example:

const button = document.getElementById('signup-button');
button.onclick = () => intrily.track('Signup button');

For extra JSON on the event, see Tracker functions.

Where to see events

Events show up on the Events report for that website. The Properties tab lists your custom keys and value breakdowns.