@sentry/browser
4.3.2
9.0.0
Our application uses information after a # as part of unique URLs, so it is important this is included in the base url for errors logged. Is there a setting to turn this on?
Ex: mysite.com/#/display/12345
We need the entire above url to be the url of the error, as it represents the actual page the user was on.
@pnewell in what place exactly? url
tag in the Sentry UI, eg. here?
If so, there's no way in the SDK itself to set it automatically, but you can override both, request url and tag like so:
// preferably on every route change
Sentry.configureScope(scope => {
scope.setTag('url', document.location.href)
});
And if you need to override request parameters as well
Sentry.init({
dsn: '__YOUR_DSN__',
beforeSend(event) {
event.request = event.request || {};
event.request.url = document.location.href;
return event;
}
});
Main question was answered. Feel free to reopen if still need any help. Cheers!
I tried the beforeSend code but my new Issues still only have the base url:
@pnewell can you provide a link to the event itself? (I will be able to see it as a Sentry employee, so full link is fine)
Closing due to inactivity
Most helpful comment
@pnewell in what place exactly?
url
tag in the Sentry UI, eg. here?If so, there's no way in the SDK itself to set it automatically, but you can override both, request url and tag like so:
And if you need to override request parameters as well