How to block recording of certain elements of the page HTML

On occasion your site may include elements which you need to completely exclude from recording. 

Most elements can be masked by adding one of our exclusion classes to them, which will replace any sensitive data with asterisks. If the element that you wish to exclude is held within an input field or plain text, please refer to the applicable help articles below:

How to disable the recording of page text

How to disable the recording of form fields

Some elements will not allow you to apply this level of masking to them, for example a live chat solution or image file. In these instances it is not always possible to replace the sensitive information with asterisks, therefore you will need to remove them from recording entirely.

To achieve this you will need to apply a line of JavaScript to your web page. This will need to be placed at the bottom of your page, just before the SessionCam tag. 

The script that you will need to achieve this can be found below:

if (!window.sessioncamConfiguration){
window.sessioncamConfiguration = new Object();
}
window.sessioncamConfiguration.elementsToRemove = "********"

Before applying this to your site you will need to assign the element that you wish to remove. To achieve this please refer to the HTML of your site and locate the identifying ID or class. This will then need to be added to the “elementsToRemove” section of this script. In the example below, we are looking to exclude an element with the ID of “livechat”.

if (!window.sessioncamConfiguration){
 window.sessioncamConfiguration = new Object();
}
window.sessioncamConfiguration.elementsToRemove=".lpChat"

The above could be used to ignore the HTML that is seen on the first page load, or in subsequent events where there is an element with a class called lpChat.

Finally, the example below could be used to ignore the HTML that’s seen on the first page load, or in subsequent events where there is an element with an id of “secretdynamicarea”. 

if (!window.sessioncamConfiguration){
window.sessioncamConfiguration = new Object();
}
window.sessioncamConfiguration.elementsToRemove="#livechat"

If you have multiple elements which you wish to remove, you may wish to store each of these identifiers within a variable, to reduce the size of the script and make it easier to apply changes in the future. To do this you will need to edit the script as follows:

if (!window.sessioncamConfiguration){
window.sessioncamConfiguration = new Object();
}
var items = "#id_1,#id_2,.class_1,.class_2"
window.sessioncamConfiguration.elementsToRemove= items;