Menu
Important
Stay updated on React2Shell

Redacting Sensitive Data from Web Analytics Events

Last updated March 4, 2025

Sometimes, URLs and query parameters may contain sensitive data. This could be a user ID, a token, an order ID, or any other data that you don't want to be sent to Vercel. In this case, you may not want them to be tracked automatically.

To prevent sensitive data from being sent to Vercel, you can pass in the function that modifies the event before it is sent. To learn more about the function and how it can be used with other frameworks, see the @vercel/analytics package documentation.

To ignore an event or route, you can return from the function. Returning the event or a modified version of it will track it normally.

To apply changes to the event, you can parse the URL and adjust it to your needs before you return the modified event.

In this example the query parameter is removed on all events.

You can also use to allow users to opt-out of all tracking by setting a value (for example ).


Was this helpful?

supported.