Manipulating URL/href

Hi,
when using the JavaScript SDK is there a way to replace certain parts of the url that is stored in Sentry?
We are rendering user-data in parts of the URL and want to replace that with something generic to hide user-data from Sentry but still get the insights.
Also URLs may be different e.g. /abc/jane is the same page as sample.com/abc/john but we only want to save https://sample.com/abc

Thanks,
David

Please refer to https://docs.sentry.io/data-management/sensitive-data/

I think your best bet is either to write custom code in beforeSend or use advanced data scrubbing:

https://docs.sentry.io/data-management/advanced-datascrubbing/
https://blog.sentry.io/2020/07/02/sentry-data-wash-now-offering-advanced-scrubbing/

This rule works for deleting the entire URL:

[Remove] [Anything] from [$http.url]

If you want to remove from the path segment I think you need to use a regex instead of Anything.