Skip to content

Instrument Pendo Track Agent#2

Open
novus-by-pendo[bot] wants to merge 1 commit into
masterfrom
pendo-track-agent-m44q1
Open

Instrument Pendo Track Agent#2
novus-by-pendo[bot] wants to merge 1 commit into
masterfrom
pendo-track-agent-m44q1

Conversation

@novus-by-pendo

Copy link
Copy Markdown

Summary

Add Pendo trackAgent() instrumentation to the LLMConversationView component to track user interactions with the AI conversation agent. This enables analytics for user prompts, agent responses, and conversation restarts.

Changes

  • Added pendo.trackAgent('prompt', ...) call in handleSendMessage to track when users submit messages, including the message content and a generated messageId
  • Added pendo.trackAgent('agent_response', ...) call after successful API response to track assistant replies with the response content
  • Added pendo.trackAgent('user_reaction', ...) call with content 'retry' in handleRestart to track when users restart conversations
  • Added TypeScript declare statement for the global pendo object with trackAgent method signature
  • All trackAgent calls are guarded with typeof pendo !== 'undefined' checks to prevent runtime errors if Pendo is not loaded

Notes

  • The agentId is an empty string as specified in the agent configuration
  • No thumbs up/down feedback UI exists in this component, so user_reaction tracking is limited to the restart/retry action
  • messageIds are generated using crypto.randomUUID() for each event

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