Statsig's Segment integration empowers you to leverage your existing Segment events for experimentation and analysis. By connecting Segment to Statsig, you can seamlessly ingest events and utilize them in your feature gates and experiments. This integration streamlines your experimentation workflow, eliminating the need for additional event logging.
The Segment integration consists of three key components:
Inbound events: Statsig ingests events from your Segment sources, making them available for analysis and experimentation.
User mapping: Map Segment user IDs and custom identifiers to Statsig, enabling targeted experimentation and segmentation.
Outbound events: Export Statsig events back to Segment for further analysis and integration with other tools.
Leveraging the Segment integration allows you to tap into your existing event data, unlocking powerful experimentation capabilities. You can easily incorporate Segment events into your feature gates and experiments, enabling data-driven decision-making and optimization. This integration saves time and effort by eliminating the need for duplicate event logging and simplifying your experimentation setup.
Setting up the Segment integration is a straightforward process. You can configure inbound events using OAuth for a seamless setup or follow the manual configuration steps for custom implementations. Statsig provides detailed documentation and guides to help you get started quickly.
To set up inbound events from Segment to Statsig, you have two options:
OAuth configuration: The easiest way to connect Segment to Statsig is through OAuth. Simply follow the OAuth flow in the Statsig console to grant access to your Segment sources.
Manual configuration: If you prefer a manual setup, you can configure the Statsig destination in your Segment account. Provide your Statsig server SDK key and select the desired sources to send data to Statsig.
Once the integration is enabled, you can configure event filtering and map additional identifiers to customize your event ingestion.
Mapping user IDs and custom identifiers is crucial for targeted experimentation and segmentation. Statsig automatically detects the userId
field from your Segment events. If you're using custom IDs, you can pass them using the statsigCustomIDs
property in your Segment events.
Statsig also supports syncing Segment Engage Audiences with Statsig Segments. This allows you to maintain user lists for targeting with Statsig feature flags. Additionally, you can pass custom properties using the statsigCustom
property in Segment events, enabling cohort-based targeting in your experiments.
Statsig offers two methods for configuring inbound events from Segment: OAuth and manual configuration. The OAuth process simplifies setup by automatically connecting your Segment workspace and sources to Statsig. For custom implementations, manual configuration allows you to provide a Statsig Server SDK key and map additional identifiers.
After enabling the integration, you can configure event filtering to control which events are ingested and make billing more predictable. This is particularly useful for mapping device-level identifiers and anonymousIds generated from Segment. It's recommended to create a custom ID called segmentAnonymousId
and map the anonymousId
from Segment to it.
Statsig automatically detects the event
and userId
fields logged through your Segment events. If you're running an experiment with the userId
as your unit type, ensure this userID
matches the user identifier logged with the Statsig SDK. For experiments using a custom ID as the unit type, provide the identifier using the key statsigCustomIDs
in the Segment properties field.
The Segment integration also enables syncing Segment Engage Audiences with Statsig Segments. By creating a Statsig ID List Segment and configuring a Segment Audience with Statsig as the destination, you can maintain user lists for targeting with Statsig Feature Flags. This powerful combination allows for precise experimentation based on custom audience definitions.
To target specific user cohorts in feature gates and experiments, pass custom properties through Segment using the key statsigCustom
in the properties field. These properties will be available for targeting users in your Statsig configurations. By leveraging Segment's rich user data, you can create highly targeted experiments and feature rollouts.
Statsig's metrics console automatically ingests your Segment events, making them readily accessible for analysis. You can easily incorporate these events into your feature gates and experiments, enabling you to measure the impact of your changes on key metrics.
By using Segment events in Statsig, you can gain valuable insights into how your features and experiments affect user behavior and business outcomes. This integration streamlines the process of collecting and analyzing data, allowing you to make data-driven decisions more efficiently.
Statsig provides flexibility in customizing event ingestion through filtering, allowing you to control which Segment events are sent to Statsig. This helps manage data volume and ensures that only relevant events are used in your analyses.
You can also differentiate event traffic by specifying environments, such as production, staging, or development. This allows you to separate non-production data from your production metrics, ensuring the accuracy and reliability of your results.
For more detailed information on setting up and using the Segment integration with Statsig, refer to the following resources:
Statsig documentation on Segment integration: This comprehensive guide covers the step-by-step process of enabling the Segment integration, configuring event filtering, and leveraging Segment data in your experiments.
Segment's guide on Statsig destination setup: This resource provides instructions on setting up Statsig as a destination in your Segment account, ensuring that your events are properly sent to Statsig for analysis.
By leveraging these resources, you can effectively integrate Segment data into your Statsig workflows, unlocking powerful insights and optimizing your feature rollouts and experiments.