Skip to main content

index

DOCUMENTATION MOVED

Variables

GMetri experiences fully embrace "variables". Variables allows you to gamify your experiences and orchestrate a variety of interactions.

note

If you want to add interactivity, you would almost always use variables.

Variables can store three kinds of values:

  • String (Any character, word, sentence)
  • Numbers
  • Booleans (TRUE/FALSE).

Sources

There are three sources of variables in any GMetri experience:

  1. Custom Variables: These are variables that you add manually to an experience
  2. Global Variables: You can define certain variables in your workspace settings. These variables are then available for use across all experiences in that workspace. The value of this variable is shared across experiences
  3. Autogenerated Variables: These get added automatically
tip

Variables are very powerful tools that can be used to gamify any experience.

Custom Variables

Adding Custom Variables

  • You can add custom variables by opening Settings > Variables
  • Add the variable by clicking on Add Variable Button in the variables tab.

Checking the "track" option allows you to later check the values stored for that variable, for every user, in Analytics Dashboard

Adding Custom Variables

Global Variables

Global Variables are shared across all experiences in a workspace. These are helpful if you want to track your users journey across multiple GMetri experiences.

note

When the user moves from one experience to another in the same workspace, the values in global variables is preserved across experiences

Defining Global Variables

  • Head over to Settings from the top right menu in your Dashboard.
  • Click Add Variable in the Global Variables section

Defining Global Variables

Adding the Global Variables defined above to the experience

  • In the Project Editor, go to Settings > Varaibles.
  • Scroll down to see the Global Variables section. Use the dropdown to add the global variable you want to add.

Autogenerated Variables

Some variables are generated automatically when you create an experience. These variables are immutable - their values cannot be changed using rules.

Autogenerated Variables

List of auto-generated Variables

  1. score - This is a special number variable that's used to generate the leaderboard in the analytics section. Use this to store any overall score you may have in the experience.

  2. lang - The lang variable can be used by enabling the Show Language Screen option in the settings section. To add languages, go to the Languages tab inside Splash Screen. This variable will hold the value of the language selected by the viewer.

  3. v_identifier_var - A unique ID to identify each viewer who views the experience. This can be viewed in the analytics page. Can be email/name etc. - depends on the authentication mechanism used in the Deployment section.

  4. firstname_var - A string variable that contains the first name of the user if we get it from the authentication mechanism.

  5. fullname_var - A string variable that contains the full name of the user if we get it from the authentication mechanism.

  6. device_var - Holds information about the viewer device type. Possible values: d,m,h.

    • d -> Desktop
    • m -> Mobile
    • h -> Headset
  7. vrmode_var - Contains TRUE if the user enters VR Mode. Otherwise FALSE. Changes real-time to reflect the current state.

  8. browser_var - This variable holds the information on the browser that a viewer uses. For a list of support browsers please check the platform compatibility matrix. Following values will be populated in the browser_var when the viewer views an experience:

    DeviceBrowserbrowser_var value
    Laptop/PCSafarisafari
    Laptop/PCChromechrome
    Laptop/PCEdgeedge-chromium
    iPhoneChromecrios
    iPhoneSafariios
    AndroidChromechrome
    OculusOculus browsersamsung

Other actions like enabling Lead Generation form fields and adding Media Upload elements can also add auto-generated variables.