Manage global variables
This article provides information on adding, editing, and deleting global variables that can be used in event and visitor functions.
The store
is a key-value map used to manage global variables that can be accessed by event and visitor functions. Global variables can be added, edited, and deleted from the Code tab of the functions code editor. Event and visitor functions can can retrieve the value of a global variable using the store.get()
method. For more information, see Event and Visitor Functions.
Add a global variable for event or visitor functions
To add a global variable, follow these steps:
- in the Server-Side, navigate to Functions > Overview.
- Select an event or visitor function, then click the Code tab.
- Click Global Variables, then click + Add Variable.
- Enter a Name for the variable.
The Key field is automatically populated with the specified name. - Enter the Value of the variable.
- Click Add, then click Close.
- Click Save/Publish.
Edit a global variable
To edit a global variable, follow these steps:
- in the Server-Side, navigate to Functions > Overview.
- Select an event or visitor function, then click the Code tab.
- Click Global Variables.
- In the menu for the variable, click Edit.
- Modify the Name and Value as needed, then click Done.
- Click Close, then click Save/Publish.
Delete a global variable
To delete a global variable, follow these steps:
- in the Server-Side, navigate to Functions > Overview.
- Select an event or visitor function, then click the Code tab.
- Click Global Variables.
- In the menu for the variable, click Delete.
- Click Close, then click Save/Publish.
This page was last updated: January 7, 2023