Overview
Events represent actions your users take in your application. They are the foundation for building segments, triggering campaigns, and understanding user behavior.Sending events
You can send events from two places:| Source | How | Best for |
|---|---|---|
| SDK (client-side) | Hacktionbase.track('event', props) | Page views, clicks, UI interactions |
| API (server-side) | POST /v1/events | Purchases, subscription changes, backend actions |
From the SDK
From your backend
Automatic events
The SDK tracks these events automatically — no code needed:| Event | Trigger |
|---|---|
page_view | Every page navigation (initial load + SPA route changes) |
js_error | Unhandled JavaScript errors |
Naming conventions
Usesnake_case for event names:
How events power the platform
Once events are tracked, they feed into several features:- Segments — define user groups based on event history (e.g., “users who completed checkout in the last 7 days”)
- Campaigns — trigger in-app messages or emails when specific events occur
- User timeline — view a chronological feed of events on each user’s profile
- Session context — events are linked to sessions, so you can see exactly what happened during a replay

