Add session_name to Ask AI PostHog events - #1547
Draft
samseely wants to merge 1 commit into
Draft
Conversation
Adds the session_name property to all Ask AI PostHog events to enable tracking which chat session users are interacting with: - ask-ai-sidebar-opened-client: Added session_name from current session - ask-ai-sidebar-closed-client: Added session_name from current session - ask-ai-session-switched-client: Added session_name from target session - ask-ai-message-sent-client: Added session_name from current session - ask-ai-stream-stopped-client: Added session_name from current session For new sessions, session_name is 'New chat' until a title is generated. Resolves KNO-14289 Co-authored-by: Sam Seely <samseely@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Adds the
session_nameproperty to all Ask AI PostHog events to enable tracking which chat session users are interacting with.Changes
Updated the following PostHog events to include
session_name:ask-ai-sidebar-opened-clientAskAiContext.tsxask-ai-sidebar-closed-clientAskAiContext.tsxask-ai-session-switched-clientAskAiContext.tsxask-ai-message-sent-clientuseChatStream.tsask-ai-stream-stopped-clientuseChatStream.tsFor new sessions,
session_nameis "New chat" until a title is generated after the first assistant response.Implementation details
getCurrentSessionTitle()helper in both files to look up the session title fromchatSessionsusingcurrentChatIdopenSidebarWithPrompt), thesession_nameis explicitly set to "New chat" since the session is created before trackingask-ai-mobile-modal-opened-client) were not updated because they use Inkeep's external chat widget which has its own session management separate from our custom chat systemTesting
Resolves KNO-14289
Linear Issue: KNO-14289