Last Updated June 6, 2024
Issue
I want to segment my WalkMe content by operating system.
Solution
You can use the “navigator.userAgent” variable to segment between different versions of Windows and macOS.
To find the value of the operating system you are trying to segment, you will need access to that machine.
- Go to any web page to test the variable
- In the developer console, enter the following:
- You should get a result that looks similar to the image below

- Set up your rule in the rule engine:
- User Data → Variable → navigator.userAgent → Like → *Windows*10*
You must add asterisks before, between, and after the operating system value.
Example
If you are on a Mac and get the following response:
5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
You would format your rule as:
- User Data → Variable → navigator.userAgent → Like → *Mac*OS*X*10*
Segment by Windows or macOS
If you want to keep it simple, you can set up your rules as follows:
Windows:
- User Data → Variable → navigator.userAgent → Like → *Windows*
macOS:
- User Data → Variable → navigator.userAgent → Like → *Mac*