Skip to content

Add Nedi embed source tracking#2770

Merged
ktsaou merged 2 commits intomasterfrom
nedi-source-tracking
Mar 5, 2026
Merged

Add Nedi embed source tracking#2770
ktsaou merged 2 commits intomasterfrom
nedi-source-tracking

Conversation

@ktsaou
Copy link
Copy Markdown
Member

@ktsaou ktsaou commented Mar 5, 2026

Summary

  • Sets window.AI_AGENT_UI_SOURCE = 'learn' before the Nedi widget initializes
  • The Nedi embed script (ai-agent-ui.js) reads this global variable and passes it through to the server, enabling per-source analytics (learn vs cloud-dashboard vs agent-dashboard)
  • No behavioral changes — purely adds a source identifier for tracking

Test plan

  • Verify Nedi loads normally on learn.netdata.cloud
  • Verify window.AI_AGENT_UI_SOURCE is set to 'learn' in the browser console
  • Confirm no regressions in Nedi chat functionality

Set window.AI_AGENT_UI_SOURCE = 'learn' so the Nedi embed script
can identify requests originating from the documentation site and
pass the source through to the server for analytics.
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 5, 2026

Deploy Preview for netdata-docusaurus ready!

Name Link
🔨 Latest commit a16f9ea
🔍 Latest deploy log https://app.netlify.com/projects/netdata-docusaurus/deploys/69a9faf2b54661000820bfb2
😎 Deploy Preview https://deploy-preview-2770--netdata-docusaurus.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

Docusaurus SSR runs in Node where window is not defined.
Wrap the AI_AGENT_UI_SOURCE assignment in a typeof check.
@ktsaou ktsaou merged commit 3ae4d6c into master Mar 5, 2026
6 checks passed
@ktsaou ktsaou deleted the nedi-source-tracking branch March 5, 2026 22:42
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