statsig-io / statsig-feedback

Issue Tracker for Statsig. Leave your feedback on anything we do!
5 stars 0 forks source link

userID required in serverSDKs, but cannot target empty string in the console #10

Closed tore-statsig closed 3 years ago

tore-statsig commented 3 years ago

The Statsig docs recommend passing an empty string as a userID if you don’t have an actual userID (https://docs.statsig.com/messages/serverRequiredUserID/), but there appears to be no way to write rules that treat the empty string differently from other (non-empty) userIDs. The only operator you can use on userID is “any of” or “none of”, and then there’s no way to input the empty string into the list of tokens. (I can type “” but that’s interpreted as a string of two quotation marks, not an empty string.)

"The use case I can think of is: treating logged-out users differently from logged-in users."

"I could pass in userID: ‘loggedOut’ or some other constant, but using null or the empty string feels the most natural to me. And with null disallowed, I’d default to empty string."

tore-statsig commented 3 years ago

We have discussed internally, and decided to separate out some of this feedback

1) I've update the linked documentation to suggest a non-empty identifier. We are not planning to support targeting the empty string in the console.

2) The above works only for 0 or 100% rollouts - a single hardcoded identifier will evaluate as always true or always false for all requests. As such, we are evaluating if logged out/unidentified partial rollouts (e.g. 50%) and experiments are possible for server SDKs

As the docs have been updated and the console is not changing, I am closing this issue. Feel free to comment or reopen with additional questions or feedback