# Privacy Considerations

Session recording allows you to see exactly how users interact with your website, providing invaluable insights into user behavior, pain points, and opportunities for improvement.

### Privacy Considerations

Mtrix's session recording is built with privacy as a foundational principle, ensuring you gain valuable insights while respecting user privacy.

#### Data Collection Controls

Configure exactly what data is captured during session recording:

* **Input Masking**: Automatically redact text entered into form fields
* **PII Detection**: Identify and mask personally identifiable information
* **Element Exclusion**: Specify elements or classes that should never be recorded
* **Sensitive Page Exclusion**: Prevent recording on specific pages (e.g., account, payment)

```html
<!-- Examples of element exclusion using HTML attributes -->

<!-- Exclude a specific element -->
<div data-mtrix-record="false">
  This content will not be recorded
</div>

<!-- Exclude all elements with a specific class -->
<style>
  .sensitive-data {
    /* Your styles */
  }
</style>
<script>
  mtrix.init({
    // other config
    options: {
      sessionRecording: {
        excludeSelectors: ['.sensitive-data', '#payment-form']
      }
    }
  });
</script>
```

#### Consent Management

Ensure compliance with privacy regulations:

* **Consent-based Recording**: Only record sessions from users who have provided consent
* **Consent Integration**: Connect with your consent management platform (CMP)
* **Geo-based Rules**: Apply different privacy rules based on user location
* **Retention Controls**: Set automatic deletion schedules for recordings

#### Data Minimization

Follow best practices to collect only necessary information:

* **Sampling**: Record only a percentage of sessions rather than all
* **Targeted Recording**: Focus recording on specific user segments or pages
* **Truncated Recordings**: Limit recording duration to specific flows
* **Event-triggered Recording**: Start recording only after specific events

#### User Transparency

Be transparent with users about recording:

* **Privacy Policy**: Update your privacy policy to disclose session recording
* **User Notification**: Consider notifying users that their session may be recorded
* **Opt-Out Option**: Provide a clear way for users to opt out of recording
* **Data Access**: Include session recordings in user data access requests


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.mtrix.io/session-recording/editor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
