Custom Events

Pageviews are tracked automatically. Custom events let you track the specific actions that matter to your business — sign-ups, purchases, downloads, and more.


Tracking with HTML attributes

Add the data-tiny-event attribute to any clickable element. When a visitor clicks it, an event with that name is recorded:

html
<button data-tiny-event='Sign Up'>Create account</button>

Event names appear verbatim in your dashboard, so use short, human-readable names like Sign Up or Purchase.

Adding properties

Any attribute starting with data-tiny-event- is attached to the event as a property:

html
<button data-tiny-event='Purchase' data-tiny-event-plan='pro' data-tiny-event-price='49'> Upgrade </button>

This records a Purchase event with the properties plan: pro and price: 49. Add as many properties as you need.

Tracking with JavaScript

For events that do not map to a single click — a completed form, a finished checkout flow, or any other point in your own code — call track directly:

javascript
window.tinymetrics.track('Purchase', { plan: 'pro', price: 49 })

The first argument is the event name, the second an optional object of properties.

Where events appear

Events show up in your Tiny Metrics dashboard as soon as they are received. From there you can use them as steps in a funnel to measure conversion, or as the source of a trigger to get notified when they occur.