What is batchTrack?
batchTrack() lets you send multiple events in one request to the Analytiq server instead of making separate requests for each event.
Think of it like this:
When to use batchTrack vs track
Rule of thumb: If your events happen at exactly the same time (e.g., when a component mounts), use
batchTrack(). If they happen at different times based on user actions, use track() individually.
Basic usage
name(required) — the event nameproperties(optional) — same key-value pairs astrack()
React — App startup tracking
- JavaScript (.jsx)
- TypeScript (.tsx)
pages/Dashboard.jsx
Next.js App Router
Vue 3
Vanilla HTML
With user identity
If the user is already logged in when the batch fires, you can includeuserId per event: