> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hightouch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Statsig

> Sync to Statsig segments and events from your warehouse to analyze product performance and run experiments.

## Overview

Sync to segments and events from your warehouse to Statsig to analyze product performance and run experiments.

## Supported syncing

| Type | Description | Supported Sync Modes |
| - | - | - |
| **Segments** | Sync data from any source to segments in Statsig | Add, Remove |
| **Events** | Sync data from any source to log events in Statsig | Insert |

For more information about sync modes, refer to the [sync modes](https://docs.hightouch.com/syncs/types-and-modes.md#sync-modes) docs.

## Connect to Statsig

Go to the [**Destinations** overview page](https://app.hightouch.com/destinations?from=docs) and click the **Add destination**
button. Select **Statsig** and click **Continue**. You can then authenticate Hightouch to **Statsig** by entering your credentials.

Enter the following fields into Hightouch based on the types of syncs you plan on creating:

* **Console API key**: required for syncing segments
* **Client-SDK API key**: required for syncing events

You can find these API keys in the **Keys & Environments** section on your Statsig settings page. Check out Statsig's [Console API docs](https://docs.statsig.com/console-api/introduction) and [HTTP API docs](https://docs.statsig.com/http-api) for more information about how to create and access these keys.

## Sync configuration

Once you've set up your Statsig destination and have a [model](https://docs.hightouch.com/getting-started/concepts.md#models) to pull
data from, you can set up your sync configuration to begin syncing data. Go to the [**Syncs** overview
page](https://app.hightouch.com/syncs?from=docs) and click the **Add sync** button to begin. Then, select the relevant model and
the Statsig destination you want to sync to.

### Segments

Sync data from any source to Statsig [segments](https://docs.statsig.com/console-api/segments). Hightouch only supports syncing to the ID list segment type.

#### Record matching

Hightouch matches rows from your model to Statsig segments by segment **id**. Select the model column that contains these values.

#### Create a segment

To create a new segment list, select **Create a new audience**. You can provide a name for this segment, or Hightouch defaults to the name of the model used to create the sync.

Then, select the **ID type** of the segment list you want Hightouch to create. Hightouch supports user ID and stable ID types.
You can change the ID type to a [custom ID](https://docs.statsig.com/guides/experiment-on-custom-id-types) on the segment's page in Statsig.

![Editing ID type in Statsig](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-statsig-edit-type.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=893e19db3d6b24a0deb18099e74f7fbf)

#### Use an existing segment

To use an existing segment list, select **Use existing segment**. You can select any of your existing Statsig segments from the drop-down select menu. All available options are of the **ID list** type.

### Events

Sync data from any source to [events](https://docs.statsig.com/guides/logging-events) in Statsig.

> [!NOTE]
>
> Statsig's [event explorer](https://docs.statsig.com/events-explorer) requires you to be on a [Pro Plan](https://www.statsig.com/pricing). You won't be able to view events you send via Hightoucht in the Statsig app without it.

#### Event name

Providing an event name is required to log an event in Statsig. You can either provide a static value or select to **use a column** from your model.

#### Event timestamp

You can optionally select a column that contains timestamps of when events occurred. If this field is empty, Hightouch uses the time the event arrives at the server.

Hightouch converts any `DateTime` values from your source to Unix timestamp as expected by Statsig.

#### Field mapping

You can sync columns from your source to different event and user attributes in the mappings section.

## Tips and troubleshooting

To see the exact API requests and responses from each sync run, use the [live debugger](https://docs.hightouch.com/syncs/debugger.md). To get notified by Slack, PagerDuty, SMS, or email when a sync fails, set up [sync alerts](https://docs.hightouch.com/syncs/alerting.md). If you run into an issue this page doesn't cover, [contact support](#pylon-chat).

### Rate limits

Statsig has a default rate limit of 10 requests/second and 4500 request/15 minutes on Console API. If you're syncing segments and run into a rate limit error, [schedule](https://docs.hightouch.com/syncs/schedule-sync-ui.md) your sync to run less frequently or [get in touch](#pylon-chat).

### Live debugger

Hightouch provides complete visibility into the API calls made during each of your sync runs. We recommend reading our
[article on debugging tips and tricks](https://docs.hightouch.com/syncs/debugger.md) to learn more.
