Skip to main content
The first step towards building better products is tracking events. As the saying goes, “If you can’t measure something, you can’t understand it. If you can’t understand it, you can’t control it. If you can’t control it, you can’t improve it.” Regardless of if you plan to use Statsig for web or product analytics, or for experimentation, defining the key events and metrics for your product is the best place to start. Event data is consumable in Metrics Explorer, can be turned into custom metrics, visualized in dashboards, and used in experiment results to show the impact of your experiments on the metrics you care about. We try to make this easy in a few ways:
  1. Our web SDKs offer autocaptured web analytics to automatically log common events like pageviews, clicks, and more.
  2. We offer integrations to connect your existing event data in Segment, mParticle, and other sources.
  3. All of our client and server SDKs provide a simple logEvent API to instrument your own events in your app or webserver.
For general guidance on event logging and core concepts, read on or jump to the “Logging events via SDKs” section below.

Identifying Users and the “StatsigUser” object

Many analytics platforms have a concept of “identifying” a user. In Statsig, this is the StatsigUser object that is set a initialization time in client SDKs, or with each event in Server SDKs. The StatsigUser is a set of properties that describe the user. It roughly has the same json definition across all SDKs and integrations:
Size limits on event payload There are limits to how large each event field can be. Object fields have an overall limit of 4096 on its stringified length. String fields have a limit of 64 on its length.
See the SDK reference for more details on logging events in the language of your choice.