Before setting up event tracking, make sure you have an analytics project in Userorbit and the Userorbit SDK installed in your application. If you have not.
Initialize the Userorbit browser SDK with an account ID, then send named product events.~js
import userorbit from "userorbit-js";
await userorbit.init({ accountId: "YOURACCOUNTID", analytics: { enabled: true }, });~
For a known user, include identity fields during initialization or call identify:
~js
await userorbit.identify("user123", {
email: "person@example.com",
name: "Avery Chen",
attributes: { plan: "growth" },
});
~~js
await userorbit.track("Workspace Created");
~
Use consistent names, track completed actions, and avoid sending secrets or unnecessary personal data.
Open Analytics > Live Events in the correct project, perform the action, and inspect the received event.
Initialize
await userorbit.init({ accountId: "YOURACCOUNTID", analytics: { enabled: true }, });
For a known user, include identity fields during initialization or call identify:
Track an event
Use consistent names, track completed actions, and avoid sending secrets or unnecessary personal data.
Open Analytics > Live Events in the correct project, perform the action, and inspect the received event.