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.
Why route Statsig through Datafly Signal
- Your numbers stop depending on what the browser allows. Client-side analytics loses every visit where the tag is blocked or the page unloads early. Signal delivers from the server, so Statsig receives the complete event stream.
- Client IP and user agent are carried in the payload. Both are taken from the original visitor request rather than your server, which is what Statsig needs to attribute the event to the right session.
- Delivery is batched, rate-limited, and retried. Signal buffers to Kafka, respects the Statsig rate limit, and retries on 429 or transient failure rather than dropping the event.
- Presets for Default and Retail. The mapping starts from a working configuration for your vertical instead of a blank field map.
- One consent decision governs every destination. Statsig is gated by the same consent state as the rest of your stack, so a withdrawal applies everywhere at once.
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 on each event. log_event requires only eventName; the user fields are optional, so anonymous events are delivered too.
| Signal source | Statsig field | Notes |
|---|---|---|
user_id | user.userID | The signed-in user. Use the ID your Statsig SDK evaluates with, or experiment metrics will not join. |
collected statsig_stable_id, else anonymous_id | user.customIDs.stableID | Configure a collected ID named statsig_stable_id (the Statsig SDK’s stable ID) to join anonymous events to the SDK’s exposures. |
context.ip | user.ip | Geo enrichment. |
context.user_agent | user.userAgent | Device and browser. |
context.locale | user.locale | Language and region. |
No personal data is sent: log_event does not need an email, so user.email is not mapped. Add it on the installed integration only where you have a lawful basis. Statsig has no consent field.
Event Mapping
Event names are Signal’s canonical names (see the event specs). value carries the monetary value (value, or the legacy revenue); every other documented property is event metadata, with currency upper-cased and items as a JSON string. time is the event time in epoch milliseconds. Only mapped properties reach metadata.
{
"events": [
{
"eventName": "purchase",
"value": 89.99,
"time": 1717628400000,
"user": {
"userID": "user-123",
"ip": "203.0.113.10",
"userAgent": "Mozilla/5.0 ...",
"locale": "en-US",
"customIDs": { "stableID": "a1b2c3d4-..." }
},
"metadata": {
"transaction_id": "ORD-1234",
"currency": "USD",
"coupon": "SUMMER10",
"items": "[{\"item_id\":\"SKU-A\",\"price\":89.99,\"quantity\":1}]"
}
}
]
}| Preset | Events |
|---|---|
| Default | page (as page_view), sign_up, login, search, view_item, add_to_cart, begin_checkout, purchase, refund, generate_lead, subscription_started, subscription_cancelled |
| Retail | page_view and the full ecommerce spec |
| B2B / SaaS | page_view and the full SaaS spec |
| Insurance | page_view and the full insurance spec |
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 — The event carried no
user_id. Anonymous events are joined bycustomIDs.stableID, which only matches your SDK’s exposures when you collect the SDK’s stable ID asstatsig_stable_id. - Revenue metric is empty — Statsig revenue metrics read the event
valuefield, which the presets fill fromvalue(or the legacyrevenue). - Wrong event time —
timemust be unix milliseconds; the presets send the event time in milliseconds. - Metadata values look stringified — Statsig
metadatais a string map; numeric custom properties may be coerced to strings. Use thevaluefield for numeric metrics.