Overview
This tutorial walks you through setting up analytics in Userorbit from scratch. By the end, you will have a working analytics project, a default dashboard showing live data, and your first tracked event.
Step 1: Create your analytics project
Start by navigating to the Analytics section in the Userorbit sidebar. Click New Project and give it a name that reflects your product or environment, such as "Production" or "Mobile App."
Choose your project's timezone — this determines how daily metrics are calculated. Select the timezone where most of your team operates. Click Create to finish.
Step 2: Install the Userorbit SDK
To send events to your project, you need to install the Userorbit SDK in your application. The SDK is available for JavaScript, React, and Node.js.
For a JavaScript or React application, install the package:
npm install @userorbit/sdk
Then initialize the SDK with your project's API key, which you can find in your project's settings page:
import { userorbit } from '@userorbit/sdk';
userorbit.init({ apiKey: 'your-project-api-key' });
Step 3: View the default dashboard
Once your project is created, Userorbit generates a default dashboard automatically. Navigate to your project and click Dashboard in the project menu.
The default dashboard includes:
- Active users — A chart showing daily and weekly active user counts.
- Event volume — A timeline of total events received.
- Top events — A table listing your most common events by count.
The dashboard will be empty until you start sending events. That is expected — let's fix that next.
Step 4: Track your first event
With the SDK installed, you can now track an event. Choose a meaningful action in your product, such as a page view or button click. Add a tracking call where that action occurs:
userorbit.track('button_clicked', { buttonName: 'signup', page: '/home' });
The first argument is the event name. The second is an optional object of properties that add context to the event.
Step 5: Verify your event
After triggering the event in your application, go back to your Userorbit dashboard. Within a few seconds, you should see:
- The event count increment on the Event volume chart.
- Your event name appear in the Top events table.
- The event in the Live Events stream, accessible from the project menu.
If you do not see your event, check the following:
- Confirm your API key is correct in the SDK initialization.
- Make sure the SDK is initialized before you call
track(). - Check your browser's network tab for any failed requests to the Userorbit API.
Next steps
With your first event flowing, you are ready to expand your analytics setup. Consider these next actions:
- Add more events to cover key user actions in your product.
- Create custom dashboards focused on specific features or metrics.
- Set up user identification so events are tied to user profiles.
- Define segments to group users by behavior or properties.