feat: add frontend analytics tracking events#97
Open
shaikhhasib wants to merge 2 commits intomainfrom
Open
Conversation
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.
Description
Added a frontend analytics client service to emit structured usage events to backend endpoint POST /v1/analytics/events.
Added page-view analytics hook integrated at the root route so route changes automatically generate page_view events.
Added analytics endpoint constant in API config for centralized routing.
Instrumented snapshot workflows in query hooks:
async snapshot create requested
sync snapshot create completed
snapshot delete
Instrumented PV Browser interactions:
search/filter query activity
load-more pagination activity
PV create/import/update/delete actions
Instrumented Tag page interactions:
tag group create/update/delete
tag create/update/delete
Motivation
This change gives us visibility into how users actually use core Squirrel UI workflows (navigation, PV management, snapshots, and tags) without adding a heavy client SDK.
Problems solved:
No consistent frontend usage telemetry for key user journeys.
No easy way to correlate user actions with backend observability events/dashboards.
Hard to measure feature adoption and workflow friction points.
Design notes:
Analytics calls are intentionally non-blocking and failure-tolerant, so never breaks user actions.