- 12 Jul 2024
- 1 Minute To Read
-
Print
-
DarkLight
-
PDF
Visibility Rules Best Practices
- Updated On 12 Jul 2024
- 1 Minute To Read
-
Print
-
DarkLight
-
PDF
Select strong elements
While selecting an element, always capture elements that have a strong red border around them.
Use Visual Cues
With Visual Cues, Whatfix enables you to see the strength of the element that is being captured. This also lets you understand how well the element is identified and selected by Whatfix. Additionally, add additional information, such as CSS selectors, to further improve the accuracy and reliability of the selection. This ensures that only the right elements are being captured and content shows up when it's supposed to. For more information, see Improve Element Selection using Visual Cues.
Use contains instead of equals
Using the contains operator rather than equals provides greater flexibility and robustness in matching URLs. Here’s why:
Partial Matches: Contains can match a segment of a URL, which is useful for targeting a range of pages under a common path or with similar structures.
Dynamic Content: URLs often contain dynamic elements like session IDs or query parameters. Contains can match the static part of the URL, avoiding mismatches due to these dynamic parts.
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.
Use URL hostname/path/hash/parameter instead of just URL
Using specific URL properties like hostname, path, hash, and parameters instead of just the URL ensures more precise and flexible targeting. This precision helps avoid unintended matches and improves the relevance of your content delivery. For more information, see URL Properties as Visibility Rules.
Add Selected Element Is before Selected Element Text
Ensure you use the Selected Element Is rule, followed by the Selected Element Text rule while adding Visibility Rules to any content or widget.
Adding CSS Selectors ensures that Whatfix can easily find the required element and reduce the possibility of displaying content/widgets on the wrong element. This also reduces the time taken by Whatfix to find the right text on the page. For more information, see Selected Element conditions as Visibility Rules.
Select good CSS selectors
Good CSS selectors ensure that your content appears exactly where you want it to appear. For more information, see Identify an element's CSS selector
Ensure that any parent content is in Production
If your content or widget is launched by any other content like Launchers and User Actions, ensure it is in Production.