Sensitive Data Protection
Cuoral's session recording system includes built-in privacy features to prevent capturing sensitive customer data. This guide explains how to block specific elements from being recorded.
Quick Start
Add the cuoral-block class to any HTML element containing sensitive information:
<div class="cuoral-block">
Credit Card: 1234-5678-9012-3456
</div>Method 1: CSS Classes (Recommended)
The easiest way to protect sensitive elements is by adding specific CSS classes directly to your HTML.
Block Classes
These classes completely block elements from being recorded:
cuoral-blocksensitive-dataconfidential
Example Usage:
<!-- Block credit card information -->
<div class="cuoral-block">
<label>Credit Card Number</label>
<input type="text" name="card-number" />
</div>
<!-- Block API keys or tokens -->
<div class="sensitive-data">
API Key: sk_live_abc123xyz789
</div>
<!-- Block confidential business data -->
<section class="confidential">
<h3>Internal Company Metrics</h3>
<p>Revenue: $1,234,567</p>
</section>Ignore Classes
These classes ignore interaction events while still showing the element structure:
cuoral-ignoreno-track
Method 2: JavaScript API
Use the Cuoral JavaScript API to dynamically add custom blocking classes.
Add Custom Block Classes
After adding custom classes, use them in your HTML:
Add Custom Sensitive Field Patterns
Define custom patterns to automatically detect and mask sensitive input fields:
Method 3: Configure Privacy Settings
Customize global privacy behavior:
Configuration Options:
maskAllInputs
boolean
true
Mask all input fields by default
autoMaskSensitivePatterns
boolean
true
Automatically detect and mask fields with sensitive names
Automatic Protection
Cuoral automatically masks these sensitive input types without any configuration:
Input Types (Always Masked):
<input type="password"><input type="tel"><input type="email"><input type="number">
Field Name Patterns (Auto-detected):
Fields with names or IDs matching these patterns are automatically masked:
passwordcredit-cardorcredit_cardcard-numberorcard_numbercvvorcvcssnsocial-securityorsocial_securityrouting-numberorrouting_numberaccount-numberoraccount_numberpin-codeorpin_codesecrettokenapi-keyorapi_key
Complete Example
Best Practices
✅ Do:
Use
cuoral-blockon container elements holding sensitive dataAdd blocking classes during development, not at runtime
Test your implementation to verify sensitive data is blocked
Block entire form sections containing payment information
Use semantic class names for your custom block classes
❌ Don't:
Rely solely on automatic masking for highly sensitive data
Use blocking classes on the
<body>or main container (blocks everything)Add block classes dynamically after page load (may miss initial recording)
Forget to document which elements need protection for your team
Verification
To verify that sensitive elements are properly blocked:
Open your browser's Developer Console
Enable debug mode:
Check console logs for blocked elements and masked fields
Review session recordings in your Cuoral dashboard
Last updated