trackEvent, every event_name, and React hooks.
Tracking events
trackEvent sends one event or up to 50 in a single call. Which fields you can include depends on event_name.
event | list of events
required
A single event, or a list of up to 50 events in one call. An empty list returns immediately with
accepted: 0 and does not contact the API.Shared fields
Optional on every event below — you do not repeat them in each accordion. Use them when a screen or milestone should appear as a funnel step in reporting.boolean
When
true, marks this event as a funnel step. Omit or leave false for ordinary page views or
minor events.string
Human-readable step name in dashboards (max 128 characters). Meaningful when
is_funnel_step is
true — e.g. "Shipping" or "Payment".Events
Expand an event for an example and field details. React is theanalytics() module factory and the
track hooks. JavaScript lists every event you can send from initAnalytics. Server lists events
you can send from initAnalyticsServer — shared event names are documented in both tabs.
- React
- JavaScript
- Server
analytics()
Module factory for EmbeddablesProvider — not a hook
analytics()
Module factory for EmbeddablesProvider — not a hook
modules prop. core comes from the provider — do not pass
it here. The generated CLI setup wires this for you.string
Optional. Overrides
publishableKey on Core config when Analytics must own the key.useTrackEvent()
Track any event from React
useTrackEvent()
Track any event from React
function
Same inputs as trackEvent above. Does nothing without error if Analytics is not
ready yet.
boolean
true while a send is in progress — not while Analytics is still loading.boolean
true when the latest track call failed.unknown
Details from the failed send, when
isError is true.useTrackClickEvent()
Wrapper for button:clicked
useTrackClickEvent()
Wrapper for button:clicked
string
required
Passed through as
button_key — see button:clicked under JavaScript.function
Optional. Runs only after a successful track.
trackClickEvent, isPending, isError, and error. Calling
trackClickEvent with key and optional callback returns an onClick handler.useTrackCustomEvent()
Wrapper for custom_event:triggered
useTrackCustomEvent()
Wrapper for custom_event:triggered
Returns
trackCustomEvent, isPending, isError, and error. Optional properties follow
custom_event:triggered under JavaScript or Server.React hooks do not send events during server-side page rendering — use
initAnalyticsServer in
Overview & setup instead. For visitor or project id in React, use
Core’s useAppUserId and useEmbeddablesProjectId.Returns
string
required
Visitor id for this call. Created by the API the first time if Core did not have one yet; save it
in Core for later events.
number
required
How many events in the call were accepted (0–50).
boolean
required
Whether the events were passed on to reporting storage. Can be
false even when the call succeeds
if reporting is not set up or temporarily unavailable.
