So, you want to track what your users are actually doing in your SaaS app. Good call. Guessing won’t cut it—if you want to build a product people like (and pay for), you need real data. That’s where Segment comes in. Segment helps you collect, clean up, and send user event data to all the other tools you use—analytics, email, CRM, you name it.
But Segment is only as useful as the events you send it. Set it up wrong, and you’ll end up with garbage in, garbage out. This guide walks you through setting up user event tracking in Segment, step by step, with a focus on SaaS products. I’ll flag what to focus on and what you can safely ignore (for now).
Step 1: Figure out what to track—don’t just log everything
Before you touch Segment, decide which user actions are worth tracking. Don’t just turn on tracking for every button and page. That’s a recipe for a messy, useless data swamp.
What’s actually valuable to track?
For SaaS, focus on events that map to:
- Core product usage: Actions that show someone’s getting value (e.g., “Created Project,” “Invited Team Member,” “Upgraded Plan”).
- Key conversion points: Signups, completed onboarding, started trial, cancelled subscription.
- Engagement signals: Feature adoption, successful integrations, exports, etc.
Leave out minor clicks, UI details, or things you’ll never analyze (like “Scrolled to Bottom”). More data isn’t always better—it just makes reports harder to read.
Pro tip: Write down your events in a spreadsheet first. List the event name, a plain-English description, and any properties (extra details) you want to send, like project_id
, plan_type
, or team_size
.
Step 2: Set up your Segment workspace and sources
If you haven’t already, create a Segment account and set up your workspace. Segment’s docs are pretty clear, but here’s the gist:
- Create a workspace. This is your top-level Segment account.
- Add a source. For a web app, this is usually a “JavaScript Source.” For a mobile app, use the iOS/Android source.
- Get your write key. Each source gets a unique key—you’ll need this in your code.
Honest take: Segment’s UI can be a little confusing at first—“sources” send data into Segment, “destinations” are where data goes out. Don’t overthink it.
Step 3: Integrate Segment into your app
Now, wire Segment up so it can actually collect events.
For web apps
- Install Segment’s JavaScript library (
analytics.js
) via npm or by dropping their script into your HTML. - Initialize it with your source’s write key.
javascript // npm install analytics.js import Analytics from 'analytics.js';
window.analytics.load('YOUR_WRITE_KEY'); window.analytics.page(); // tracks page view
Or, using the script tag:
html
Check Segment’s docs for the latest boilerplate—they change it up now and then.
For mobile apps
- Install Segment’s SDK for your platform.
- Plug in the write key.
Don’t get fancy yet: Just get the basic setup working. Don’t worry about privacy features, advanced plugins, or fancy destination filters at this stage.
Step 4: Send identify and track calls
Segment uses two main types of calls for user tracking:
identify
: Tells Segment who the user is (user ID, email, account type, etc.).track
: Logs a specific action (like “Created Project”).
Always identify users after login/signup
You want to know who did what. Call identify
as soon as you know the user’s identity—usually right after signup or login.
javascript analytics.identify("user_12345", { email: "alice@example.com", plan: "pro", team_size: 7 });
- The first argument is their unique user ID in your system.
- The second is traits (extra info about the user).
Track meaningful actions
Call track
whenever a user does something you want to measure.
javascript analytics.track("Created Project", { project_id: "prj_789", template: "Agile Board" });
- Event names should be clear and consistent (use Title Case, not camelCase).
- Properties add context—don’t skip them.
What to ignore: Don’t bother tracking every page view if you don’t care about them. (But track key flows, like “Started Onboarding.”)
Step 5: Test your events—don’t just hope
You’d be surprised how often events silently fail. Segment makes it easy to see incoming events:
- Open your Segment workspace.
- Go to your source’s “Debugger” tab.
- Perform actions in your app and watch for events to appear in real time.
Check that:
- Event names match your plan (no typos, no weird casing).
- Properties are coming through (and have real values).
- User IDs are being set after login.
Common mistakes:
- Forgetting to call
identify
—leaves you with anonymous events you can’t tie to users. - Sending too many random events—clutters your data and makes analysis harder.
If things aren’t showing up, double-check your write key and event code.
Step 6: Connect destinations (analytics tools, warehouses, etc.)
Once events are flowing into Segment, you can send them wherever you want—Mixpanel, Amplitude, BigQuery, email tools, whatever.
- In Segment, add a “Destination” for each tool you want your event data to go to.
- Configure any mappings or required fields (some tools need special properties).
- Test again—make sure events are showing up in your analytics tool.
Don’t get carried away: Only connect tools you’re actually using. Each destination adds complexity and can introduce new failure points.
Step 7: Keep your tracking plan up to date
Your product will change, so your event tracking should too. Don’t let your tracking plan rot.
- Remove events for features you’ve killed.
- Add new events for major features or flows.
- Update property names if they change in your product.
Pro tip: Assign one person to own the tracking plan. Otherwise, it’ll fall out of sync and nobody will trust the data.
What to skip (for now)
- Advanced identity resolution: Segment supports “alias” calls and cross-device tracking, but most SaaS products don’t need this on day one.
- Event batching and replay: Unless you’re processing millions of events a day, Segment’s basic pipeline is fine.
- Custom integrations: Stick to out-of-the-box destinations until you really need something Segment doesn’t support.
- GDPR/CCPA compliance: You should care about privacy, but get the basics working before you stress about legal edge cases. Just don’t send PII you don’t need.
Wrapping up: Keep it simple, iterate often
Setting up event tracking in Segment isn’t rocket science, but it can get messy fast if you overdo it. Start with a handful of high-value events. Test them. Make sure they’re actually helping your team answer real questions.
Don’t try to track everything at once. The best SaaS teams keep their analytics lean and useful, not bloated. You can always add more events later—removing junk is way harder.
Get the basics right, and Segment will actually make your analytics life easier, not harder. Good luck.