πŸ“—
UpGrade Platform - Documentation
6.0
6.0
  • UpGrade Overview
  • Creating an Experiment
    • Unit of Assignment
    • Simple Experiment
    • Factorial Experiment
    • Inclusion and Exclusion
    • Schedule and Post-Rule
    • Exporting Experiment Data and Design
  • Creating a Feature Flag
  • How UpGrade Works
  • Researcher Guide
  • Developer Guide
    • ⚑Quick Start: Running UpGrade Locally with Docker
    • ⚑Quick Start: Running locally w/o Docker
    • UpGrade + AdapComp (Mooclet) in Docker
    • πŸšΆβ€β™€οΈWalkthroughs
      • Your Application and UpGrade
      • Example 1: A Quiz Web App
      • Example 2: An Online Math Game
    • πŸ“šReference
      • API
      • Client Libraries
        • TypeScript / JS
          • Class: UpgradeClient
          • Class: Assignment
          • SDK Interfaces
            • Interface: IMetric
            • Interface: IExperimentUser
            • Interface: IExperimentUserAliases
            • Interface: ILog
            • Interface: IMarkExperimentPoint
            • Interface: IMetric
            • Interface: IRequestOptions
            • Interface: IResponse
            • Interface: IUser
            • Interface: IUserGroup
      • Environment Variables
        • Frontend Environment
        • Backend Environment
      • Context Metadata
      • Metrics
      • Setting up Google-Auth
      • API Authorization
      • Data Architecture
    • πŸ‘¨β€πŸ’»Contributing Code
      • Branching Workflow (Git-Flow)
      • Pull Request Expectations
    • πŸ˜…Troubleshooting
      • Relation β€˜experiment_condition’ already exists
      • User not found. Authorization error
      • Token is not present in the request header
      • nodemon exits without explanation
      • Unable to find New Relic module configuration
      • No email received for export data
      • Opening a new tab in UpGrade prompts for re-authorization
      • Error: Cannot find module 'upgrade_types' (or a type from 'upgrade_types' does not exist)
  • Glossary
Powered by GitBook
On this page
  • Initialize your users
  • Collect assignments
  • Mark a decision point
  • Log metrics
  1. Developer Guide
  2. Walkthroughs

Your Application and UpGrade

PreviousWalkthroughsNextExample 1: A Quiz Web App

Last updated 3 months ago

Once you've created an instance of UpGrade, you need to make a few changes to your educational app. The three key APIs are /init, /assign, and /mark. The details of these and other APIs are outlined in the CLIENT SDK section.

Initialize your users

Each user that accesses your application could be eligible for an experiment. In order to properly register them to an experiment, you need to initialize the user and assign any group memberships, if you're using group consistency. The first call from your application to UpGrade should be a call to . You can also set the group membership and working group at this point, although users can still be assigned conditions without any groups.

Perhaps you don't know each user's groups until later. You can use the API to specifically assign a list of groups to a user. These groups are defined in the . A user can belong to multiple groups. For example, a student can be assigned to multiple classes and multiple teachers.

A user's working group is the current active group. Perhaps your application works with multiple subjects, but a student is currently working on math. You would use to set math as the student's active group. Working groups are important, because UpGrade's group assignment and exclusion is based on a user's working group.

Perhaps your users have different IDs in multiple applications but you want to link them all together. You should use the /useraliases API to set the alias and associate it with the original ID. You can collect assignments for this user from any of the aliases.

Collect assignments

A decision point is made up of a site and target. A site may have multiple targets. Think of the site as a place in the code (e.g., a function name) where the condition will be assigned. A category of locations within the app. The target indicates the app component (e.g., a problem ID) that will undergo the experiment. A specific element within the category.

For example, if one page of your application is a site, then the targets could be the hint button, the written content on the page, or the glossary in the corner. At different points in your application, you can check for a condition by filtering for site and target. The hint button on this page will only look for conditions related to the hint button and the written content on this page will only check for conditions relating to the content.

When a user has reached a spot in your application where you would like to run an experiment and change the user experience, use the API to collect any experiment conditions. The assign call will return an assigned condition for every enrolling experiment that includes the user under the specified context. You can then filter the condition list by site and/or target. We suggest you cache the result if a user is eligible for multiple decision points under one context.

A user will receive the same set of conditions each time. That is, the random assignment will not give a user a different condition after one has been assigned.

Mark a decision point

When a user reaches a specific decision point and receives a condition, you want to mark that decision point. UpGrade needs to know that this user is enrolled in this experiment and has received an intervention. You could mark the decision point after a user has experienced the intervention, but we suggest marking at the start. You want to register that a user has seen the intervention, not only that a user has completed the intervention. See the page for ideas on how to register completion.

Use the API to tell UpGrade the site, target, condition, and if that condition was successfully applied to a user. UpGrade will also keep track of excluded users for whom the condition failed to apply, were excluded based on group consistency, or had previously reached the decision point before the experiment was enrolling.

Log metrics

Follow this order for a successful integration with UpGrade!

After a user marks a decision point, the corresponding experiment will start collecting data on that user. The page has more detailed information on what metrics UpGrade collects and how to customize your data. It's important to note that metric data will not be calculated until after a user marks a decision point.

πŸšΆβ€β™€οΈ
Metrics
Context Metadata
Metrics
/init
/groupmembership
/workinggroup
/assign
/mark