---
title: Hide sensitive data - iOS
description: Protect sensitive data in Contentsquare by disabling text capture, masking specific views, or ignoring interactions
lastUpdated: 04 May 2026
source_url:
  html: https://docs.contentsquare.com/en/csq-sdk-ios/product-analytics/hide-sensitive-data/
  md: https://docs.contentsquare.com/en/csq-sdk-ios/product-analytics/hide-sensitive-data/index.md
---

> Documentation index: https://docs.contentsquare.com/llms.txt
> Use this file to discover all available pages before exploring further.

When using autocapture, Product Analytics collects target text information about the element that was interacted with, and text data from UI elements further up in an element's ancestry. However, some of these elements might contain sensitive user information, or Personal Data, that needs to be excluded from data capture.

There are three options for hiding sensitive data:

* Disabling text capture
* Per-view text masking
* Ignoring interactions for specific views

## Disabling all text capture

You have the option to disable text capture for all events that are automatically captured. To do this, use the `CSQ.maskTexts()` API.

```swift
CSQ.maskTexts(true)


CSQ.start()
```

## Masking text for specific views

If you don't want to disable all text capture for your app, you can take a more targeted approach of only masking text for specific views in your app that you know might contain sensitive data. When text is masked for a view, it will still have target text, but the actual text will be replaced with `****`.

```swift
let view = UIView()
CSQ.mask(view) //
view.csqMaskContents = true // UIKit
View().csqMaskContents(true) // SwiftUI, use ViewModifier


CSQ.start()
```

Note

Masking the visible text also masks the text in the accessibility label to ensure Personal Data isn't leaked when the visible text and the accessibility text are the same value.

### Ignoring all interactions for specific views

If you find that certain interactions are prone to capturing sensitive data, or that a certain interaction might indicate sensitive information about a user during analysis, you have the option of ignoring all interactions on a per-view basis.

```swift
let view = UIView()
CSQ.ignoreInteractions(view) // UIKit, by method
view.csqIgnoreInteractions = true // UIKit, by property accessor
View().csqIgnoreInteractions(true) // SwiftUI, use ViewModifier


CSQ.start()
```
