Skip to content

Call the correct API to determine if a user is in treatment or control group #20183

Closed

Description

@luabud

We seem to be using isInExperimentSync but that returns whether a user is in treatment or control, but we should probably be using getTreatmentVariable? This issue is so we can figure this out.

Activity

  1. added
    debtCode quality issues
    area-internalLabel for non-user facing issues
    needs spikeLabel for issues that need investigation before they can be worked on.
    on Nov 8, 2022
  2. luabud commented on Jan 27, 2023

    @luabud
    MemberAuthor
  3. karrtikr commented on Jan 31, 2023

    @karrtikr

    Great, we don't have an issue tracking implementing this though, so can we reopen this?

  4. removed
    needs spikeLabel for issues that need investigation before they can be worked on.
    on Feb 3, 2023
  5. changed the title [-]Spike - what is the right API to call for retrieving experiments [/-] [+]Use getTreatmentVariable instead of isInExperiment for running experiments [/+] on Feb 3, 2023
  6. luabud commented on Feb 3, 2023

    @luabud
    MemberAuthor

    Oops, good point :) thank you!

  7. karrtikr commented on Feb 8, 2023

    @karrtikr

    Luciana Abud (@luabud) Thing is inExperiment already uses getTreatmentVariable 🤷‍♂️:

    const treatmentVariable = this.experimentationService.getTreatmentVariable(EXP_CONFIG_ID, experiment);

    So back to square one, not sure what is to be used here.

  8. changed the title [-]Use getTreatmentVariable instead of isInExperiment for running experiments [/-] [+]Spike - what is the right API to call for retrieving experiments[/+] on Feb 8, 2023
  9. added
    needs spikeLabel for issues that need investigation before they can be worked on.
    and removed
    triage-neededNeeds assignment to the proper sub-team
    on Feb 8, 2023
  10. removed their assignment
    on Feb 8, 2023
  11. luabud commented on Feb 10, 2023

    @luabud
    MemberAuthor

    Kartik Raj (@karrtikr) but it returns treatmentVariable !== undefined;, which is true whether user is in treatment or control, no?

  12. karrtikr commented on Feb 13, 2023

    @karrtikr

    I think you were the one who observed this right? So as I understand the problem here is that how do we distinguish between control groups and treatment groups.

    Digging a little bit:

    call getTreatmentVariable(configId: string, name: string) to get the value of a treatment variable. configId is always vscode and name is the name of the treatment variable that you defined in control tower when you set up your experiment.

    The doc says getTreatmentVariable returns the value of the treatment variable. And when we create an exp on control tower:

    image

    We generally set the value of treatment as true for experiment group, and false for control group. Given we always follow this convention, I think we should be checking if treatmentVariable === true instead. Does it make sense?

  13. changed the title [-]Spike - what is the right API to call for retrieving experiments[/-] [+]Call the correct API to determine if a user is in treatment or control group[/+] on Feb 13, 2023
  14. locked as resolved and limited conversation to collaborators on Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-internalLabel for non-user facing issuesdebtCode quality issuesimportantIssue identified as high-priorityneeds spikeLabel for issues that need investigation before they can be worked on.verifiedVerification succeeded

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions