Segment

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:

  1. Inbound events: Statsig ingests events from your Segment sources, making them available for analysis and experimentation.

  2. User mapping: Map Segment user IDs and custom identifiers to Statsig, enabling targeted experimentation and segmentation.

  3. 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.

Configuring the integration

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.

Setting up inbound events

To set up inbound events from Segment to Statsig, you have two options:

  1. 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.

  2. 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.

Working with users and properties

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.

Setting up inbound events

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.

Working with users and properties

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.

Leveraging Segment data in Statsig

Using Segment events in experiments

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.

Event filtering and environments

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.

Additional resources

For more detailed information on setting up and using the Segment integration with Statsig, refer to the following resources:

By leveraging these resources, you can effectively integrate Segment data into your Statsig workflows, unlocking powerful insights and optimizing your feature rollouts and experiments.

Join the #1 experimentation community

Connect with like-minded product leaders, data scientists, and engineers to share the latest in product experimentation.

Try Statsig Today

Get started for free. Add your whole team!

What builders love about us

OpenAI OpenAI
Brex Brex
Notion Notion
SoundCloud SoundCloud
Ancestry Ancestry
At OpenAI, we want to iterate as fast as possible. Statsig enables us to grow, scale, and learn efficiently. Integrating experimentation with product analytics and feature flagging has been crucial for quickly understanding and addressing our users' top priorities.
OpenAI
Dave Cummings
Engineering Manager, ChatGPT
Brex's mission is to help businesses move fast. Statsig is now helping our engineers move fast. It has been a game changer to automate the manual lift typical to running experiments and has helped product teams ship the right features to their users quickly.
Brex
Karandeep Anand
President
At Notion, we're continuously learning what our users value and want every team to run experiments to learn more. It’s also critical to maintain speed as a habit. Statsig's experimentation platform enables both this speed and learning for us.
Notion
Mengying Li
Data Science Manager
We evaluated Optimizely, LaunchDarkly, Split, and Eppo, but ultimately selected Statsig due to its comprehensive end-to-end integration. We wanted a complete solution rather than a partial one, including everything from the stats engine to data ingestion.
SoundCloud
Don Browning
SVP, Data & Platform Engineering
We only had so many analysts. Statsig provided the necessary tools to remove the bottleneck. I know that we are able to impact our key business metrics in a positive way with Statsig. We are definitely heading in the right direction with Statsig.
Ancestry
Partha Sarathi
Director of Engineering
We use cookies to ensure you get the best experience on our website.
Privacy Policy