> 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
