Network performance recording

Last updated:

|Edit this page

PostHog can capture network requests and their performance that occur during the browser session, so you can see the effect of slow network requests or errors on the user experience.

You can enable network recording from your project settings:

Enable network recording in your PostHog

To remove sensitive information from the URL, these network requests can be modified before being captured like so:

Web
posthog.init('<ph_project_api_key>', {
session_recording: {
maskNetworkRequestFn: (request) => {
// For example: ignoring a request entirely
if (request.url.includes('example.com')) {
return null
}
// ... or remove the query string from the URL
request.url = request.url.split('?')[0]
return request
}
}
})

Questions?

Was this page useful?

Next article

Privacy Controls

PostHog offers a range of controls to limit what data is captured by session recordings. Input elements As any input element is highly likely to contain sensitive text such as email or password, we mask these by default . You can explicitly set this to false to disable the masking. Mask or un-mask specific inputs You can control the masking more granularly by using maskInputFn to customize how the masking behaves. For example, you may want to only redact text that looks like an email address…

Read next article