Masking configurations can only be changed by account admins.
Introduction
The Data Masking tab in the Contentsquare Console lets you control what is captured during mobile Session Replay recordings without requiring a new app release. This article walks you through all available masking options, including the new screen masking capability.
Prerequisites
- You have Admin access to the Contentsquare Console.
- Minimum SDK version: CSQ SDK 1.13.0+ (Customer on legacy SDK should upgrade to our latest version to access this feature)
- Currently supported on Android, iOS, and Flutter only
- Your app implements Contentsquare screen name tracking (required for screen masking rules to match screens by name).
Accessing the Data Masking tab
- Click your profile icon in the top-right corner of the Contentsquare Console.
- Click Console.
- Select the Data masking tab.
How the Data masking tab works
The Data Masking tab gives you three types of control over Session Replay recordings:
- Content masking sets a masking level for text and images, to apply to all screens in your app.
- Full masking masks everything for one or several app or SDK versions.
- Screen masking masks or unmasks entire screens by name.
Choose your masking configuration (see below for details) and then click ‘Apply’ to modify the configuration in the SDK settings.
Content masking
This section allows you to choose among these options:
-
Use SDK rules only
Preserve all masking rules defined via the Public Masking APIs -
Mask text and images
Mask all texts and images -
Mask text only
Mask only texts (and preserve image masking defined by APIs) - Mask only selected text (texts masked via APIs, text inputs, email addresses, phone and credit card numbers, texts matching the list of configured regexes)
Screen masking
Screen masking rules let you mask or unmask entire screens by their name directly from the Console, with no app release required. Rules are pushed to the SDK at runtime and applied on-device before any data is collected.
Add screen masking rules
- Under Screen masking, click ‘Add new rule’.
-
Select a matching ‘condition’ from the dropdown:
'Is': Matches screens whose name exactly equals the value you enter.
'Contains': Matches screens whose name includes the value you enter anywhere.
'Starts with': Matches screens whose name begins with the value you enter.
'Ends with': Matches screens whose name ends with the value you enter.
- Enter the technical screen name (should be the
Component name)
If you dont know the technical screen name, use the Log Visualizer to determine the Component name of the screen you want to target, then copy it in the screen name field.
- Choose whether to Mask or Unmask screens matching this rule.
- Then click the ‘Add’ button to add the rule to your rules list.
You can add up to 500 combined screen masking and unmasking expressions for a project. This limit includes both masked and unmasked screen rules.Screens without an assigned name cannot be targeted.
Manage masking rules
You can manage, delete or edit the masking rules from the list view by clicking the ‘...’ button.
What happens after you save your changes?
The Contentsquare SDK retrieves the updated configuration when it starts. Your changes take effect after the app restarts or returns to the foreground and retrieves the latest configuration. No new app release is required.
Changes to masking rules apply to new recordings only. Previously recorded sessions are not affected.
Screen masking is applied on-device, before any data is collected or transmitted.
Masking precedence: When rules conflict, masking always takes precedence over unmasking. If a screen is masked by a screen masking rule, an unmasking rule for an individual element on that screen will have no effect.
To verify the result:
- Restart the app or bring it to the foreground.
- Open a screen that matches one of your rules.
- Generate a new Session Replay.
- Check the replay to confirm that the screen is masked or unmasked as expected.
Allow time for the replay to become available before checking the result. For platform-specific testing guidance, see the technical documentation for iOS, Android, Flutter, or React Native.
Keep the following in mind:
- Screen masking does not automatically detect personal data and does not guarantee zero personal data exposure.
- You cannot preview the effect of a configuration before saving it.
- You cannot roll back to a previous configuration from the screen masking interface.
- Shared navigation elements are not affected by screen-level rules.
- A rule might stop matching if screen names change in a later app version.
Full masking
This is primarily used if you know, or have concerns, that unnecessary personal data has been exposed, as it allows you to act quickly by applying full masking to specific app versions (and overriding your existing masking configurations).
How to apply full data masking by app and SDK versions
This is primarily used if you know, or have concerns, that unnecessary personal data has been exposed, as it allows you to act quickly by applying full masking to specific app versions (and overriding your existing masking configurations).
- From the Data Masking tab, select ‘Set up full masking’.
- To mask all versions, click the ‘Mask all eligible versions’ toggle.
- To mask only specific app or SDK versions, enter the version(s) you want to mask in the respective fields and hit the Enter/Return key on your keyboard.
Version hierarchy
Versions are compared as strings in alphabetical order, with some additional rules for numbers and “nothing”:
- Numbers (0-9) are considered before/lesser than letters (a-z)
- 4.1.1-0 < 4.1.1-alpha (because the number “0” comes before letters “alpha”)
- 4.1.1-alpha < 4.1.1-beta (because “alpha” comes before “beta” alphabetically)
- “Nothing” (e.g. a version without a suffix) is considered inferior to anything else, for example:
- 4.1.1 < 4.1.1-0 (because “nothing” comes before the suffix/anything else)
How to input multiple versions matching a pattern, or within a range
Use the asterisk ‘*’ to define multiple versions matching an exact pattern, for example:
- 4.* would include versions 4.1, 4.2, 4.3 etc, but not 4.1.1
- 4.*.* would include versions 4.1.1, 4.2.2, 4.3.3 etc, but not 4.1 or 4.2 and so on…
- 4.1.*-* would include versions 4.1-beta, 4.1.1-121, 4.1.4-1b etc
- Use the following operators to add multiple versions within a range:
| Operator | Description | Example |
| > | Strictly superior to | >4.2 includes versions greater than 4.2 such as 4.2.1, 4.2.beta, or 4.2.beta, etc |
| >= | Strictly superior or equal to | >=4.2 includes versions greater than or equal to 4.2 such as 4.2, 4.2.1, 4.2.beta, etc |
| < | Strictly inferior to | <4.2 includes versions less than 4.2 such as 4.1, 4.1.1, 4.1.beta, etc |
| <= | Strictly inferior or equal to | <=4.2 includes versions less than or equal to 4.2 such as 4.2, 4.1, 4.1.1, 4.1.beta, etc |
| || (OR) | Match if one, or both, conditions are true | range1 || range2 match if either range1 or range2 are satisfied |
| && (AND) | Match only if both conditions are true | range1 && range2 match if range1 and range2 are satisfied |
Note: Limitation for composite range operators OR and AND
We can only have 1 || or &&
range1 || range2 || range3, range1 && range2 || range3, range1 && range2 && range3 are not valid.