Skip to main content

Event Tracking

The Solute SDK provides comprehensive event tracking capabilities. Track custom events, page views, user identification, and more.

Track Custom Events

Track any custom event with properties:

Identify Users

Identify users to associate events with specific users:
Call identify() as soon as you know the user’s ID. All subsequent events will be associated with this user.

Track Page Views

Track page views automatically or manually:

Track Groups

Associate users with groups or organizations:

Alias User Identities

Merge anonymous and identified user identities:

Reset User

Reset the user identity (useful on logout):

Flush Events

Force immediate sending of queued events:
Events are automatically flushed based on your queue configuration. You typically don’t need to call flush() manually.

Event Properties

Event properties can include any JSON-serializable data:

Automatic Context

The SDK automatically enriches all events with context:
  • Page information: URL, path, referrer, title
  • User agent: Browser and device information
  • Screen: Screen dimensions and density
  • Locale: User’s locale and timezone
  • Session: Session ID
  • Library: SDK name and version

Next.js Integration

In Next.js, use hooks for event tracking:

Best Practices

Use clear, consistent event names like Button Clicked, Purchase Completed, or User Signed Up. Avoid generic names like click or action.
Add properties that help you understand the context of the event. Include IDs, categories, and any relevant metadata.
Call identify() as soon as you know the user’s ID to associate all events with the user.
Be mindful of privacy. Only track personally identifiable information (PII) if necessary and with user consent.

Next Steps

Feature Flags

Learn about feature flags and A/B testing

Next.js Integration

Deep dive into Next.js integration