> For the complete documentation index, see [llms.txt](https://docs.gmetri.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gmetri.com/metaverse/build/portal/global-variables.md).

# Defining 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.

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[​](https://www.gmetri.com/docs/platform/create/variables#defining-global-variables) <a href="#defining-global-variables" id="defining-global-variables"></a>

* Head over to `Settings` from the top right menu in your [Portal](/metaverse/build/portal.md).
* Click `Add Variable` in the `Global Variables` section

![Defining Global Variables](https://s.vrgmetri.com/image/q_90/gb-web/portal-docs/assets/img/screenshots/variables/defineglobalvars.png)

### **Adding the Global Variables defined above to the experience**[**​**](https://www.gmetri.com/docs/platform/create/variables#adding-the-global-variables-defined-above-to-the-experience)

* In the Project Editor, go to [Settings > Variables](/metaverse/build/editor/project-settings/variables-in-settings.md).
* Scroll down to see the `Global Variables` section. Use the dropdown to add the global variable you want to add.

Read more about Variables here:

{% content-ref url="/pages/4FdURXtqhp12wn0WgUZi" %}
[Variables](/metaverse/build/variables.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gmetri.com/metaverse/build/portal/global-variables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
