Platform Overview

Learn the core concepts of the Emp-Mix platform: Events, Users, and Sessions.

1. Events

An Event represents any action a user takes within your application. This could be navigating to a page, clicking a button, or completing a purchase.

Every event requires two things:

  • Name: A string identifying the action (e.g., "Signed Up").
  • Properties: A JSON object containing metadata about the action (e.g., { plan: "Pro", revenue: 99.00 }).
ℹ️
Naming Convention
We recommend using an Object-Action naming convention for events (e.g., "Account Created", "Song Played") to maintain consistency as your tracking plan grows.

2. Users (Identity)

Emp-Mix tracks users across anonymous sessions and authenticated states using a distinct_id.

  • Anonymous ID: When a user first visits your app without logging in, the SDK generates a random UUID (stored in localStorage) to track their anonymous events.
  • Identified ID: When a user logs in or signs up, you call the identify() method with their actual database ID. This allows Emp-Mix to tie their past anonymous behavior to their newly identified profile.
⚠️
Crucial Concept: Aliasing
When a user registers for the first time, you must call alias() before calling identify(). This permanently links their anonymous ID to their new database ID. See the User Identification guide for more details.

3. Sessions

A Session is a period of continuous user activity. Emp-Mix SDKs handle session management automatically by generating a session_id.

A session is typically considered "ended" after 30 minutes of inactivity. All events tracked within that window will share the same session_id property.

Best Practices

  • Keep event names simple: Avoid dynamically generated event names (e.g., "Viewed Item 1234"). Instead use "Viewed Item" and pass the ID as a property ({ item_id: "1234" }).
  • Consistency: Ensure that property names are typed consistently (e.g., don't use user_id in one event and userId in another).

Related Documentation

Last updated on June 4, 2026