- 13 Mar 2025
- 1 Minute To Read
-
Print
-
DarkLight
-
PDF
How to display Pop-ups based on user roles?
- Updated On 13 Mar 2025
- 1 Minute To Read
-
Print
-
DarkLight
-
PDF
Configure pop-ups to display only to specific users based on their role or segment by using the window variable option. Configure the value for the window variable and make it available from the application.
Use the following steps to set the visibility rule using a window variable:
-
On the Whatfix Guidance dashboard, click Widgets.
-
Click Pop-ups.
-
Hover your cursor over the Pop-up segment you want to configure, and then click the Edit icon.
-
Click Set Visibility Rules →.
-
Under the Where tab, select Window Variable from the dropdown.
-
Enter the Variable name, select Equals operator, and then enter the Variable value.
Your application developers can help you get the variable name and its value.
The following examples use window variables to identify user roles. Use different methods that fit with your application's structure.
If you're passing role permission in the URL parameters, the following method can be used.
If you're passing role permission in the URL Hash, the following method can be used.
If each role has a unique element available in the application, use it to display pop-ups. For example, the Settings icon is visible only to Admin users, and the Request Access button is available only to Editors. Use these elements to identify the user and display content.
- Complete creating the Pop-up.