-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Align Statsig user config to match JS client #58261
Conversation
- Move user_type to user properties - Add enabled_experiments feature Signed-off-by: Nick Lathe <nick.lathe@code.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay- this looks great! @dmcavoy I'm not exactly sure how their metrics will work across client and server side integrations, but I imagine this is the closest we can get. Thanks so much for jumping on this Nick!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually one more thought- don't we have a way to query a user's current experiments from the backend?
Good point, let me look into that. |
It doesn't look like Statsig supports listing experiments, at least for server-side SDKs. It does support Feature Gates. |
I am referring to Code.org experiments here. Perhaps we can discuss offline? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks!
Could you link in this PR where the front-end wrapper is defined?
I'm curious to compare both.
@mgc1194 Statsig wrapper, implemented in the AnalyticsReporter |
In an effort to align the backend Statsig Metrics wrapper with the frontend wrapper, the following changes are necessary:
user_type
to the Statsig user object (previously this was a value in the metadata hash)get_enabled_experiments
as an optional parameter, which will be a list of experiments a user might be enrolled in. The reason for this being optional is to save on db queries where experiments may not be relevantBoth of these will be values in the custom_ids hash in the StatsigUser class, per the Statsig docs.
Example usage:
Old formatted event:
New formatted event:
Warning!!
The AP CSP Create Performance Task is in progress. The most critical dates are from April 3 - April 30, 2024. Please consider any risk introduced by this PR that could affect our students taking AP CSP. Code.org students taking AP CSP primarily use App Lab for their Create Task, however a small percent use Game Lab. Carefully consider whether your change has any risk of alterering, changing, or breaking anything in these two labs. Even small changes, such as a different button color, are considered significant during this time period. Reach out to the Student Learning team or Curriculum team for more details.
Links
Testing story
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Checklist: