Repository navigation
Chat widget: Report opens and ratings for the usage dashboard - #289
Merged
Merged
Conversation
Posts chat_opened, rating_up and rating_down to the backend's /api/event, which counts them on the ThingsBoard device. Only the event name is sent; the Google Form ratings are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
website-hardwario-docs | f2fb159 | Commit Preview URL Branch Preview URL |
Oct 28 2026, 09:08 AM |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
The chat widget reports three usage events to the chatbot backend, which counts them on a ThingsBoard device (app.hardwario.cloud) for a usage dashboard:
chat_openedwhen the panel opensrating_up/rating_downwhen an answer is ratedOnly the event name is sent (
{"event": "chat_opened"}), with no question, answer or page. The endpoint is derived fromchatApiUrl(/api/chat→/api/event). The request istext/plain(no CORS preflight) withkeepalive, fire and forget: a failure never affects the chat. Ratings still go to the Google Form as before.question_sentis counted by the backend itself, so the widget doesn't send it.Depends on
Petr-Klinger-1/docs-chatbot#6, which adds
/api/event. Merge and deploy that first. Until then these requests 404 silently and nothing is counted.Testing
tscreports no errors in the widget. Only events fromhttps://docs.hardwario.comare counted, so local and preview builds won't show up on the dashboard.🤖 Generated with Claude Code