Hey team! Is it possible to expose the variant nam...
# give-feedback
c
Hey team! Is it possible to expose the variant name for tracking purposes? While variant IDs are useful and can be used as a fallback, having a more descriptive identifier in our data warehouse would be beneficial. Would you be interested in this? If so, I can take a deeper look into the codebase and open a pull request.
👀 1
f
Hi David
Thats cool if you want to take a look at the code and open a PR. @future-teacher-7046 might have some thoughts as we’ve had this request in the past, I just don’t remember where we landed.
c
Nice! I’ll wait a bit to have some input from Jeremy before exploring this 😸
f
Hi David. We added support in our javascript SDK recently for this, but have not updated the API endpoints to include these new fields yet.
Specifically, we added a
meta
field to experiment definitions to specify a "key" and "name". We also added a top-level field to specify a "name" for the experiment
Copy code
{
  "name": "My Experiment",
  "variations": [
    "A",
    "B"
  ],
  "meta": [
    {
      "key": "my-control-id",
      "name": "Control"
    },
    {
      "key": "my-variation-key",
      "name": "New Page"
    }
  ]
}
Then, in the tracking callback, you can reference these properties:
Copy code
function trackingCallback(experiment, result) {
  console.log(
    experiment.name,
    // The assigned variation metadata
    result.key,
    result.name
  )
}
c
Ah, cool, found the docs now https://docs.growthbook.io/lib/js#meta-info 😄
Let me know if you need some help to introduce this in the Ruby SDK 💎
f
That would be great if you wanted to make a PR to add that to the Ruby SDK
c
BTW, when do you plan to add all the meta fields in the UI? I am planning to use them in our upcoming integration but I am not sure if they will be available soon.
f
Meta fields for features or experiments?
c
I mean the meta fields for features, as well as exposing the variant name. Despite the JS SDK is ready to support this, we don’t yet have this information coming when fetching the config file.
Hey! Just to double check that I understood the goal of this meta fields correctly. Currently are only available for inline experiments, but are you planning to include them in the UI for regular experiments?
f
Yes, we plan to let you opt-in to including meta fields in the payload sent to the SDKs. Some companies don't want to expose detailed information about the experiments they are running to their users, so we didn't want to just enable this for everyone. Hoping to have this opt-in setting available in the next couple weeks
👍 1
c
I tried to update the Ruby SDK to match the last spec. Let me know if I’m missing something else 🙏
🎉 1
f
Oh nice! We’ll take a look