Variables

Last Updated October 9, 2026

Brief Overview

A variable stores information about a user on a web page, like their role, department, email, or user ID. WalkMe reads variables to show each user only the content relevant to them, and to track individual users in analytics.

Use Cases

  • Identify power users on your site
  • Segment Smart Walk-Thrus for users in specific regions, or for admins
  • Personalize balloons and ShoutOuts with a user's name or account details
  • Associate WalkMe activity in analytics with individual users

How It Works

WalkMe reads any variable available in the page's global window scope. When you use a variable in a rule, WalkMe checks its value in the user's browser and compares it to that rule.

For example, if your site has <span class="coded">var region = "North America"</span> and you create a segment where region is North America, items in that segment play only for users whose region value is North America.

Unlike cookies, a variable stays tied to the same user even after they clear their cache or switch browsers, as long as it's available on every page.

Use variables for segmentation

Variables are commonly used to  Segment your WalkMe assets. To use your variable in a Segment.

  1. Open the Segmentation Center
  2. Choose Create a New Segment or Edit an existing one
  3. Select Define this Segment
  4. Select the User Data rule type, then Variable
  5. Type the variable name, choose an operator, and type the value to segment by

Segment Manager in the Console

Use variables in dynamic text

Use a variable in Dynamic Text in the Rich Text Editor to show user-specific information, like a first name or the days left in a trial, in a balloon or ShoutOut. In Source view, the variable shows as BBCode. Preview stays blank, and the user's value appears after you publish.

What is Dynamic Text?

Use variables in onboarding

Onboarding Tasks track each user's progress individually, so they need a variable to identify the user. Set it in the General Settings tab.

Onboarding Tasks: Getting Started Guide

Use variables for analytics

Configure a variable that returns the user's name so analytics reports show individual users. Set it in Unique User Settings. For WalkMe for Salesforce, use UserContext.userName.

Unique User Settings (UUID)

Setup

If the value you need isn't in a variable yet, ask your development or IT team to add one. Tell them what the variable should capture, its possible values, and the name you'd like to use.

Create the variable

For example, a variable that returns the user's role:

  • var userRole = user.getUserRole();

Attach it to the window

WalkMe can only read variables attached to the window object:

  • window.userRole = userRole;

Expose more than one variable

Group the variables in one object, then attach the object to the window:

  • var company_variables = {};
  • company_variables.userID = user.getUserID();
  • company_variables.roleID = user.getRoleID();
  • company_variables.departmentID = user.getDepartmentID();
  • window.company_variables = company_variables;

Technical Notes

  • The variable must be attached to the window object and available on every page where WalkMe uses it
  • Variables used only for segmentation need no extra configuration in WalkMe
  • Variables configured for analytics or onboarding are also available in the Segmentation Center

Was this article helpful?

Thanks for your feedback!

Be part of something bigger.

Engage with peers, ask questions, share ideas

Ask the Community
×
×