-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Update user feedback to common #3467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
00e44c6
initial refactor to add http method to common
PeloWriter 82c3a0f
add dotnet
PeloWriter b34d74a
update stale link
PeloWriter 79fd2a9
modify include directory name
PeloWriter 790d67d
modify dotnet to point to aspnet and aspnetcore as needed
PeloWriter 8a98ec4
fix broken links
PeloWriter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| Make sure you've got the JavaScript SDK available: | ||
|
|
||
| ```html | ||
| <script | ||
| src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.min.js" | ||
| integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.min.js', 'sha384-base64') }}" | ||
| crossorigin="anonymous" | ||
| ></script> | ||
| ``` | ||
|
|
||
| You'll then need to call `showReportDialog` and pass in the generated event ID. | ||
| This event ID is returned from all calls to <PlatformIdentifier | ||
| name="capture-event" /> and <PlatformIdentifier name="capture-exception" />. | ||
| There is also a function called <PlatformIdentifier name="last-event-id" /> | ||
| that returns the ID of the most recently sent event. | ||
|
|
||
| ```html | ||
| <script> | ||
| Sentry.init({ dsn: "___PUBLIC_DSN___" }); | ||
| Sentry.showReportDialog({ | ||
| eventId: "{{ event_id }}", | ||
| }); | ||
| </script> | ||
| ``` | ||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| ```java | ||
| import io.sentry.Sentry; | ||
| import io.sentry.UserFeedback; | ||
|
|
||
| SentryId sentryId = Sentry.captureMessage("My message"); | ||
|
|
||
| UserFeedback userFeedback = new UserFeedback(sentryId); | ||
| userFeedback.setComments("It broke."); | ||
| userFeedback.setEmail("[email protected]"); | ||
| userFeedback.setName("John Doe"); | ||
| Sentry.captureUserFeedback(userFeedback); | ||
| ``` | ||
|
|
||
| ```kotlin | ||
| import io.sentry.Sentry | ||
| import io.sentry.UserFeedback | ||
|
|
||
| val sentryId = Sentry.captureMessage("My message") | ||
|
|
||
| val userFeedback = UserFeedback(sentryId).apply { | ||
| comments = "It broke." | ||
| email = "[email protected]" | ||
| name = "John Doe" | ||
| } | ||
| Sentry.captureUserFeedback(userFeedback) | ||
| ``` |
10 changes: 0 additions & 10 deletions
10
...common/enriching-events/user-feedback.mdx → ...s/user-feedback/sdk-api-example/apple.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| ```java | ||
| import io.sentry.Sentry; | ||
| import io.sentry.UserFeedback; | ||
|
|
||
| SentryId sentryId = Sentry.captureMessage("My message"); | ||
|
|
||
| UserFeedback userFeedback = new UserFeedback(sentryId); | ||
| userFeedback.setComments("It broke."); | ||
| userFeedback.setEmail("[email protected]"); | ||
| userFeedback.setName("John Doe"); | ||
| Sentry.captureUserFeedback(userFeedback); | ||
| ``` | ||
|
|
||
| ```kotlin {tabTitle:Kotlin} | ||
| import io.sentry.Sentry | ||
| import io.sentry.UserFeedback | ||
|
|
||
| val sentryId = Sentry.captureMessage("My message") | ||
|
|
||
| val userFeedback = UserFeedback(sentryId).apply { | ||
| comments = "It broke." | ||
| email = "[email protected]" | ||
| name = "John Doe" | ||
| } | ||
| Sentry.captureUserFeedback(userFeedback) | ||
| ``` |
36 changes: 0 additions & 36 deletions
36
src/platforms/android/common/enriching-events/user-feedback.mdx
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,36 +3,75 @@ title: "User Feedback" | |
| sidebar_order: 105 | ||
| redirect_from: | ||
| - /learn/user-feedback/ | ||
| description: "Learn more about the embeddable JavaScript widget, which requests and collects the user information when an event occurs. Sentry pairs the feedback with the original event, giving you additional insight into issues." | ||
| description: "Learn more about collecting user feedback when an event occurs. Sentry pairs the feedback with the original event, giving you additional insight into issues." | ||
| notSupported: | ||
| - android | ||
| - apple | ||
| - native | ||
| - native.breakpad | ||
| - native.crashpad | ||
| - native.minidumps | ||
| - native.wasm | ||
| - native.ue4 | ||
| - dart | ||
| - flutter | ||
| - ruby | ||
| --- | ||
|
|
||
| When a user experiences an error, Sentry provides the ability to collect additional feedback. This type of feedback is useful when you may typically render a plain error page (the classic `500.html`). | ||
| When a user experiences an error, Sentry provides the ability to collect additional feedback. You can collect feedback according to the method supported by the SDK. | ||
|
|
||
| To collect feedback, use the embeddable JavaScript widget, which requests and collects the user's name, email address, and a description of what occurred. When feedback is provided, Sentry pairs the feedback with the original event, giving you additional insights into issues. | ||
| <PlatformSection supported={["java", "apple", "android"]} > | ||
|
|
||
| ## User Feedback API | ||
|
|
||
| The user feedback API provides the ability to collect user information when an event occurs. You can use the same programming languge you have in your app to send user feedback. In this case, the SDK creates the HTTP request so you don't have to deal with posting data via HTTP. | ||
|
|
||
| Sentry pairs the feedback with the original event, giving you additional insight into issues. Sentry needs the `eventId` to be able to associate the user feedback to the corresponding event. To get the `eventId`, for example, you can use the <PlatformLink to="/configuration/options/#before-send">beforeSend</PlatformLink> or the return value of the methods capturing an event. | ||
|
|
||
| <PlatformContent includePath="user-feedback/sdk-api-example" /> | ||
|
|
||
| </PlatformSection> | ||
|
|
||
| <PlatformSection supported={["dotnet"]}> | ||
|
|
||
| ## Use the .NET SDK | ||
|
|
||
| <Note> | ||
|
|
||
| User Feedback for **[ASP.NET](/platforms/dotnet/guides/aspnet/enriching-events/user-feedback/#integration)** or **[ASP.NET Core](/platforms/dotnet/guides/aspnetcore/enriching-events/user-feedback/#integration)** supply integrations specific to supporting those SDKs. | ||
|
|
||
| </Note> | ||
|
|
||
| You can create a form to collect the user input in your prefered framework, and use the SDK's API to send the information to Sentry. You can also use the widget, as described below. If you'd prefer an alternative to the widget or do not have a JavaScript frontend, you can use this API or a [Web API](/api/projects/submit-user-feedback/). | ||
|
|
||
| ```csharp {tabTitle:C#} | ||
| using Sentry; | ||
|
|
||
| var eventId = SentrySdk.CaptureMessage("An event that will receive user feedback."); | ||
|
|
||
| SentrySdk.CaptureUserFeedback(eventId, "[email protected]", "It broke.", "The User"); | ||
| ``` | ||
|
|
||
| ```fsharp {tabTitle:F#} | ||
| open Sentry | ||
|
|
||
| let eventId = SentrySdk.CaptureMessage("An event that will receive user feedback.") | ||
|
|
||
| SentrySdk.CaptureUserFeedback(eventId, "[email protected]", "It broke.", "The User") | ||
| ``` | ||
|
|
||
| </PlatformSection> | ||
|
|
||
| <PlatformSection notSupported={["android", "apple", "java", "native", "dart", "flutter", "ruby"]}> | ||
|
|
||
| ## Embeddable JavaScript Widget | ||
|
|
||
| Our embeddable JavaScript widget is useful when you may typically render a plain error page (the classic `500.html`) on your website. | ||
|
|
||
| To collect feedback, the widget requests and collects the user's name, email address, and a description of what occurred. When feedback is provided, Sentry pairs the feedback with the original event, giving you additional insights into issues. | ||
|
|
||
| The screenshot below provides an example of the User Feedback widget, though yours may differ depending on your customization: | ||
|
|
||
|  | ||
|
|
||
| ## Collecting Feedback | ||
| ### Integration | ||
|
|
||
| To integrate the widget, you'll need to be running version 2.1 or newer of our JavaScript SDK. The widget authenticates with your public DSN, then passes in the Event ID that was generated on your backend. | ||
|
|
||
| **If you'd prefer an alternative to the widget or do not have a JavaScript frontend, you can use the [User Feedback API](https://docs.sentry.io/api/projects/post-project-user-reports/).** | ||
|
|
||
| <PlatformContent includePath="user-feedback-example-widget" /> | ||
| <PlatformContent includePath="user-feedback/example-widget" /> | ||
|
|
||
| ## Customizing the Widget | ||
|
|
||
|
|
@@ -60,3 +99,9 @@ An override for Sentry’s automatic language detection (e.g. `lang=de`) | |
| | `errorFormEntry` | Some fields were invalid. Please correct the errors and try again. | | ||
| | `successMessage` | Your feedback has been sent. Thank you! | | ||
| | `onLoad` | n/a | | ||
|
|
||
| ## User Feedback API | ||
|
|
||
| If you'd prefer an alternative to the widget or do not have a JavaScript frontend, you can use the [User Feedback API](/api/projects/submit-user-feedback/). | ||
|
|
||
| </PlatformSection> | ||
70 changes: 0 additions & 70 deletions
70
src/platforms/dotnet/common/enriching-events/user-feedback.mdx
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-32.7 KB
src/platforms/dotnet/common/enriching-events/user_feedback_widget.png
Binary file not shown.
36 changes: 0 additions & 36 deletions
36
src/platforms/java/common/enriching-events/user-feedback.mdx
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a
notethat for users using ASP.NET or ASP.NET Core, there's a specific content for this?We have overrides for this on those that include a proper snippet:
https://docs.sentry.io/platforms/dotnet/guides/aspnet/enriching-events/user-feedback/#integration
https://docs.sentry.io/platforms/dotnet/guides/aspnetcore/enriching-events/user-feedback/#integration
I'm just afraid folks land on .NET and click on User Feedback on the left without understanding that there's a "better" content if they are in fact using a web technology.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep. The design does that now.
ASP.NET - https://sentry-docs-kl81mjezf.sentry.dev/platforms/dotnet/guides/aspnet/enriching-events/user-feedback/#integration
ASP.NET Core - https://sentry-docs-kl81mjezf.sentry.dev/platforms/dotnet/guides/aspnetcore/enriching-events/user-feedback/#integration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that in here: https://sentry-docs-kl81mjezf.sentry.dev/platforms/dotnet/enriching-events/user-feedback/
There's no indication that this snippet:

Is not what you need if you're on ASP.NET or ASP.NET Core (90% of all Web Apps in .NET fall into one of these two)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, got it. Yes, we can do that.