User Feedback

Sentry provides the ability to collect additional feedback from the user upon hitting an error. This is primarily useful in situations where you might generally render a plain error page (the classic 500.html). To collect the feedback, an embeddable JavaScript widget is available, which can then be shown on demand to your users.

The following pieces of information are requested and collected:

  • The user’s name
  • The user’s email address
  • A description of what happened

When feedback is collected, Sentry will pair it up with the original event giving you additional insights into issues.

Below is an example of what the User Feedback widget could look like, depending on your customization.

An example of a user feedback widget with text boxes for user name, email, and additional details about the break.

Collecting Feedback

The integration process consists of running our JavaScript SDK (2.1 or newer), authenticating with your public DSN, and passing in the client-side generated Event ID:

Make sure you've got the JavaScript SDK available:

<script src="{VERSION}/bundle.min.js" integrity="{CHECKSUM}" crossorigin="anonymous"></script>

With ASP.NET Core MVC, the Error.cshtml razor page:

@using Sentry
@inject IOptions<SentryAspNetCoreOptions> SentryOptions

@if (SentrySdk.LastEventId != Guid.Empty)
        Sentry.init({ dsn: '@(SentryOptions.Value.Dsn)' });
        Sentry.showReportDialog({ eventId: '@SentrySdk.LastEventId' });

If you configured Sentry without the Dependency Injection (for example, without UseSentry()) you can also configure the SDK using a hard-coded DSN in the template:

Sentry.init({ dsn: 'PUBLIC_DSN' });

If you don't want to use Sentry's native widget, you can also send feedback using our User Feedback API.

Customizing the Widget

Several parameters are available to customize the widget, specifically for localization. All options can be passed through the showReportDialog call.

An override for Sentry’s automatic language detection (e.g. lang=de)

eventIdManually set the id of the event.
dsnManually set dsn to report to.
userManually set user data [an object with keys listed above].
user.emailUser's email address.
user.nameUser's name.
lang[automatic]override for Sentry’s language code
titleIt looks like we’re having issues.
subtitleOur team has been notified.
subtitle2If you’d like to help, tell us what happened below. – not visible on small screen resolutions
labelCommentsWhat happened?
errorGenericAn unknown error occurred while submitting your report. Please try again.
errorFormEntrySome fields were invalid. Please correct the errors and try again.
successMessageYour feedback has been sent. Thank you!
You can edit this page on GitHub.