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

  1. In the Statsig Console, open Project Settings.
  2. Go to Keys & EnvironmentsAPI Keys.
  3. 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

FieldRequiredDescription
Server Secret KeyYesYour 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_event

Authentication 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 sourceStatsig fieldNotes
user_iduser.userIDPrimary identifier; required for user-level joins.
anonymous_iduser.customIDs.stableIDStable pseudonymous ID for pre-login attribution.
email (trait)user.emailSent as a plain attribute — Statsig does not require hashing.
context.ipuser.ipUsed by Statsig for geo enrichment.
context.user_agentuser.userAgentDevice/browser enrichment.
context.localeuser.localeLanguage/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 eventStatsig event name
pagepage_view
Signed Upsign_up
Logged Inlogin
Products Searchedsearch

Retail preset

Signal eventStatsig event name
pagepage_view
Products Searchedsearch
Product Viewedview_item
Product Addedadd_to_cart
Checkout Startedbegin_checkout
Order Completedpurchase

Testing

  1. Publish a pipeline with Statsig attached and trigger a test event from your site.
  2. In Signal, open the Event Debugger and confirm the Statsig delivery returns 202 with {"success": true}.
  3. In the Statsig Console, open MetricsEvents Explorer and confirm the event appears (allow a short processing delay).
  4. Confirm the event’s user is resolved on the Users view using the userID you 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_id is populated so user.userID is 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 value field. Confirm revenue is mapped to value on your purchase event and is numeric.
  • Wrong event timetime must be unix milliseconds. The blueprint applies an epoch_millis transform on timestamp; don’t override it with a seconds or microseconds value.
  • Metadata values look stringified — Statsig metadata is a string map; numeric custom properties may be coerced to strings. Use the value field for numeric metrics.