Skip to content

A hit event is a counter tick, like a page view in web analytics. Hits power the traffic numbers in the dashboard: page views, visits, and custom goals.

Where it comes from ​

  • HitIntegration — one hit when the page loads, then one per SPA navigation (history.pushState / popstate).
  • hit(name) — a named custom hit ('signup', 'checkout-opened'), sent on demand.
  • hit(name, sessionId?) in @buglapse/node — a named custom hit sent from the server (e.g. once a payment is confirmed). A server has no visit of its own: pass the browser's session id along to count the hit in that visit, or leave it out.

Payload ​

Automatic page view:

json
{
    "type": "hit",
    "timestamp": "2026-09-24T10:15:02.481Z",
    "tags": {},
    "contexts": { "device.userAgent": "Mozilla/5.0 …", "request.url": "https://shop.example/cart" },
    "payload": { "sessionId": "e3b1…" }
}

Named custom hit:

json
{ "type": "hit", "payload": { "sessionId": "e3b1…", "name": "checkout-opened" }, … }
FieldTypeDescription
sessionIdstring, optionalThe visit this hit belongs to. Always set by the browser SDK; absent for a server-side hit sent without one.
namestring, optionalAbsent for an automatic page view; set for a named custom hit. The two are counted separately.

Sessions ​

The session id lives in localStorage and rolls over after 30 minutes of inactivity, so hits from several tabs of the same visit share it. Where storage is unavailable (private mode, blocked storage), each hit gets a fresh id.

Sampling ​

The server-side hit sample rate (Settings → Filters) is rolled independently for each event.

Quota ​

Counts as one toward the monthly metrics limit. Other types have their own limits, so running out of metrics never stops errors, logs or traces.