Statsig

Send your event data from RudderStack to Statsig.

Statsig helps companies safely A/B test features in production before rolling them out, avoiding product debates and costly mistakes when shipping out new features. Statsig automates the grunt work so that your A/B tests run automatically, and you always get the latest insights into how your product features are performing.

success
Read more about Statsig on their website. For more information on the Statsig-supported data connectors, refer to the Statsig Documentation.

RudderStack supports Statsig as a destination to which you can send real-time event data for efficient A/B testing.

Connection compatibility

Destination info
  • Status: Generally Available
  • Supported sources: Android, iOS , Web, Unity, AMP , Cloud, React Native , Flutter, Cordova, Warehouse, Shopify
  • Refer to it as STATSIG in the Integrations object.

Connection modes
SourceCloud modeDevice modeHybrid mode
AMPsupportednot supportednot supported
Androidsupportednot supportednot supported
Cloudsupportednot supportednot supported
Cordovasupportednot supportednot supported
Fluttersupportednot supportednot supported
iOSsupportednot supportednot supported
React Nativesupportednot supportednot supported
Shopifysupportednot supportednot supported
Unitysupportednot supportednot supported
Warehousesupportednot supportednot supported
Websupportednot supportednot supported
Supported message types
SourceIdentifyPageTrackScreenGroupAlias
Cloud mode
Supported sourcessupportedsupportedsupportedsupportedsupportedsupported

Get started

Once you have confirmed that your source platform supports sending events to Statsig, follow these steps:

  1. From your RudderStack dashboard, add the source. Then, from the list of destinations, select Statsig.
  2. Assign a name to the destination and click Next.

Connection settings

To configure Statsig as a destination in RudderStack, enter the Server Secret Key associated with your project. To obtain the server secret key, follow these steps:

  1. Log into your Statsig console.
  2. Go to your project and click the Settings icon on the top right:
Statsig settings
  1. Finally, click API Keys. You should find the Server Secret Key here.
Statsig API key

Identify

The identify call lets you identify a visiting user and associate them to their actions. It also lets you record the traits about them like their name, email address, etc.

A sample identify call is as shown:

rudderanalytics.identify("1hKOmRA4GRlm", {
  name: "Alex Keener",
  email: "alex@example.com",
})

Retrieving the userId

To get the userId associated with an identified user, you can use the getUserId() method as shown:

rudderanalytics.getUserId();

Retrieving the anonymousId

An anonymous ID (anonymousId) is an autogenerated UUID (Universally Unique Identifier) that is assigned to each unique, unidentified visitor coming to your website.

You can retrieve the anonymousId of any visitor by running the getAnonymousId() method:

rudderanalytics.getAnonymousId();
warning
If the value of anonymousId is null in the SDK, calling the above function will automatically set a new anonymousId in RudderStack.

Page

The page call lets you record your website’s page views with any additional relevant information about the viewed page.

A sample page call is shown below:

rudderanalytics.page("Home")

Track

The track call lets you record the user events, that is, the actions your users perform, along with any properties associated with these actions.

A sample track call is as shown:

rudderanalytics.track("Product Reviewed", {
  review_id: "12345",
  product_id: "123",
  rating: 4.0,
  review_body: "Good product."
})

Screen

The screen call lets you record whenever a user views their mobile screen, with any additional relevant information about the viewed screen.

A sample screen call sent via the iOS SDK is shown below:

[[RSClient sharedInstance] screen:@"Main"
                properties:@{@"prop_key" : @"prop_value"}];

Group

The group call allows you to link an identified user with a group, such as a company, organization, or an account. It also lets you record any custom traits associated with that group, for example, the name of the company, number of employees, etc.

A sample group call is shown below:

rudderanalytics.group("12345", {
  name: "MyGroup",
  industry: "IT",
  employees: 450,
  plan: "basic"
})

Alias

The alias call lets you merge different identities of a known user.

success
alias is an advanced method that lets you change the tracked user’s ID explicitly. This method is useful when managing identities for some of the downstream destinations.

A sample alias call is as shown:

rudderanalytics.alias("12345")

Questions? Contact us by email or on Slack