Skip to content

Instrument Pendo Track Events#112

Open
novus-by-pendo[bot] wants to merge 2 commits into
mainfrom
pendo-track-events-2z9t0
Open

Instrument Pendo Track Events#112
novus-by-pendo[bot] wants to merge 2 commits into
mainfrom
pendo-track-events-2z9t0

Conversation

@novus-by-pendo

Copy link
Copy Markdown

Summary

Adds Pendo Track Event instrumentation across 7 files to capture 10 key user interaction events. These events cover the full user lifecycle including authentication (sign-up, login, logout, auth failures), chat interactions (message sent, command executed, chat created/deleted, chat history searched), and profile management (profile updated).

Changes

  • Added user_signed_up track event in signUp.tsx onSuccess callback with oauth_provider, has_first_name, has_email, latitude, and longitude metadata
  • Added auth_failed track event in signUp.tsx onError callback with oauth_provider, auth_type, and error_message metadata
  • Added user_logged_in track event in login.tsx onSuccess callback with oauth_provider, latitude, and longitude metadata
  • Added auth_failed track event in login.tsx onError callback with oauth_provider, auth_type, and error_message metadata
  • Added user_logged_out track event in profileDropdown.tsx clearStorageAndLogout function, fired before session is cleared
  • Added message_sent track event in chat.tsx sendMessageMutation onSuccess with chat_id, has_url_context, is_command, message_length, and response_length metadata
  • Added command_executed track event in chat.tsx when isCommand is true, with chat_id, search_query, and links_opened_count metadata
  • Added chat_created track event in chatList.tsx createNewChatMutation onSuccess with chat_id, total_chat_count, and trigger_source metadata
  • Added chat_deleted track event in chatListItem.tsx deleteChatMutation onSuccess with chat_id and remaining_chat_count metadata
  • Added profile_updated track event in userDetails.tsx updateUserMutation onSuccess with has_last_name, has_email, and fields_updated metadata
  • Added debounced (500ms) chat_history_searched track event in chatList.tsx with search_term, results_count, and total_chats_count metadata
  • Added useRef for oauth_provider tracking in signUp.tsx and login.tsx to pass provider context to mutation callbacks
  • Added useRef for search debounce timer in chatList.tsx

Notes

  • All track events use optional chaining (window.pendo?.track) to safely handle cases where the Pendo agent may not be loaded
  • The oauth_provider is tracked via a useRef that is set at the start of each OAuth flow function, since the mutation callbacks don't have direct access to which provider initiated the flow
  • The chat_history_searched event is debounced at 500ms to avoid firing on every keystroke during real-time search filtering
  • The user_logged_out event is fired before pendo.clearSession() to ensure the event is associated with the correct visitor session

Generated by Novus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants