Stitch
Connect Stitch with Statsig to ingest events and tables from third-party sources via your warehouse for use in Statsig metrics and experiments.
How the Stitch integration works
Enabling the Stitch integration for Statsig allows Statsig to push events to your Stitch account through a webhook. This allows you to forward Statsig data to any connectors available from Stitch.
Configuring outbound events
- Follow the steps in the Stitch Webhook Setup Guide to create a new Webhook URL.
- On the Statsig Integrations page, enable the Stitch integration by pasting in the Stitch Webhook URL and click Confirm.
Event format
Events are sent in batches in JSON format. Each Statsig event has the following structure:
| Field | Type | Description |
|---|---|---|
| event | String | Name of the event provided |
| user | JSON | Statsig User Object |
| userId | String | User ID provided |
| stableId | String | Stable ID |
| timestamp | Number | Timestamp in MS of the event |
| value | String | Value of the event provided |
| metadata | JSON | Both custom metadata provided and metadata related to the logging of this event added by Statsig |
Custom event formatting - logEvent
json
{
"userId": "a_user",
"stableId": "123",
"timestamp": 1655231253265,
"event": "my_custom_event",
"context": {
"user": {
"userID": "a_user",
"email": "a.user@email.com"
},
"value": "a_custom_value",
"metadata": {
},
"library": {
"name": "statsig",
"version": "1.0"
}
}
}
Feature gate exposure formatting - checkGate
json
{
"userId": "a_user",
"stableId": "123",
"timestamp": 1655231253265,
"event": "statsig::gate_exposure",
"context": {
"user": {
"userID": "a_user",
"email": "a.user@email.com"
},
"value": "",
"metadata": {
"gate": "a_gate",
"gateValue": "false",
"ruleID": "default",
"reason": "Network",
"time": "1655231249644"
},
"library": {
"name": "statsig",
"version": "1.0"
}
}
}
Dynamic config exposure formatting - getConfig
json
{
"userId": "a_user",
"stableId": "123",
"timestamp": 1655231253265,
"event": "statsig::config_exposure",
"context": {
"user": {
"userID": "a_user",
"email": "a.user@email.com"
},
"value": "",
"metadata": {
"config": "a_config",
"ruleID": "default",
"reason": "Network",
"time": "1655231249644"
},
"library": {
"name": "statsig",
"version": "1.0"
}
}
}
Experiment exposure formatting - getExperiment
json
{
"userId": "a_user",
"stableId": "123",
"timestamp": 1655231253265,
"event": "statsig::experiment_exposure",
"context": {
"user": {
"userID": "a_user",
"email": "a.user@email.com"
},
"value": "",
"metadata": {
"config": "an_experiment",
"ruleID": "4SauZJcM1T7zNvh1igBjwE",
"reason": "Network",
"time": "1655231249644",
"experimentGroupName": "Control"
},
"library": {
"name": "statsig",
"version": "1.0"
}
}
}
Filtering events
After you enable outbound events to Stitch, you can select which categories of Statsig events to export by clicking the Event Filtering button and checking the appropriate boxes as shown below.


Was this helpful?