Events Overview
How events work in Hardal: the event model, standard vs custom events, identify, and consent.
How events work
Events tell Hardal what happens on your site or app. The web script automatically collects page views, page scrolling, scroll-depth milestones, and outbound link clicks. Send business events such as purchases and form submissions explicitly.
The event model
Every event has a name and a set of parameters. On the web, send events with hrd.track(). From mobile or your backend, POST the same information to /collect.
<script>
hrd.track("purchase", {
transaction_id: "ORD-20260615-7891",
value: 214.98,
currency: "USD"
});
</script>
<script>
window.hrd?.track?.("purchase", {
transaction_id: "ORD-20260615-7891",
value: 214.98,
currency: "USD"
});
</script>
On the web, the event name you pass to hrd.track() maps to eventName in the API. Its parameters map to payload.data.
In Google Tag Manager, use the same call in a Custom HTML tag after the tracker has loaded.
Choose an event guide
Standard Events
Named events for e-commerce and leads, with the parameters each one expects.
Custom Events
Send any event that fits your product.
Identify Visitors
Link consented sessions to a visitor identity after login or consent.
Consent Signals
Tell Hardal when a visitor grants or denies tracking.
Collected automatically
The web script collects these events when data-auto-track is enabled (the default):
| Event | What it records |
|---|---|
page_view | Initial page load; SPA route changes also produce page views when data-spa is enabled. |
scroll | First page scroll, once per page view. |
scroll_depth | Each reached milestone, once per page view: 25%, 50%, 75%, 90%, and 100%, in percent. |
outbound_click | External HTTP(S) link activations, with linkUrl and linkDomain. Internal links are excluded. |
Automatic collection requires the Web Setup with the Hardal tracker installed and automatic tracking enabled. An API-only integration does not automatically track page views, scrolls, scroll depth, or outbound clicks; your implementation must send these events explicitly.
With the web tracker installed, no extra event tags are needed for these interactions.
Automatic interaction events appear in Engagement → Events. They contribute to engaged sessions when included in the shared Key Events selection. See Choose Key Events.