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
}
}
})

Troubleshooting

Recording from localhost

Due the very high volume of network requests that some tools can make (for example when running hot-reload during development) PostHog does not capture network requests when running on localhost

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. You can then specify inputs types you would like to be masked. Mask or un-mask specific inputs You can control the masking more granularly by using maskInputFn to customize how the masking behaves. For example…

Read next article