Why personal data handling matters
Error data helps you investigate technical problems, but it can also contain personal data. URLs, request and response details, JavaScript messages, Custom Errors, and Console Messages can expose information that your organization does not want to collect or share.
Configure masking before you enable Network details or API error troubleshooting details. Collect only the information you need for the investigation and use encryption where it is available.
Where personal data can appear in Errors
| Error data | How personal data can appear | Recommended actions to take |
| API error URLs | A path segment or query parameter can contain a user ID, account number, email address, or other identifier. |
Use the Network requests - Mask URLs template or the networkRequest:maskUrls command. Query strings are removed from collected API error URLs. See this article for reference. |
| Network detail URLs | Network requests displayed in the Session Replay waterfall can contain identifiers in the URL path. | Apply URL masking patterns before collecting Network details. |
| Request and response headers | Headers can contain cookies, authorization data, or identifiers. | Do not collect sensitive headers. You should encrypt headers that contain personal data |
| Request and response bodies | A body can contain form values, account details, tokens, or other user-provided information. | Encryption/decryption key should be set up. Use JSON path to collect only specific elements instead of the entire body. |
| JavaScript errors | Error messages or file names can include email addresses, URLs, or values from inline scripts. |
Avoid sending personal data in error messages. Review the automatic protections described below. Apply URL masking if needed |
| Custom Errors | A message or Custom Attribute can include user-entered text or an identifier. | Use generic messages and stable categories. Do not send free-form personal data. |
| Console Messages | Debug output can include URLs, identifiers, request payloads, or user-entered values. | Collect only the required log levels and remove sensitive output before it reaches the console. |
The encryption / decryption process uses a combinaison of a Public key and a Private key. Refer to this article for usage recommendations about encryption method.
Automatic protections
Contentsquare applies automatic protections to supported data types. These protections do not replace project-specific masking rules:
- Email addresses are masked in supported error messages and URL data.
- Common token patterns, such as JWT and OAuth tokens, are protected in supported URL data when the relevant project protection is enabled.
- Query strings are removed from collected API error URLs.
- Form field values are anonymized from supported JavaScript error messages.
Full request and response bodies, query parameters, and response-body elements collected for troubleshooting must be encrypted. Some headers and selected request-body elements can be collected without encryption. Response-body elements collected for analysis are unencrypted. Only collect a field without encryption if you’ve verified that it contains no personal data.
Protection behavior depends on the data type, implementation, and selected data source. Test the result with representative values before enabling a rule broadly.
Mask API and Network detail URLs
Use the Network requests PII masking snippets when a URL path contains personal data.
- In the Console, find the Experience monitoring settings tab
- Find the Network requests PII masking section.
- Click Configure.
- Click Add snippet.
- Enter a Snippet name.
- Select the Network requests - Mask URLs template.
- Review Masking best practices.
- Enter a URL pattern.
- Select the Before Pageview trigger.
- Click Save.
The template description explains that it obfuscates personal data from collected URLs for API Errors and Network Details.
Write a URL pattern
A URL pattern identifies the path segment that contains personal data. Replace the sensitive value with a variable that starts with a colon.
For example:
api/clients/:client_id/users/:user_nameUse a literal segment at the beginning of the pattern when possible. Test the pattern against the URLs generated by your application before you enable it for production data.
Use the dedicated tag command
You can also define URL masking in your website implementation. Add the command before the Contentsquare tag starts collecting data.
Use the Personal data handling Technical Documentation for the current command syntax and implementation requirements.
Protect API troubleshooting details
When you create an API error collection rule:
- Collect only the headers, body elements, and query parameters required for the investigation.
- Use encryption for request or response values that can contain personal data.
- Do not configure unencrypted body elements that can contain personal data.
- Review URL masking before you collect API errors or Network details.
The response body elements used for analysis must not contain personal data when they are collected unencrypted.
Protect Custom errors and Console messages
Before you save a Custom error snippet or enable Console messages:
- Remove names, account numbers, and other identifiers from messages.
- Do not use free-form user input as a Custom Attribute.
- Select only the Console message log levels required for your investigation.
- Check third-party scripts and libraries that write to the console.
If personal data is collected unexpectedly
Stop or narrow the collection setting that captures the data. Preserve the information needed to identify the affected project, environment, data source, and collection rule, then contact your Contentsquare support contact and follow your organization's privacy incident process.