---
title: Hide sensitive data - iOS
description: Protect sensitive data in Contentsquare by disabling text capture, masking specific views, or ignoring interactions
lastUpdated: 09 November 2025
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
---

When using autocapture, Product Analytics collects target text information about the element that was interacted with, as well as 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

  ```swift
  CSQ.maskTexts(true)


  CSQ.start()
  ```

* Objective-C

  ```objective-c
  [CSQ maskTexts:YES];


  [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

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


  CSQ.start()
  ```

* Objective-C

  ```objective-c
  [CSQ mask:someUIView]; // UIView
  [someUIView csqMaskContents:YES]; // UIKit extension
  // No direct SwiftUI equivalent in Objective-C


  [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

  ```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()
  ```

* Objective-C

  ```objective-c
  [CSQ ignoreInteractions:someUIView]; // UIView
  [someUIView csqIgnoreInteractions:YES]; // UIKit extension


  [CSQ start];
  ```
