Send the feature and experiment activity your customers generate in Statsig, plus the custom events you log there, to Iterable as events. Use that activity to build segments, trigger campaigns, and personalize messages.
# In this article
# How the integration works
Iterable gives you a webhook URL. You add this URL to Statsig's Generic Webhook integration, and Statsig sends exposures and the custom events you log to it in batches. Iterable doesn't call Statsig, so the only Statsig value you enter in Iterable is the webhook signing secret.
Iterable checks the signature on each delivery with your Statsig signing secret and rejects deliveries that fail the check. For each event in a verified delivery, it:
- Matches the event to an Iterable user by the identifier you choose in Identity Mapping. See How users are matched.
- For an exposure, updates the user's Statsig profile fields and, depending on Exposure Event Cadence, tracks an exposure event. See When exposure events are tracked.
- For a custom event, tracks a
statsig_<eventName>event.
Anonymous exposures that have only a device ID don't reach Iterable, because the integration needs a user identifier to match them.
| Statsig data | Iterable profile field | Iterable event |
|---|---|---|
| Custom event | None | statsig_<eventName> |
| Dynamic config exposure | statsigConfigs | statsigConfigExposure |
| Experiment or layer exposure | statsigExperiments | statsigExperimentAssigned |
| Feature gate exposure | statsigGates | statsigGateExposure |
A layer exposure counts as an exposure to the experiment the user is allocated to in that layer. A dynamic config exposure that includes an experiment group counts as an experiment exposure. For the fields the integration sets, see User profile fields and the event sections that follow it.
# How users are matched
Identity Mapping on the Settings page sets how the integration identifies users in Iterable. The integration doesn't use the Primary Identifier on the Iterable connection.
| Identity Mapping | Statsig identifier | Iterable identifier | Supported Iterable project types |
|---|---|---|---|
Email (Statsig user.email) | The user's email
|
email, plus userId when Statsig sends a user ID* | Hybrid, email-based |
User ID (Statsig customIDs Key) | A key in the user's customIDs
| userId | Hybrid, userID-based |
User ID (Statsig userID) | The user's userID
| userId | Hybrid, userID-based |
* In a hybrid project, userId must also be unique. If another Iterable user
already has that userId, Iterable rejects the update. The integration then
sends it again without userId, so the Statsig fields still reach the user who
has the matching email address.
Choose the Identity Mapping option that matches how your existing Iterable users are identified:
Select User ID (Statsig
userID) if your users'userIdvalues are the same IDs you set asuserIDin Statsig. The integration skips events without auserID. Not available for email-based projects.Select User ID (Statsig
customIDsKey) if your users'userIdvalues are stored under a key in the Statsig user'scustomIDs, such asaccountID. Enter that key in StatsigcustomIDsKey. The integration skips events whose user doesn't have that key. Not available for email-based projects.Select Email (Statsig
user.email) if your users are identified byemail. The integration matches users by theemailin the Statsig user object and skips events without one. When Statsig also sends auserID, the integration adds it to the profile asuserId. In an email-based project, the StatsiguserIDreplaces any user ID that the user already has. Not available for userID-based projects.
The integration doesn't fall back to another identifier. It skips an event without the identifier you chose, so it never matches the event to the wrong user.
If the Statsig user isn't in Iterable yet, an exposure creates the user in every project type. A custom event creates the user in hybrid and userID-based projects, but not in email-based projects.
To learn more about project types, read Project Types and Unique Identifiers.
# Statsig customIDs Key
The Statsig customIDs Key setting on Settings names the key in the
Statsig user's customIDs that holds the Iterable user ID, such as
accountID. The default is accountID. The integration uses this setting only
with User ID (Statsig customIDs Key). With the other mappings, leave the
default.
# When exposure events are tracked
Exposure Event Cadence sets when an exposure also tracks an Iterable event. The integration updates profile fields on every exposure, whichever cadence you choose.
- Only on First Exposure or Change: The integration tracks an event the first time a user sees a gate, config, or experiment. It tracks another event when the gate value, the config rule, or the experiment group changes. A repeated exposure with no change doesn't create a new event.
- Every Exposure: The integration tracks an event for every exposure that Statsig sends.
Repeated gate and config exposures can start a journey again. The journey's entry limits still apply.
Custom events are always tracked, one Iterable event for each Statsig event.
# What isn't synced
The integration doesn't sync:
- Statsig config changes, the change log of your Statsig console. The integration ignores them even if you select Config Changes in Statsig.
- Events without the identifier you chose in Identity Mapping, such as exposures from users who are identified only by a device ID.
- Layer exposures that Statsig doesn't link to an experiment.
# Connection requirements
To connect Iterable with Statsig, you need:
- A Statsig project that can send events through Statsig's Generic Webhook integration. Statsig allows one data connection per project. If your project already exports to another destination, check with Statsig that you can add the Generic Webhook.
- A server-side API key for the Iterable project that receives the data.
- A field to identify the user that matches in Iterable:
- When you match users by email, an email address on every Statsig user.
- When you match users by user ID, a
userIDthat matches your Iterable user IDs (or acustomIDskey that holds the Iterable user ID) on every Statsig user.
# Connecting Statsig to Iterable
In Iterable, go to Integrations > Integrations Hub.
Find Statsig, select Connect, and then select Add Connection.
On Connections, enter your Iterable API key. (The integration doesn't use the connection's Primary Identifier. You choose how users are matched with Identity Mapping on Settings.)
-
On Configure Statsig, copy the webhook URL. Then, in Statsig:
- Open Project Settings > Integrations.
- Enable the Generic Webhook integration.
- Paste the webhook URL as the destination URL and select Enable. Statsig verifies the URL when you save.
- Under Event Filtering, select Exposures. This includes the custom events you log.
- Leave Config Changes unselected. The integration ignores them.
- Copy the signing secret from the Generic Webhook card. You paste it on the next page.
-
On Settings:
- Under Statsig Webhook Signing Secret, paste the signing secret from Statsig. The integration rejects deliveries until you enter it.
- Under Identity Mapping, choose how Statsig users are matched to
Iterable users: Email (Statsig
user.email), User ID (StatsiguserID), or User ID (StatsigcustomIDsKey). The default is Email (Statsiguser.email). See How users are matched. - Under Statsig
customIDsKey, enter the key in the Statsig user'scustomIDsthat holds the Iterable user ID. The default isaccountID. See StatsigcustomIDsKey. - Under Exposure Event Cadence, choose when to track an exposure as an Iterable event: Only on First Exposure or Change or Every Exposure. The default is Only on First Exposure or Change. See When exposure events are tracked.
Select Finish.
In your app, trigger a feature gate check or an experiment exposure for a test user who has the identifier you chose in Identity Mapping. In Iterable, open that user's profile and confirm that it has a
statsigGatesorstatsigExperimentsfield and astatsigGateExposureorstatsigExperimentAssignedevent.
# User profile fields
On every exposure, the integration sets the following fields on the user's
profile. It merges them with the Statsig fields already on the profile, so
entries for other gates, configs, and experiments stay. If you map users by
email, it also sets userId. See
How users are matched.
In field names, <config>, <experiment>, and <gate> stand for the Statsig
name, with spaces, hyphens, and periods replaced by underscores. For example, a
gate named new-checkout is stored under statsigGates.new_checkout.
| Field | Type | Description |
|---|---|---|
statsigConfigs.<config>.exposedAt | date | When the user was last exposed to the dynamic config. |
statsigConfigs.<config>.ruleId | string | The ID of the Statsig rule the user matched. |
statsigExperiments.<experiment>.exposedAt | date | When the user was last exposed to the experiment. |
statsigExperiments.<experiment>.group* | string | The experiment group the user is in. |
statsigExperiments.<experiment>.ruleId | string | The ID of the Statsig rule the user matched. |
statsigGates.<gate>.exposedAt | date | When the user was last exposed to the feature gate. |
statsigGates.<gate>.ruleId | string | The ID of the Statsig rule the user matched. |
statsigGates.<gate>.value | boolean |
true if the gate passed for the user, false if it didn't. |
statsigLastExposedAt | date | When the user was last exposed to any gate, config, or experiment, as of the most recent delivery from Statsig. A delivery that arrives late with older exposures can set an earlier time. |
* The integration sets group only when Statsig includes the group name on
the exposure. ruleId still identifies the group.
# Statsig events synced to Iterable
The integration tracks the following custom events.
The integration syncs these events automatically. You don't choose which events sync in Iterable. The events that reach Iterable are the ones Statsig sends to the webhook, which you control with Event Filtering in Statsig. Exposure events also follow your Exposure Event Cadence setting.
# statsigConfigExposure event
Each statsigConfigExposure event has the following fields:
| Field | Type | Description |
|---|---|---|
configName | string | The dynamic config's name in Statsig. |
exposedAt | date | When the exposure happened. |
reason | string | Statsig's evaluation reason, when Statsig includes it. |
ruleId | string | The ID of the Statsig rule the user matched. |
statsigEventId | string | Statsig's ID for the exposure. |
statsigUserId | string | The Statsig userID, when Statsig includes it. |
unitIdType | string | The ID type the exposure is keyed on, such as userID or stableID. |
# statsigExperimentAssigned event
Each statsigExperimentAssigned event has the following fields:
| Field | Type | Description |
|---|---|---|
experimentName | string | The experiment's name in Statsig. |
exposedAt | date | When the exposure happened. |
groupName | string | The experiment group the user is in, when Statsig includes it. |
layerName | string | The Statsig layer, for an experiment in a layer. |
reason | string | Statsig's evaluation reason, when Statsig includes it. |
ruleId | string | The ID of the Statsig rule the user matched. |
statsigEventId | string | Statsig's ID for the exposure. |
statsigUserId | string | The Statsig userID, when Statsig includes it. |
unitIdType | string | The ID type the exposure is keyed on, such as userID or stableID. |
# statsigGateExposure event
Each statsigGateExposure event has the following fields:
| Field | Type | Description |
|---|---|---|
exposedAt | date | When the exposure happened. |
gateName | string | The feature gate's name in Statsig. |
gateValue | boolean |
true if the gate passed for the user, false if it didn't. |
reason | string | Statsig's evaluation reason, when Statsig includes it. |
ruleId | string | The ID of the Statsig rule the user matched. |
statsigEventId | string | Statsig's ID for the exposure. |
statsigUserId | string | The Statsig userID, when Statsig includes it. |
unitIdType | string | The ID type the exposure is keyed on, such as userID or stableID. |
# statsig_<eventName> events
Each custom event you log to Statsig becomes an Iterable event named
statsig_ plus the Statsig event name, with spaces, hyphens, and periods
replaced by underscores. For example, a Statsig event named add to cart
becomes statsig_add_to_cart.
Each statsig_<eventName> event has the following fields:
| Field | Type | Description |
|---|---|---|
| Metadata keys | varies | One field for each key in the event's Statsig metadata, with spaces, hyphens, and periods in the key replaced by underscores. |
statsigEventId | string | Statsig's ID for the event. |
statsigUserId | string | The Statsig userID, when Statsig includes it. |
value | string or number | The event's value in Statsig, when it has one. |
# Troubleshooting
# Nothing from Statsig appears in Iterable
Check the following:
- In Statsig, save the Generic Webhook card again so Statsig verifies the webhook URL again. You can also check deliveries with Statsig's webhook Debug tool.
- Under Event Filtering on the Generic Webhook card, confirm that Exposures is selected.
- Confirm that the signing secret in Iterable matches the one on the Generic Webhook card. The integration rejects deliveries when the secret is missing or doesn't match. To update it, see Statsig deliveries are rejected.
# Statsig deliveries are rejected
The integration rejects a delivery when the signing secret is missing or doesn't match the one on Statsig's Generic Webhook card.
- In Statsig, copy the signing secret from the Generic Webhook card.
- In Iterable, go to Integrations > Integrations Hub and open the Statsig page.
- Open the connection's menu and select Open Configuration.
- On Settings, paste the secret under Statsig Webhook Signing Secret, and then select Finish.
# Some users' exposures don't appear in Iterable
The integration skips events that don't have the identifier you chose in
Identity Mapping, such as exposures from anonymous users who have only a
device ID. Confirm that your app sets that identifier on the Statsig user. If
you map users by a customIDs key, confirm that Statsig customIDs Key
matches the key name in the Statsig user's customIDs.
# An experiment field has no group
Statsig didn't include the group name on the exposure. The integration still
sets ruleId, which identifies the group, and uses it to detect group changes.
# The Statsig user ID is missing from a profile
If you map users by email, the integration adds the Statsig userID to the
profile as userId. If another Iterable user already has that userId,
Iterable rejects it. The integration then updates the profile without userId,
so the Statsig fields still arrive.