Variables Cheatsheet
What are Variables?
A variable contains useful information about a user such as role, access level, department, email or user ID that is stored on a web page.
How Does WalkMe Use Variables?
WalkMe points to variables in order to read information about the user type, roles in the organization, and access level. WalkMe uses the information to segment WalkMe assets in order to target specific user groups. WalkMe does not change or alter any information on your site.
Segmentation
Variables are particularly useful in identifying user attributes such as roles, Salesforce Admin Access, and department. This information can be used to segment the WalkMe items you build to ensure that only content relevant to that user type is visible.
Reports
Variables can also store information unique to the user such as an email or ID number. With this information we can create reports about individual users to monitor their usage of WalkMe and completion of important businesses processes.
How To Create a Variable
Any variable which is accessible from the global window scope can be read by WalkMe. Variables already in your system can be easily adapted so that WalkMe can point to them. In order for WalkMe to read a variable, it must be attached to the window object.
Variables that WalkMe points to must be:
- Accessible within the web browser console/on the page level
- Must be on every page
The best resource for creating these variables is your Development or IT Team. In order to effectively communicate to the relevant team, outline what your variable is supposed to measure (the different values) and the name of the variable you'd like created.
For example, you could have a variable called User_Profile that contains values such as Admin, Sales, Marketing, Management, etc. Other commonly used variables are ones that identify a unique user ID, permission level, or the date the user signed up for the platform. A Global Variable is attached to the window object and can be read by WalkMe at any time.
Once you have identified or created a variable, we can configure WalkMe to track or segment by this information.
Variable example
var userRole = user.getUserRole()
In this example, a new variable called user role is declared using the object name and a function to call the relevant data. The object can relate to any data you already store about your user.
Attaching a variable to the window object
window.userRole = userRole
Once the variable has been defined, we can use the template above to attach the var to the window object.
Configuring Variables with WalkMe
Once your variables have been created, you will need to configure WalkMe to look for them.
- Click on the Settings icon and select System settings
- In the General tab, type in the name of your variable
Using Variables for Segmentation
To use your variable in a segment, follow these steps:
- Click Manage segments
- Create a new segment or edit an existing one
- Click on the pencil icon to create rules for the segment
- Click Add Rule
- Select User Data from the Rule Type dropdown, then select Variable
- Type in your variable name
- Select an operator and enter the variable value you want to segment by