You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/experiments-plus/create-new.md
+5
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,11 @@ last_update:
8
8
date: 2025-03-04
9
9
---
10
10
11
+
12
+
:::tip[Warehouse Native users]
13
+
You're viewing the Cloud docs for this page. Metrics and experiments behave differently in Warehouse Native. Read about [Configuring Experiments in Warehouse Native](/statsig-warehouse-native/features/experiment-options).
14
+
:::
15
+
11
16
This guide walks you through the steps to create and configure a new experiment in Statsig. Whether you're running a simple A/B test or a more complex multi-variant experiment, these instructions will help you set up your experiment correctly.
Statsig is the complete platform for product growth, empowering your team to build and innovate like the best tech companies in the world.
18
-
19
-
<LandingResources />
20
-
You can use Statsig’s products directly with your own data warehouse through [Warehouse Native](/statsig-warehouse-native/introduction). This allows you to leverage Statsig’s features while keeping data in your existing infrastructure.
25
+
Statsig empowers you to ship, measure, and learn from your releases using the same tools as the best tech companies in the world. With Statsig, you can run thousands of A/B tests, safely rollout features, and dive deep on core business metrics and user behavior—all on a single, unified platform.
Statsig supports over **30 SDKs and frameworks**, allowing you to quickly integrate with your application, whether you’re building for the web, mobile, or server environments. Follow these simple steps to get started in minutes:
24
-
## Add Statsig to Your Website (JavaScript Snippet)
25
75
26
-
The easiest way to get up and running is by adding the Statsig JavaScript snippet to your website. This setup takes just a few seconds:
76
+
## Key Features
27
77
28
-
Paste the following code into the `<head>` section of your website, replacing `"YOUR_CLIENT_KEY"` with your project’s **Client API Key**, which you can find in the [Statsig Console](https://console.statsig.com/api_keys).
You can use Statsig's products directly with your own data warehouse through [Warehouse Native](/statsig-warehouse-native/introduction). This allows you to leverage Statsig's features while keeping data in your existing infrastructure.
33
81
34
-
Once installed, you’ll be able to:
35
-
- Start **recording events**.
36
-
- Use **session replays**.
37
-
- Leverage Statsig’s **experiments** and **feature flags** right away.
82
+
---
38
83
39
84
## Explore SDKs
40
85
41
86
For greater control, Statsig offers SDKs for a wide variety of platforms, including JavaScript, Python, iOS, Android, and more. Select the SDK that fits your project and follow the installation guide:
42
87
43
88
<SDKAndFrameworks />
44
89
45
-
-If you don’t see the SDK or framework you need, feel free to reach out directly in our [Slack Community](https://statsig.com/slack).
90
+
If you don't see the SDK or framework you need, feel free to reach out directly in our [Slack Community](https://statsig.com/slack).
46
91
47
92
---
48
-
49
-
## Learn More and Get Help
50
-
51
-
Resources to help you make the most of Statsig:
52
-
93
+
# Learning Resources
94
+
-**Videos**: Check out our full library of [Statsig Onboarding Training Videos](https://www.youtube.com/playlist?list=PLNJ9pKAaib3J0fYyCYRX3JhtSpwtiEL0Q) on Youtube.
53
95
-**Community**: Join our [Slack Community](https://statsig.com/slack) to connect with other users and get help from the Statsig team.
54
96
-**Blog**: Stay updated with the latest developments in product experimentation and feature management on our [Blog](https://statsig.com/blog).
This tutorial walks you through how to create your first Feature Gate in Statsig from end to end. Feature Gates, also known as feature flags, are a way to safely control the rollout of new features to your users without deploying additional code. Common examples for using Feature Gates include shipping new UI elements, API endpoints, or product features.
12
+
13
+
By the end of this tutorial, you will have set up:
14
+
* A **Feature Gate** in the Statsig console
15
+
* A **targeting rule** to enable the feature for a segment of Users
16
+
* A **client-side integration** using the Statsig Client SDK
17
+
18
+
19
+
## Prerequisites
20
+
1. A [Statsig account](https://console.statsig.com/sign_up)
21
+
2. An existing application you can integrate the Statsig Client SDK into
22
+
23
+
## Part 1: Create a Feature Gate in the console
24
+
For the purposes of this tutorial, we will pretend we are adding a Feature Gate to deploy a new UI element to a user with the "statsig.com" email domain. You can follow along with a specific feature if you have your own scenario in mind.
25
+
26
+
1. Navigate to [Feature Gates](https://console.statsig.com/gates) in the Statsig console.
2. Then, click on **Get Started** if you don't have any Feature Gates set up yet, or **Create** to create a new one.
31
+
32
+
3. Name your gate "Example Gate". This name will also be used to identify the Feature Gate later using the SDK.
33
+
34
+
4. Enter a description for your Feature Gate. It's good practice to describe it in a way that other teammates can easily understand. For example: "This Feature Gate is for launching an example feature for Statsig employees only."
35
+
36
+
37
+
## Part 2: Configure targeting rules
38
+
In Statsig, when you create a Feature Gate, they are enabled by default. In other words, all users will be excluded from the feature until you add a rule that lets users "pass" the gate.
39
+
40
+
This means that in order to actually turn on this feature, you will need to add rules to target this Feature Gate to a specific set of folks. Let's walk through doing this in the console.
41
+
42
+
1. In the console, on the page for the Feature Gate you just created, click on **Add New Rule**.
43
+
44
+

45
+
46
+
2. Give this rule a **Name**, such as "Statsig Users Only".
47
+
48
+
3. Select **Email** as our targeting criteria so we can target users based on their email address.
49
+
50
+
4. In the User section of the dropdown, select the **Any Of (Case Insensitive)** operator, and then add ``statsig.com`` for our email-based user targeting.
51
+
52
+
5. Set the **Pass Percentage** to ``100%``. Doing so ensures that all users with the ``statsig.com`` email domain will pass the Feature Gate and see the new feature.
53
+
54
+
6. Click **Add Rule** to add this rule to your Feature Gate.
55
+
56
+
7. Next, hit **Save** on the bottom right to commit these changes to the Feature Gate.
57
+
58
+
You can now test this feature gate by configuring the User object in the "Test Gate" section.
59
+
60
+
## Part 3: Create a Client API Key
61
+
Now that you've set up the Feature Gate from the console, it's time to integrate it into your product with the Statsig SDK. We'll first need to create a new Client API key to use in our product.
62
+
63
+
1. Navigate to [**Keys & Environments**](https://console.statsig.com/api_keys) in the Statsig console. You can also find this by going to **Settings** at the bottom left of the Statsig console.
64
+
65
+
2. Scroll down to **API Keys**. Click on **Generate New Key**.
66
+
67
+
3. In the dropdown, select **Client**.
68
+
69
+
4. Copy the Client API Key you just created to your clipboard.
70
+
71
+
## Part 4: Integrate the Statsig SDK
72
+
Now that we have our Client API Key, we can go ahead and integrate the Statsig Client SDK into our product. For the purposes of this tutorial, we will use the React SDK, but you can follow along with a different SDK if you prefer.
73
+
74
+
:::tip
75
+
Statsig offers over 20 client and server-side SDKs. Check out the full list of [SDKs](/sdks/client-vs-server#available-sdks) to find the one that best fits your needs.
76
+
:::
77
+
78
+
1. Install the Statsig React SDK using your preferred package manager. For this tutorial, we will use npm.
3. Next, wrap your app's content within the `StatsigProvider` component. In the following code snippet, we're also creating a [User](/concepts/user) object so that we can target our Feature Gate.
4. Make sure to also replace `client-KEY` with the Client API Key you copied in Step 3.
108
+
109
+
## Part 5: Check your Feature Gate
110
+
Finally, you can now evaluate a Feature Gate in your product code by getting the client with the `useStatsigClient` hook, and then calling `checkGate`.
111
+
112
+
1. Add the following code to your `App.js` file. In this snippet, the `example_gate` is the name of the Feature Gate you created in Step 1.
113
+
114
+
```tsx
115
+
const { client } =useStatsigClient();
116
+
return (
117
+
<div>Gate is {client.checkGate('check_user') ?'passing':'failing'}.</div>
118
+
);
119
+
```
120
+
121
+
2. Run your app and see the result! The app should render the text "Gate is passing" since we configured a rule in Part 1 that targets all users with the ``statsig.com`` email domain, and we are using that same email domain in this client's User object.
Copy file name to clipboardExpand all lines: docs/metrics/101.md
+5
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,11 @@ last_update:
10
10
11
11
# Metrics Overview
12
12
13
+
14
+
:::tip[Warehouse Native users]
15
+
You're viewing the Cloud docs for this page. Metrics and experiments behave differently in Warehouse Native. Read more in [Data & Semantic Layer in Warehouse Native](/statsig-warehouse-native/configuration/data-and-semantic-layer).
16
+
:::
17
+
13
18
This 101-level user guide steps through the basic concepts to help you set up essential product metrics in your Statsig Project.
14
19
1.[How Metrics Work on Statsig](/metrics/how-metrics-work)
Copy file name to clipboardExpand all lines: docs/metrics/how-metrics-work.md
+4
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,10 @@ last_update:
10
10
11
11
# How Metrics Work on Statsig
12
12
13
+
:::tip[Warehouse Native users]
14
+
You're viewing the Cloud docs for this page. Metrics and experiments behave differently in Warehouse Native. Read more in [Data & Semantic Layer in Warehouse Native](/statsig-warehouse-native/configuration/data-and-semantic-layer).
15
+
:::
16
+
13
17
A metric in Statsig is a numeric value for each user on a given day. This value can be aggregated across the entire user base or a subset, such as the test or control group of an experiment.
14
18
15
19
For example, say one user made two purchases on September 1st, and another made only one. These values can be aggregated across multiple users to calculate the total number of purchases across all users on September 1st.
0 commit comments