Home Guides Visitor Recording Privacy
Privacy & Compliance

Website Visitor Recording: Privacy & Compliance (GDPR)

Session recording is one of the most powerful tools for understanding user behavior—but it comes with real privacy responsibilities. This guide covers exactly how to use visitor recording while respecting user privacy, meeting GDPR and CCPA requirements, and building trust with your users.

15 min read Updated April 2026 By Inspectlet Team
Key Takeaways
  • Session recording can be GDPR-compliant when you apply data minimization, offer opt-outs, and document your lawful basis
  • Modern recording tools provide granular privacy controls—from masking individual elements to censoring all inputs globally
  • Password fields are automatically excluded by Inspectlet’s tracking script and can never be captured
  • Consent implementation can range from conditional script loading to cookie-banner integration, depending on your legal basis
  • Sector-specific regulations (HIPAA, PCI, FERPA) may impose additional requirements beyond GDPR and CCPA
Disclaimer

This guide is for informational purposes and does not constitute legal advice. Privacy regulations vary by jurisdiction, and their interpretation evolves over time. Consult a qualified privacy attorney for advice specific to your organization and users.

The Privacy Landscape for Session Recording

Session recording captures how real users interact with your website—clicks, scrolls, mouse movements, form interactions, and page navigation. This data is extraordinarily valuable for improving user experience, diagnosing bugs, and optimizing conversions. But because it involves observing user behavior, it sits squarely within the scope of modern privacy regulations.

Three regulatory frameworks matter most for organizations using session recording tools:

The good news: these regulations don’t prohibit session recording. They require you to do it responsibly—with transparency, purpose limitation, data minimization, and appropriate safeguards. A privacy-conscious recording setup often produces better data anyway, because it forces you to focus on the behavioral signals that actually matter rather than hoarding raw input data you’ll never use.

What Session Recording Actually Captures (and Doesn’t)

Understanding what a session recording tool collects is the first step toward a compliant implementation. Session recording is not a screen capture or video feed. Instead, it records structured interaction events—mouse coordinates, scroll positions, click targets, page changes—and reconstructs a visual playback from those events.

Here’s what a typical session recording includes:

What session recording does not capture (when configured properly):

GDPR Compliance for Session Recording

GDPR requires a lawful basis for processing personal data, limits the data you can collect to what is necessary, and gives users specific rights over their data. Here’s how each principle applies to session recording.

Lawful Basis: Legitimate Interest vs. Consent

Under GDPR, you need one of six lawful bases to process personal data. For session recording, two are relevant:

Legitimate interest (Article 6(1)(f)) is the basis most commonly used for analytics and session recording. The argument: your organization has a legitimate interest in understanding how users interact with your website in order to improve it. To rely on legitimate interest, you must:

  1. Conduct a Legitimate Interest Assessment (LIA) documenting why recording is necessary, what data you collect, and how you protect user rights
  2. Demonstrate that the user’s rights and expectations are not overridden by your interest
  3. Apply data minimization—collect only what you need and mask everything else
  4. Provide a clear and accessible opt-out mechanism

Consent (Article 6(1)(a)) is the most conservative approach and is required by some interpretations of the ePrivacy Directive for non-essential cookies. If you choose consent as your lawful basis:

Data Minimization

GDPR’s data minimization principle (Article 5(1)(c)) requires that you collect only what is adequate, relevant, and limited to what is necessary. For session recording, this means:

Right to Erasure

Under Article 17, users can request deletion of their personal data. If a user contacts you requesting erasure, you need a process to identify and delete any session recordings associated with that user. This is easier when recordings are associated with a user identifier (such as a logged-in user ID) and harder when the only identifier is an anonymous session cookie.

Data Processing Agreements

When you use a third-party session recording tool, that tool is a data processor under GDPR, and you are the data controller. Article 28 requires a written Data Processing Agreement (DPA) between controller and processor. Your DPA should address where data is stored, who has access, security measures, sub-processors, and breach notification procedures.

CCPA Compliance for Session Recording

The CCPA takes a different approach from GDPR. Rather than requiring opt-in consent, it gives California consumers the right to know what data is collected, the right to delete it, and the right to opt out of sale of their personal information.

For session recording, CCPA compliance typically involves:

The CPRA (effective January 2023) adds the right to correct inaccurate data and introduces the concept of “sensitive personal information,” which requires additional protections. Session recordings that capture sensitive fields (health information, financial data) fall under heightened scrutiny.

Inspectlet’s Built-In Privacy Controls

Inspectlet provides a layered set of privacy controls that let you tailor recording to collect only the behavioral data you need. Here’s a detailed walkthrough of each control.

Automatic Protections

Inspectlet’s tracking script has a hard-coded rule: password fields are never recorded. Any <input type="password"> element is automatically excluded. No keystrokes, no masked values, no data at all. This protection cannot be overridden—it is baked into the script itself, not a configurable setting.

Element-Level Masking with CSS Classes

You can control exactly how individual elements are handled during recording using CSS classes:

Exclude an element entirely with inspectletIgnore:

<!-- This element will not be captured in the recording at all -->
<div class="inspectletIgnore">
    <input type="text" name="ssn" placeholder="Social Security Number">
</div>

Any element with the inspectletIgnore class is completely excluded from the recording. The recording will show a blank space where the element exists. This is the strongest protection—use it for elements containing highly sensitive data like government IDs, financial account numbers, or health information.

Mask element content with inspectlet-sensitive:

<!-- Input values will be replaced with X characters in the recording -->
<input type="text" name="email" class="inspectlet-sensitive"
       placeholder="Email address">

<!-- Text content is also masked -->
<span class="inspectlet-sensitive">John Smith</span>

The inspectlet-sensitive class replaces the content of the element with X characters in the recording. The element is still visible in playback (so you can see that the user interacted with the email field), but the actual value they typed is never transmitted or stored. This is ideal for fields like email, name, phone number, and address—where you want to see the interaction pattern without the personal data.

Whitelist specific elements with inspectlet-whitelist:

<!-- When global censoring is ON, this field is still recorded in clear text -->
<select class="inspectlet-whitelist" name="country">
    <option>United States</option>
    <option>United Kingdom</option>
</select>

The inspectlet-whitelist class is used in combination with global input censoring (see below). When you enable censor-all mode, every input is masked by default—but elements with inspectlet-whitelist are exempted. This is useful for non-sensitive fields like country selectors, language preferences, or sort options where the values help you understand user behavior.

Global Input Censoring

Inspectlet’s dashboard includes a Censor All Inputs toggle for each site. When enabled, every input field, textarea, and select element on your site is masked by default—values are replaced with placeholder characters in the recording. This is the most privacy-conservative approach: you start from a position of “record nothing” and selectively whitelist the specific fields where you need to see values.

This approach aligns directly with GDPR’s data minimization principle. Rather than auditing every form on your site and adding masking classes to sensitive fields (risking that you miss one), you mask everything and then make deliberate exceptions.

Recommended Approach

Enable Censor All Inputs as your default, then add inspectlet-whitelist only to fields where the value is non-sensitive and provides meaningful analytical insight (e.g., dropdown selectors for categories, quantity fields, search queries). This “deny by default, allow by exception” model is the gold standard for data minimization.

IP Blocking

Inspectlet’s site settings include an IP blocking feature where you can enter IP address patterns with wildcard support. Visitors whose IP matches a blocked pattern are not recorded at all. Common uses include:

Recording Frequency

A percentage slider (0–100%) in your site settings controls what fraction of visitors are recorded. If your site has high traffic, recording 10–20% of sessions gives you more than enough data for analysis while significantly reducing the volume of personal data you process. This directly supports data minimization—you collect only the sample size you need.

Opt-Out Pages

Inspectlet provides two levels of opt-out for visitors who do not wish to be recorded:

Both opt-out pages clearly explain what the cookie does and provide buttons to opt out or opt back in. You can link to these pages from your privacy policy or cookie notice to give users direct control.

XHR Recording Controls

Inspectlet can optionally record AJAX request and response payloads. This is powerful for debugging (you can see exactly what API data was returned during a user’s session), but it can also capture sensitive data if your API responses include personal information. A toggle in your site settings controls whether XHR payloads are saved. When disabled, network requests are not logged in the recording.

If you enable XHR recording, audit your API responses to ensure they don’t return data you wouldn’t want in a recording (e.g., full user profiles with email and phone number in the JSON response).

Page and Visitor Targeting

Inspectlet’s targeting tool lets you define rules for which pages and visitor segments are recorded. You can whitelist specific pages (record only the checkout flow) or blacklist pages that contain sensitive content (exclude the account settings page). Combined with visitor-segment rules, this gives you precise control over the scope of your recording.

Additional Controls

Privacy Policy Requirements

Both GDPR and CCPA require transparency about your data processing activities. If you use session recording, your privacy policy should disclose:

  1. That you use session recording technology and name the provider (e.g., “We use Inspectlet for session recording and analytics”)
  2. What data is collected — mouse movements, clicks, scrolls, page views, form interactions (noting that sensitive fields are masked)
  3. The purpose — improving website usability, diagnosing errors, optimizing conversion funnels
  4. The lawful basis (for GDPR) — legitimate interest in improving the user experience, or consent if that’s your chosen basis
  5. Data retention period — how long recordings are stored before deletion
  6. How users can opt out — link to the Inspectlet opt-out page and describe any cookie-banner controls
  7. Third-party data sharing — clarify that session data is processed by your recording provider and note any sub-processors

If your legal basis is consent (or if the ePrivacy Directive requires cookie consent for your analytics tools), you need to integrate session recording with your consent management platform. Here are the two most common patterns.

Conditional Script Loading

The simplest approach: don’t load the Inspectlet tracking script until the user has consented to analytics cookies.

<!-- Only load Inspectlet after analytics consent is granted -->
<script>
window.addEventListener('analytics_consent_granted', function() {
    window.__insp = window.__insp || [];
    __insp.push(['wid', YOUR_SITE_ID]);
    var ldinsp = function(){
        if(typeof window.__inspld != "undefined") return;
        window.__inspld = 1;
        var insp = document.createElement('script');
        insp.type = 'text/javascript';
        insp.async = true;
        insp.id = "inspsync";
        insp.src = ('https:' == document.location.protocol ? 'https' : 'http')
            + '://cdn.inspectlet.com/inspectlet.js?wid=' + YOUR_SITE_ID
            + '&r=' + Math.floor(new Date().getTime()/3600000);
        var x = document.getElementsByTagName('script')[0];
        x.parentNode.insertBefore(insp, x);
    };
    setTimeout(ldinsp, 0);
});
</script>

This pattern ensures zero data is collected before consent. The recording script simply does not exist on the page until the consent event fires.

Most cookie consent platforms (Cookiebot, OneTrust, Osano, etc.) support categorized consent. Map Inspectlet to your “Analytics” or “Performance” category, then gate script loading on that category’s consent status:

<!-- Example with a generic consent manager -->
<script>
if (consentManager.hasConsent('analytics')) {
    // User has already consented — load immediately
    loadInspectlet();
} else {
    // Wait for consent
    consentManager.on('consent_update', function(categories) {
        if (categories.analytics) {
            loadInspectlet();
        }
    });
}

function loadInspectlet() {
    window.__insp = window.__insp || [];
    __insp.push(['wid', YOUR_SITE_ID]);
    var insp = document.createElement('script');
    insp.type = 'text/javascript';
    insp.async = true;
    insp.src = 'https://cdn.inspectlet.com/inspectlet.js?wid='
        + YOUR_SITE_ID + '&r=' + Math.floor(new Date().getTime()/3600000);
    var x = document.getElementsByTagName('script')[0];
    x.parentNode.insertBefore(insp, x);
}
</script>
Implementation Tip

If you rely on legitimate interest rather than consent, you can load the tracking script immediately but should still respect your cookie banner’s opt-out. If a user declines analytics cookies, stop recording for that session. The Inspectlet opt-out page provides a fallback mechanism.

Industry-Specific Considerations

Beyond GDPR and CCPA, certain industries face additional privacy regulations that affect how session recording can be used.

Healthcare (HIPAA)

If your website collects Protected Health Information (PHI)—patient names, diagnoses, appointment details, insurance information—HIPAA applies. Session recordings that capture PHI constitute an electronic health record disclosure. To use session recording in healthcare:

Financial Services

Banking and financial websites handle account numbers, balances, transaction histories, and Social Security numbers. In addition to GDPR/CCPA:

Education (FERPA)

Educational institutions handling student records must comply with FERPA. Student grades, disciplinary records, and enrollment information are protected. If your educational platform uses session recording:

E-Commerce (PCI DSS)

Any site that processes payment card data must comply with PCI DSS. Session recording of checkout pages requires special care:

Building a Privacy-First Recording Strategy

A privacy-first approach isn’t just about compliance—it’s a better way to use session recording. Here’s a framework:

  1. Define your questions first. Before enabling recording, identify the specific questions you want to answer. “Why are users abandoning the checkout?” is a good question. “Let’s record everything and see what happens” is not. Purpose limitation is a core GDPR principle, and it also makes your analysis more focused and productive.
  2. Start with maximum restrictions. Enable Censor All Inputs. Set recording frequency to 10–20%. Disable XHR recording. Use page targeting to record only the pages relevant to your analysis. You can always loosen restrictions later if you need more data—but it’s much harder to retroactively mask data you’ve already collected.
  3. Audit your forms and pages. Walk through every page that will be recorded and identify elements that display or collect personal data. Apply inspectletIgnore or inspectlet-sensitive classes as appropriate.
  4. Document everything. Maintain a record of your privacy settings, your lawful basis assessment, the pages you record, and the data you mask. This documentation is required under GDPR (accountability principle, Article 5(2)) and invaluable if you receive a data subject request or regulatory inquiry.
  5. Review periodically. As your site evolves, new pages and forms are added. Include session recording privacy in your regular security and compliance reviews. A new feature that adds a health questionnaire form needs recording controls before it ships, not after.

Privacy Controls Built In

Inspectlet provides element masking, global censoring, IP blocking, opt-out pages, and more—all configurable from your dashboard.

See Plans

Checklist: Privacy Audit for Session Recording

Use this checklist to audit your session recording implementation. Address each item to build a compliant, privacy-respecting setup.

Legal Foundation

Technical Controls

User Rights

Ongoing Governance

Frequently Asked Questions

Does session recording require cookie consent under GDPR?

It depends on your lawful basis. If you rely on legitimate interest for the processing itself, you may still need cookie consent under the ePrivacy Directive if your recording tool sets non-essential cookies. Many organizations include session recording under their “Analytics” cookie category. If you rely on consent as your GDPR lawful basis, you definitively need cookie consent before loading the script.

Is IP address considered personal data under GDPR?

Yes. The GDPR explicitly classifies IP addresses as personal data because they can be used (sometimes in combination with other data) to identify an individual. This is one reason IP blocking and recording frequency controls are important—they reduce the volume of IP addresses you process.

Can I use session recording on a site with users under 16?

GDPR provides heightened protection for children’s data (Article 8). If your site is directed at or knowingly used by children, you need parental consent for data processing. In practice, most organizations that serve minors either exclude authenticated minor user sessions from recording or avoid session recording on child-directed content entirely.

What should I do if I accidentally record sensitive data?

Delete the affected recordings as soon as possible, document the incident, and add the appropriate masking classes (inspectletIgnore or inspectlet-sensitive) to prevent recurrence. If the data involved constitutes a personal data breach under GDPR (risk to individuals’ rights and freedoms), you may need to notify your supervisory authority within 72 hours.

Does Inspectlet work with Google Consent Mode?

You can implement conditional loading of the Inspectlet script based on Google Consent Mode signals. When the analytics_storage consent type is granted, load the Inspectlet script; when denied, do not load it. This gives you a unified consent experience across all your analytics tools.

Record With Confidence

Inspectlet gives you the behavioral insights you need with the privacy controls your users deserve. Masking, censoring, opt-outs, and targeting—all from your dashboard.

Start Free