Frequently Asked Questions

A curated summary of the top questions asked on our Slack community, often relating to implementation, functionality, and building better products generally.
Statsig FAQs
vercel Webflow OpenAI Rippling bloomberg Univision Microsoft ea bluesky Brex Flipkart Notion
GENERAL

How can I use `statsig.check_gate` in a Django backend background worker without a current user?

Date of slack thread: 4/25/24

Anonymous: Hi, I’m adding the Python sdk to my Django backend. I want to use statsig.check_gate without the need for passing a user, but a user is required. In this case, the flag is for all users and because the code that is running is in a background worker it doesn’t have a current user. How can I accomplish this?

Statbot: When using statsig.check_gate in a scenario where you do not have a specific user, such as in a background worker, you can pass any non-empty identifier, hard-coded string, or a random ID as the userID. This is because if you are using feature gates to turn on/off a feature for all of your users, or for all users passing certain conditions, the actual user ID is not necessary. However, you cannot target the empty string in the Statsig console. So, you can create a placeholder user with a non-empty identifier to perform the gate check in your background worker (source).

Statbot: Click below to mark as resolved.

Statbot: This thread has been marked as resolved. Press below to re-open.

Tore (Statsig): User is a bit of a misnomer - its really just the evaluation context. The SDK doesnt need any attributes, but some sort of identifier is necesarry for partial rollouts.

If you just want 0/100 gates, that works fine, but if you want to roll out to 10%, we need to know what 10% to evaluate on. So you’d need to provide a user or custom id.

You can learn more here: https://docs.statsig.com/messages/serverRequiredUserID

Join the #1 experimentation community

Connect with like-minded product leaders, data scientists, and engineers to share the latest in product experimentation.

Try Statsig Today

Get started for free. Add your whole team!

Why the best build with us

OpenAI OpenAI
Brex Brex
Notion Notion
SoundCloud SoundCloud
Ancestry Ancestry
At OpenAI, we want to iterate as fast as possible. Statsig enables us to grow, scale, and learn efficiently. Integrating experimentation with product analytics and feature flagging has been crucial for quickly understanding and addressing our users' top priorities.
OpenAI
Dave Cummings
Engineering Manager, ChatGPT
Brex's mission is to help businesses move fast. Statsig is now helping our engineers move fast. It has been a game changer to automate the manual lift typical to running experiments and has helped product teams ship the right features to their users quickly.
Brex
Karandeep Anand
President
At Notion, we're continuously learning what our users value and want every team to run experiments to learn more. It’s also critical to maintain speed as a habit. Statsig's experimentation platform enables both this speed and learning for us.
Notion
Mengying Li
Data Science Manager
We evaluated Optimizely, LaunchDarkly, Split, and Eppo, but ultimately selected Statsig due to its comprehensive end-to-end integration. We wanted a complete solution rather than a partial one, including everything from the stats engine to data ingestion.
SoundCloud
Don Browning
SVP, Data & Platform Engineering
We only had so many analysts. Statsig provided the necessary tools to remove the bottleneck. I know that we are able to impact our key business metrics in a positive way with Statsig. We are definitely heading in the right direction with Statsig.
Ancestry
Partha Sarathi
Director of Engineering
We use cookies to ensure you get the best experience on our website.
Privacy Policy