Statsig
Datafly Signal delivers events to Statsig server-to-server using the Events HTTP API (log_event). Signal builds a Statsig user object and logs custom events directly to Statsig’s ingestion endpoint, so your product-analytics, experiment, and feature-flag metrics are populated without a browser SDK and without being affected by ad blockers or tracking prevention.
Prerequisites
Before configuring Statsig in Signal, you need a Statsig account and a Server Secret Key.
Create a Statsig project
If you don’t already have one, sign up at statsig.com and create a project.
Get your Server Secret Key
- In the Statsig Console, open Project Settings.
- Go to Keys & Environments → API Keys.
- Copy the Server Secret Key (it starts with
secret-).
Use the Server Secret Key, not a Client SDK Key or a Console API key. The Server Secret Key is the correct credential for backend log_event ingestion. Treat it as a secret — never expose it in client-side code.
Configuration
| Field | Required | Description |
|---|---|---|
| Server Secret Key | Yes | Your Statsig Server Secret Key (secret-...). Sent on every request in the statsig-api-key header. |
Configure in Signal
Add the Statsig integration
In your Signal management UI, open Integrations, choose Statsig, and select the Default (or Retail) preset.
Paste your Server Secret Key
Enter the Server Secret Key into the Server Secret Key field and save.
Attach the integration to a pipeline
Add Statsig as a destination on the pipeline that handles the events you want to forward, then publish the pipeline.
API Endpoint
Signal delivers to the Statsig Events HTTP API:
POST https://events.statsigapi.net/v1/log_eventAuthentication is via the statsig-api-key request header. A successful request returns HTTP 202 with {"success": true}. Events are batched into a single events array per request.
Identity Signals
Statsig joins events to a user via the Statsig user object. Signal maps the following identity fields onto each event’s user:
| Signal source | Statsig field | Notes |
|---|---|---|
user_id | user.userID | Primary identifier; required for user-level joins. |
anonymous_id | user.customIDs.stableID | Stable pseudonymous ID for pre-login attribution. |
email (trait) | user.email | Sent as a plain attribute — Statsig does not require hashing. |
context.ip | user.ip | Used by Statsig for geo enrichment. |
context.user_agent | user.userAgent | Device/browser enrichment. |
context.locale | user.locale | Language/region. |
Marketing consent is forwarded as a custom attribute (user.custom.marketing_consent = granted / denied) so you can segment on it in Statsig.
Statsig has no fixed event taxonomy — event names are freeform. Signal sends GA4-style snake_case names (page_view, sign_up, view_item, add_to_cart, purchase). You can rename them per event in the blueprint editor.
Event Mapping
Custom event properties land in the Statsig event’s metadata object, and revenue lands on the Statsig value field. The event timestamp is sent as time in unix milliseconds.
For example, this Datafly.js call:
datafly.track('Order Completed', {
order_id: 'ORD-1234',
revenue: 89.99,
currency: 'USD',
coupon: 'SUMMER10'
});is delivered to Statsig as:
{
"events": [
{
"eventName": "purchase",
"value": 89.99,
"time": 1717628400000,
"user": {
"userID": "user-123",
"email": "jane@example.com",
"ip": "203.0.113.10",
"userAgent": "Mozilla/5.0 ...",
"locale": "en-US",
"customIDs": { "stableID": "a1b2c3d4-..." },
"custom": { "marketing_consent": "granted" }
},
"metadata": {
"order_id": "ORD-1234",
"currency": "USD",
"coupon": "SUMMER10"
}
}
]
}Default preset
| Signal event | Statsig event name |
|---|---|
page | page_view |
Signed Up | sign_up |
Logged In | login |
Products Searched | search |
Retail preset
| Signal event | Statsig event name |
|---|---|
page | page_view |
Products Searched | search |
Product Viewed | view_item |
Product Added | add_to_cart |
Checkout Started | begin_checkout |
Order Completed | purchase |
Testing
- Publish a pipeline with Statsig attached and trigger a test event from your site.
- In Signal, open the Event Debugger and confirm the Statsig delivery returns
202with{"success": true}. - In the Statsig Console, open Metrics → Events Explorer and confirm the event appears (allow a short processing delay).
- Confirm the event’s user is resolved on the Users view using the
userIDyou sent.
Troubleshooting
401 / 403 Unauthorized — The statsig-api-key is missing, invalid, or the wrong key type. Confirm you pasted a Server Secret Key (secret-...), not a Client SDK Key or Console API key.
- Event logs but no user shows — Ensure
user_idis populated souser.userIDis set; without a stable identifier Statsig can log the event but cannot tie it to a user. - Revenue metric is empty — Statsig revenue metrics read the event
valuefield. Confirmrevenueis mapped tovalueon your purchase event and is numeric. - Wrong event time —
timemust be unix milliseconds. The blueprint applies anepoch_millistransform ontimestamp; don’t override it with a seconds or microseconds value. - Metadata values look stringified — Statsig
metadatais a string map; numeric custom properties may be coerced to strings. Use thevaluefield for numeric metrics.