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/

Thanks, I already checked that but didn’t understand how to remove parts of the URL.
Could you give me a hint?

David Sporer
Geschäftsführer

david@passcreator.com
+49 151 22 60 98 71


Facebook: Passcreator | Twitter: @Passcreator | Skype: david.sporer
mediahelden GmbH | Theodor-Lipps-Str. 4 | D - 80997 München
HRB 232134 München | USt-ID DE815685987
Geschäftsführer: David Sporer, Mario C.G. Juhnke

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.