feat(web): Instrument GA4 events and user properties for telemetry tracking - #470
Open
lkang172 wants to merge 5 commits into
Open
feat(web): Instrument GA4 events and user properties for telemetry tracking#470lkang172 wants to merge 5 commits into
lkang172 wants to merge 5 commits into
Conversation
Add TelemetryConsentDialogComponent and integrate it into ChatComponent initialization to prompt the user for consent when unset. Add a slide toggle for 'Usage Metrics' to the user settings menu, and implement optimistic updates with rollback capability on network/API failure.
…acking - Create AnalyticsService to manage GA4 initialization, User Properties, and event dispatches gated by user consent. - Set adk_version and adk_language User Properties via gtag when /version API resolves. - Instrument standalone telemetry events for feature usage: chat_session_create, builder_enter_click, builder_agent_save_click, graph_view_click, trace_view_toggle, event_view_toggle, and eval_create_click. - Add comprehensive AnalyticsService unit tests.
Update TelemetryService and unit tests to request /config/telemetry instead of /api/config/telemetry to match the FastAPI route registered in dev_server.py.
lkang172
marked this pull request as ready for review
July 27, 2026 18:20
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.
This PR instruments Google Analytics 4 (GA4) telemetry events and user properties across the Web UI, fully gated by the user's telemetry consent preference.
Changes Included
analytics.service.ts):effect()onTelemetryService.telemetryEnabled().ga-disable-<MEASUREMENT_ID> = trueand drops all outbound dispatches when consent is withheld (false/null).chat_session_create: creating a new chat session inChatComponent.builder_enter_click: entering builder mode inChatComponent.builder_agent_save_click: saving an agent build inBuilderTabsComponent.graph_view_click: opening the agent structure graph inChatComponent.trace_view_toggle: navigating to the Trace tab inSidePanelComponent.event_view_toggle: navigating to the Event tab inSidePanelComponent.eval_create_click: creating a new eval case inAddEvalSessionDialogComponent.analytics.service.spec.ts) covering event/property dispatches and consent enforcement.Verification
npx ng build --configuration development.