Configuring Session Replay
When you click on the Click here link that appears after you enable Session Replay (in the Sessions Test configuration page), Figure 1 will appear.
Figure 1 : Configuring Session Replay
Using Figure 1, you can configure how eG RUM should perform session recording.
-
Start by indicating the sessions for which session replay data should be captured, by choosing one of the following options from the Capture Session Replay Based On drop-down:
-
Slow/error page view: This is the default option. If this option is chosen, then the test will automatically collect session replay data for only those user sessions that are experiencing slowness or are encountering errors over configured acceptable levels. So, once you pick this option, you will be required to indicate the following:
-
Avg Load Time Threshold for Pages: By default, this test will collect replay data for all those user sessions where the last 10 web pages accessed took an average of 4000 milliseconds or more to load. Accordingly, this parameter is set to 4000 by default. You can increase or decrease this counter, depending upon when and how often session replay data should be captured.
-
Avg Load Time Threshold for AJAX: By default, this test will collect replay data for all those user sessions where the last 10 AJAX web pages accessed took an average of 4000 milliseconds or more to load. Accordingly, this parameter is set to 4000 by default. You can increase or decrease this counter, depending upon when and how often session replay data should be captured.
-
Average Load Time Threshold for Virtual Pages: By default, this test will capture replay data for all those user sessions where the last 10 virtual pages accessed took an average of 4000 milliseconds or more to load. Accordingly, this parameter is set to 4000 by default. You can increase or decrease this counter, depending upon when and how often session replay data should be captured.
-
Error Percentage Threshold: By default, this test will capture replay data for all those user sessions where over 25% of the web pages encounter JavaScript errors. Accordingly, this parameter is set to 25 by default. You can increase or decrease this counter, depending upon when and how often session replay data should be captured.
-
-
Sampling Rate: Select this option if you want the test to collect replay data only for a configured percentage of sessions. By default, the test will collect replay data for 30% of sessions. Accordingly, the Session Replay Sampling Rate parameter is set to 30 by default. You can increase or decrease the sampling rate based on when and how frequently you want session replay data should be captured.
Figure 2 : Specifying Session Replay Sampling Rate
When a Sampling Rate is at play, the sessions for which replay data is to be captured are chosen at random by eG RUM. Typically, each time a new user session starts, eG RUM generates a random floating-point number between 0 and 100. This number is then evaluated against Session Replay Sampling Rate that is set. If the generated number is below the configured threshold, session replay data capture is activated, allowing event data to be collected throughout the session. Conversely, if the number exceeds the threshold, session replay data is not captured for the entire session, and no event data is recorded. This process ensures that session replay data is selectively captured based on probability, optimizing resource usage while maintaining flexibility.
Note:
Some environments may require more flexibility with regards to when to activate session recording and replay and for which users. Administrators of such environments can manually provide 'replay instructions' to eG RUM by editing the application code to include an 'Opt-in' SDK mode. The 'Opt-in' mode, if used, will override any 'record and replay' instructions provided to eG RUM via the eG administrative console - i.e., it will override the option (and sub-options) chosen from the Capture Session Replay Based On drop-down. To know how to use the 'Opt-in' mode, refer to Configuring Session Replay Using Opt-in Mode.
-
-
After choosing an option from the Capture Session Replay Based On drop-down and configuring related parameters, proceed to configure what session replay should/should not capture:
-
How often to capture page scrolling: This setting controls how frequently the scrolling events are recorded during a session. Such a setting helps balance recording accuracy and storage efficiency. By default, eG RUM captures scroll events every 4 seconds to avoid excessive storage usage or unnecessary detail. In other words, eG RUM will capture and store the user's scroll position every 4 seconds, by default.
If you increase the value of this parameter, it will reduce the amount of data stored (optimize storage), but will result in less smooth scroll playback, as the scrolling events are captured less frequently.
If you reduce the value of this parameter it will increase the accuracy and smoothness of scroll playback, but will generate more data, which can lead to larger file sizes and potentially slower loading times when replaying sessions.
-
CSS Selectors to Gray Out UI Element: Gray Out is an advanced privacy setting that completely hides specific elements instead of obscuring the text. If you are concerned about the number of visible elements in sensitive fields, you can enable Gray Out for your specific elements. For instance, say you want to use the Gray Out feature to hide the user name from a web page when recording user sessions. For that, you need to specify the CSS Selector that represents the user name element in the target HTML page, here. The marked element is then replaced with an empty block, while maintaining the height and width, at the time of recording. Any changes to the DOM within that element or its children are also ignored during the recording process.
To identify the CSS Selector, do the following:
- Open the target web page in a browser.
-
Right-click on the name in that web page and choose Inspect from the shortcut menu that appears.
Figure 3 : Selecting the Inspect option from the right-click menu of the user name
-
This will invoke Developer Tools, where you can view the source code of that web page with the code block governing the user name display highlighted.
Figure 4 : Inspecting the chosen user name code block in Developer Tools
-
In the code block, right-click on the element representing the user name, swipe your mouse over Copy, and select Copy selector to copy the selector of the chosen element. In the process, the CSS Selector of the user name will get copied automatically.
-
Finally, paste the copied selector in the CSS Selectors to Gray Out UI Element text box in .
-
Multiple CSS selectors can be provided as a comma-separated list.
-
CSS Selectors to Ignore/Disregard Changes On Input Events: If you do not want eG RUM to capture any input activity such as clicking, typing, selecting, checking etc., on any HTML element, as part of session recording and replay, then provide the CSS selector that represents that element here. In this case, eG RUM will still capture the static presence of the configured element, but will ignore any dynamic input activity that a user may perform on it. For instance, say you have a text box in your web page that accepts credit card number as input. If you specify the CSS selector of that text box here, then, when recording the session, eG RUM will capture the text box, but will ignore any credit card number that is typed within.
-
Exclude Replay for URLs: By default, eG RUM collects replay data for user accesses to all URLs of the target web site/application. This is why, this parameter is set to none by default. If you want specific URLs to be disregarded for replay data capture, then specify a comma-separated list of URLs / URL patterns that you want eG RUM to ignore during data capture. For example, your specification can be: https://www.shop2drop.com/browse.jsp, https://www.shop2drop.com/*shoe*
-
Include Replay for URLs: By default, eG RUM captures replay data for user accesses to all URLs of the target web site/application. This is why, this parameter is set to * by default. If you want eG RUM to capture replay data for accesses to specific URLs alone, then specify a comma-separated list of such URLs / URL patterns here. For example, your specification can be: https://www.shop2drop.com/browse.jsp, https://www.shop2drop.com/*shoe*
-
Mouse Movement: By default, eG RUM does not capture any mouse movement - e.g., mouse click, mouse drag etc. This default behavior optimizes storage space usage. If your eG database is well-sized and well-tuned, then you can enable the capture of Mouse Movement as part of session recording and replay. For that, push this slider to the right.
-
All Input Key: This configuration is used to control how input events (such as typing into text fields) are recorded during a session recording. By default, eG RUM captures only the last input event in a sequence of rapid input actions. For instance, say a user types "hello" into an input field. eG RUM, by default, will not capture each keystroke that is input until the word 'hello' is complete. Instead, eG RUM will only record the final state of the input field after the user finishes typing ("hello"). This default setting reduces the amount of data recorded, as it captures only the final input value, rather than each individual keystroke. On the other hand, if you push this slider to the right and enable the capture of all input keys, then eG RUM would capture each of the five input events corresponding to typing each character (h, e, l, l, o). This setting is ideal if your eG database is well-sized and well-tuned.
-
Capture and Store Image Files Locally: By default, eG RUM does not store the images it captures during session recording, locally. Instead, it captures and stores only the image URLs. Accordingly, this flag is disabled by default. In the case of the default setting, at the time of session replay, eG RUM loads the image directly from the application server that hosts that resource. By not storing image files locally, eG RUM, by default. saves significant amount of storage space on the eG manager. You can choose to storage images locally, if you so wish, by pushing this slider to the right. However, before turning on local image storage, make sure that the following conditions are fulfilled:
-
Images must be accessible in the browser used for replay, with a direct connection to the application server hosting the images.
-
Ideally, images should not be protected. If they are, then first ensure that the session player is able to access the images, without requiring authentication, before enabling local image storage.
-
Images should not be personalized - i.e., images served by the same URL but customized for each user should not be used.
Also, note that enabling this flag will increase space usage on the eG manager host. Hence, make sure that your eG manager is adequately sized and well-tuned before enabling local image storage.
-
-
Exclude Image Capture for URLs: This parameter will appear only if local image storage is turned on - i.e., only when the Capture and Store Image Files Locally slider is pushed to the right.
Typically, once you opt for local image storage, eG RUM will capture and store all image files used in the target web site/web application, in the eG manager. This is why, the Exclude Image Capture for URLs parameter is set to none by default. To conserve space usage on the eG manager, you can instruct eG RUM to 'not capture' specific images during session recording. For that, provide a comma-separated list of image URLs/URL patterns to be ignored, in the Exclude Image Capture for URLs text box. For instance, your specification can be: api/payment/*,/internal/*
-
Capture and Store CSS Files Locally: By default, eG RUM does not store the CSS files it captures during session recording, locally. Instead, it captures and stores only the file URLs. Accordingly, this flag is disabled by default. In the case of this default setting, at the time of session replay, eG RUM loads the CSS file directly from the application server that hosts that resource. By not storing CSS files locally, eG RUM, by default. saves significant amount of storage space on the eG manager. You can choose to storage CSS files locally, if you so wish, by pushing this slider to the right. However, before turning on local file storage, make sure that the following conditions are fulfilled:
-
CSS files must be accessible in the browser used for replay, with a direct connection to the application server hosting the files.
-
Ideally, CSS files should not be protected. If they are, then first ensure that the session player is able to access the files, without requiring authentication, before enabling local file storage.
-
Files should not be personalized - i.e., files served by the same URL but customized for each user should not be used.
Also, note that enabling this flag will increase space usage on the eG manager host. Hence, make sure that your eG manager is adequately sized and well-tuned before enabling local file storage.
-
-
Exclude CSS Capture for URLS: This parameter will appear only if local CSS file storage is turned on - i.e., only when the Capture and Store CSS Files Locally slider is pushed to the right.
Typically, once you opt for local CSS file storage, eG RUM will capture and store all CSS files used in the target web site/web application, in the eG manager. This is why, the Exclude CSS File Capture for URLs parameter is set to none by default. To conserve space usage on the eG manager, you can instruct eG RUM to 'not capture' specific CSS files during session recording. For that, provide a comma-separated list of file URLs/URL patterns to be ignored, in the Exclude CSS File Capture for URLs text box. For instance, your specification can be: api/payment/*,/internal/*
-
Enable User Consent: Strict security constraints in some environments may mandate that session recording and replay be triggered only after obtaining the web site users' consent. To comply with such security requirements, application owners/designers can customize the application code to include a code snippet that requests for a user's consent to record his/her session, and proceeds with the recording only after the user approves. To facilitate this, do the following:
-
Push the Enable User Consent slider to the right to enable this feature.
-
Figure 6 appears displaying a sample code.
Figure 6 : Sample code to invoke banner that requests for user's consent to begin session recording
-
Click on the Copy button in Figure 6 to copy the sample code. Paste it into your application code.
-
Write a piece of code that invokes a banner requesting for user's consent to trigger session recording. Insert this piece of code within the opening and closing curly braces - { } - that appear after the function call showCustomBanner() in the sample code. A sample custom code for invoking such a request banner is indicated in Figure 7 below:
Figure 7 : A sample custom code for invoking user consent banner inserted into the showCustomBanner() function call
-
Once this is done, then session recording and replay will be activated only after user explicitly 'green lights' the process.
-
-
Masking Options: Since Session Recording and Replay captures user interactions with a target web site/web application, it is imperative that sensitive/confidential user data - be it private data (e.g., credit card numbers, passwords) that is input by users during their interactions with the application, or sensitive data that is auto-displayed or auto-generated at application runtime - is 'protected from abuse' by malicious users. This is where 'Masking' helps! By enabling 'Masking', you can ensure that eG RUM automatically masks sensitive elements from being recorded during session recording and replay. When data is masked, that data is not collected in its original form and is hence not sent to the backend. Thus, confidential data is rendered 'off limits' for unscrupulous users.
By default, eG RUM masks 'all' types of data - say, text strings, labels, captions, images, user input such as text box entries, check box/radio button selections etc. - during session recording and replay. This is why, the Masking Type parameter is set to MASK ALL by default. If needed, you can disable masking for specific elements alone by providing a comma-separated list of CSS selectors representing each of these elements in the CSS Selector to Exclude text box.
If required, you can choose to 'mask user input alone'. This option is ideal if confidential information is only keyed in or selected by the users themselves. To mask user input, set Masking Type to MASK USER INPUT. In this case, user input such as HTML select, check box, radio button etc., will be masked. Characters input by the user will be replaced by asterisks (*) as part of masking.
For more flexibility during masking, you can choose to mask specific page elements alone. For that, set the Masking Type to MASK CSS SELECTOR. Then, provide a comma-separated list of CSS selectors that represent each of the elements to be masked in the CSS Selector to Mask text box. This option is ideal if you deem only specific page elements as 'sensitive', and hence wish to 'shield them alone from abuse'.
In fact, if required, you can even completely disable 'Masking' during session recording and replay. Go for this option if you are confident that no element in the target web site/web application carries any private data. To disable masking, set Masking Type to MASK NONE.
Note:
For security reasons, application developers/designers may prefer to 'mark elements for masking' when designing the application itself, so that eG RUM can mask the 'marked elements' at application runtime. For this purpose, developers can use the data-egrum-mask attribute in their application code. This attribute enables developers to 'mark' elements that may contain sensitive information during the design and implementation phases. eG RUM will automatically detect and mask the content of any element with this attribute, including its child elements, at runtime. Figure 8 shows a sample usage of the data-egrum-mask attribute.
Figure 8 : Usage of the data-egrum-mask attribute
The data-egrum-mask attribute in Figure 8 marks the contents of the <div> element for masking. At application runtime therefore, eG RUM will automatically mask all data contained within that <div>.
-