[BACKEND] ITERATION 1 GitLab Duo Chat persistent User Feedback, Snowplow GraphQL mutation
Overview
We need to improve the way user feedback from Duo Chat responses is persistently saved on gitlab.com. Currently, the client-side code directly posts user feedback to Snowplow as seen in this Codepointer.
Issues with the Current Approach
User feedback is not tracked when Snowplow requests are blocked on the client (e.g., due to 'Do Not Track' browser settings, ad blockers, etc.).
Proposed Solution:
To ensure a more reliable tracking of user feedback, the following steps are proposed:
- Provide a GraphQL mutation that the client-side can use to submit user feedback.
- The Backend Code should once the mutation was received go ping Snowplow directly, following the implementation example in the CodePointer mentioned above.
Example Mutation:
mutation trackDuoUserFeedback($input: DuoUserFeedbackInput!) {
trackDuoUserFeedback(input: $input) {
errors
}
}
As input the Backend can expect the following Object:
{
action: 'click_button',
label: 'response_feedback',
property: feedbackChoices,
extra: {
improveWhat: 'example userinput'
didWhat: 'example userinput'
prompt_location: 'after_content',
}
Keep in mind, the mutation Object includes user generated input and needs to be sanitized.
Edited by Jannik Lehmann