- 02 May 2025
- 4 Minutes To Read
-
Print
-
DarkLight
-
PDF
URL Properties as Visibility Rules
- Updated On 02 May 2025
- 4 Minutes To Read
-
Print
-
DarkLight
-
PDF

Introduction
URL Properties help you uniquely identify a web page to show Whatfix content and widgets. These properties can be added as a Visibility or Display Rule condition to your Whatfix content and widgets.
The following are the URL Properties:
- URL
- URL Hostname
- URL Path
- URL Parameters
- URL Hash
Types of URL Properties
URL
Use the URL criteria to specify the entire page URL that you want to use as a Visibility or Display Rule.
Whatfix enables you to configure dynamic URLs also. For more information on how to use dynamic URLs as a Visibility Rule, see the use cases mentioned in this article.
URL Hostname
Use the URL Hostname condition to target a page based on its domain name. The hostname is the part of the URL between https:// and the first /.
Example: If you wish to display the tip only when you are on ap17.lightning.force.com, add a condition as shown in the following image:
URL Path
The URL Path refers to the section after the hostname, before any parameters or hash.
Example: If the website URL is https://ap17.lightning.force.com/lightning/#lead/
list?filterName=Recent, then the pathname is /lightning.
URL Parameters
Use URL Parameters to identify a page based on query parameters (the part after ?).
Example: If you want to show a tip to a user only when they filter for Recents, add a condition as shown in the following screenshot.
URL Hash
If you want to identify a page using the hash value of your URL, use the URL Hash condition. Hashes are usually present in Single Page Applications developed using AngularJS or ReactJS. There are no page refreshes, but only Hash changes.
Example: If you want to show a tip to a user only when they go to the Lead page, add a condition as shown in the following image:
Use Cases
Use the following steps to configure the Visibility rules in a widget:
-
Under the Visibility Rules condition, select URL.
-
Under the Operator section, select Contains.
-
Copy the URL value that is common across all the pages of your application, and then paste it under the URL section.
-
Click Save.
Use the following steps to configure the Visibility rules in a widget:
-
Under the Visibility Rules condition, select URL.
-
Under the Operator section, select Not Equals.
-
Copy the Browser URL of the page you don't want the widget to appear, and then paste it under the URL section.
-
Click Save.
Use the following steps to configure the Visibility rules in a widget:
-
Under the Visibility Rules condition, select URL.
-
Under the Operator section, select Contains.
-
Copy the URL value that is common across all the pages of your application, and then paste it under the URL section.
-
Click Save.
Pre-requisite:
To prevent a widget from appearing on a page, you need to identify the URL path value specific to the page that you want to exclude.
Use the following steps to configure the Visibility rules in a widget:
-
Under the Visibility Rules condition, select URL.
-
Under the Operator section, select Contains.
-
Copy the URL value that is common across all the pages of your application, and then paste it under the URL section.
-
Click the Plus icon.
-
Select URL as the display rule condition.
-
Under the Operator section, select Not Contains.
-
Copy the URL value specific to the page you don't want the widget to appear on, and then paste it under the URL section.
-
Click Save.
A dynamic URL has a URL path that is divided into two parts. One part of the URL path is dependent on user-defined variables, that keep changing to display specific information depending on user inputs. The other part of the URL path is independent of user inputs and remains common throughout the application.
To display a widget on an application having a dynamic URL, you need to identify the two parts of the application URL.
If the URL path ends with a dynamic value, then while configuring the Visibility rules in a widget, use the following steps:
-
Under the Visibility Rules condition, select URL.
-
Under the Operator section, select Starts With.
-
Copy the independent URL path value, and then paste it under the URL section.
-
Click Save.
If the URL path begins with a dynamic value, then while configuring the Visibility rules in a widget, use the following steps:
-
Under the Visibility Rules condition, select URL.
-
Under the Operator section, select Ends With.
-
Copy the independent URL path value, and then paste it under the URL section.
-
Click Save.
Visibility rules can be edited only when the widget is in the Draft and Ready stages.
Use Contains instead of Equals to create more flexible and reliable URL conditions.
Here's why:
-
Partial Matches: Contains can match part of a URL, making it useful for targeting a range of pages under a common path or similar structure.
-
Dynamic Content: URLs often contain dynamic elements such as session IDs or query parameters. Contains can match the static part of the URL, avoiding mismatches due to these dynamic elements.
-
Complex URLs: When URLs have multiple parameters or fragments, Contains ensures that the rule applies even if the exact order or presence of additional parameters varies.
For more information, see Supported Operators for Visibility and Display Rules.