Masking elements

Modified on Thu, 25 Jan 2024 at 12:29 PM

CUX prioritizes the privacy of your website's visitors by automatically masking sensitive information entered into form fields. However, personal data can also appear in other sections of your site, such as account profiles or confirmation pages following a transaction. To address this, CUX enables you to conceal specific content from its analytics scripts, ensuring such data remains private and unrecorded. CUX offers two straightforward methods for securing your users' privacy: 

  1. HTML Code Modification: Tailor your website's HTML by adding special attributes to elements containing sensitive information you wish to conceal from CUX analytics. This method is perfect for those who are comfortable working directly with code, offering pinpoint accuracy in data masking. 
  2. Built-in Privacy Feature: For a more intuitive approach, CUX's built-in privacy tools enable you to select and obscure sensitive elements directly through the CUX platform, eliminating the need for coding. This user-friendly option is designed to accommodate both technical and non-technical users, simplifying the process of protecting user data.

These versatile masking capabilities apply to both static and dynamically loaded content, such as AJAX-powered elements, ensuring comprehensive privacy across your entire site. Importantly, when you mask parts of your site using either method, these sections are completely ignored by CUX's analytics. This means that the masked content will not appear in visit recordings or heatmaps, fully preserving user privacy.

It's essential to approach masking with precision, focusing solely on elements with sensitive data. Over-masking can lead to less informative analytics, such as incomplete heatmaps and recordings. We advise selectively hiding only those elements that contain private information, avoiding the unnecessary obscuration of entire website sections.

Note that the operation of the CUX script affects only the data that goes to our database. The masking operation is transparent to your visitors. They can use and see all the elements freely.

Modify HTML

To hide an element from CUX, you need to modify your page HTML code. You can add the class “cux-exclude” to any HTML element. When the CUX script finds an element containing the excluded class, it replaces it with an empty DIV element. The styles for the hidden elements are retained. Thanks to this, the page rendered in CUX player or heatmaps won’t be destroyed.

Use the "Masking elements" feature

Please note that the feature to mask elements on your website is an exclusive benefit for our Business Plus and Enterprise clients. Interested in enhancing your subscription with this powerful privacy tool? Our sales team is here to assist you. Reach out to us at Whether it's a question or just a chat about your options, we're here for you.

This option allows you to mask selected elements without any help from developers. To mask given elements or whole URLs on a website, you simply have to:

  1. Log into your CUX account. 
  2. Go to Settings>Privacy. 
  3. Click “Add New”. 
  4. Name your Masking Rule & provide an xPath to the element you want to mask completely. Alternatively, you can mask the entire URL address - note that you have to add a ^ symbol before the URL address for the masking to work properly.
  5. Choose whether you want to mask or exclude the given element. You'll see how the selected method hides the data in the “Masking Example” preview below. 
  6. Click “Mask element”.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article