Tracking
TanStack Start custom events
Send custom events from a TanStack Start app with @nextanalytica/tag: sign-ups, demo requests and conversions your agent reads by channel.
Updated
In TanStack Start, send custom events with track from @nextanalytica/tag in a component's event handler. Mark the events that matter as conversions.
How does it look?
src/components/SignupButton.tsx
import { track } from "@nextanalytica/tag";
export function SignupButton() {
return <button onClick={() => track("signup_started", { plan: "team" })}>Start free</button>;
}What about server functions?
These functions only run in the browser: on the server they do nothing, so call them from code that runs in the browser. For what your server confirms, send a server event with a server key: see Revenue tracking.
What can you ask your agent?
- "Which events happen most this week?"
- "What's the sign-up rate by channel this month?"