Skip to content

Add PostHog tracking to Expert modal#4755

Open
dimitrieh wants to merge 1 commit intomainfrom
feature/expert-modal-posthog-tracking
Open

Add PostHog tracking to Expert modal#4755
dimitrieh wants to merge 1 commit intomainfrom
feature/expert-modal-posthog-tracking

Conversation

@dimitrieh
Copy link
Copy Markdown
Contributor

@dimitrieh dimitrieh commented Mar 24, 2026

Description

Instruments the Expert AI chat modal (ai-expert-modal.js) with PostHog analytics. The modal currently has zero capture() calls despite being a key user touchpoint.

Events added:

Event When Properties
expert-modal-opened Modal opens has_prompt, page
expert-modal-closed Modal closes messages_sent, page
expert-message-sent User sends a message (button or Enter) message_index, page
expert-app-link-clicked User clicks outbound link to app url, page

Uses the existing capture() wrapper from base.njk. No new dependencies or libraries.

PostHog setup (Production):

Related Issue(s)

Findings from FlowFuse Expert tracking audit (internal research).

Checklist

  • I have read the contribution guidelines
  • I have considered the performance impact of these changes
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
  • For blog PRs, an Art Request has been created (instructions)

Instrument the Expert AI chat modal with four PostHog events:
- expert-modal-opened: tracks when modal opens, with prompt context
- expert-modal-closed: tracks close with message count for engagement
- expert-message-sent: tracks each message with index for depth
- expert-app-link-clicked: tracks outbound clicks to app.flowfuse.com

Uses the existing capture() wrapper. No new dependencies.
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 24, 2026

Deploy Preview for flowforge-website ready!

Name Link
🔨 Latest commit f8a63e5
🔍 Latest deploy log https://app.netlify.com/projects/flowforge-website/deploys/69c2e3dcb6f9580008d7084e
😎 Deploy Preview https://deploy-preview-4755--flowforge-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 89 (🔴 down 2 from production)
Accessibility: 81 (no change from production)
Best Practices: 100 (no change from production)
SEO: 91 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@dimitrieh
Copy link
Copy Markdown
Contributor Author

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.

1 participant