Repository navigation
Conversation
UI libraries (cio-ui-asa, cio-ui-pia) can render on a customer's own client, whose `c` tag then hides which library sent the event. The agent and product insights agent tracker methods now take an optional `uiLibrary`, sent as the `ui_library` query parameter, so the library stays identifiable without changing the client's own tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The additive implementation, declarations, and tests align with no blocking issues identified; live-API tests remain for CI.
0 open findings
What changed in this PR
Adds UI-library attribution to agent and PIA tracking events, independent of the customer’s client identifier.
Changes:
- Sends optional
uiLibraryas theui_libraryquery parameter. - Updates TypeScript declarations and JSDoc.
- Adds URL assertions across 22 tracking tests, including deprecated assistant methods.
| File | Description |
|---|---|
src/types/tracker.d.ts |
Declares the optional uiLibrary parameter. |
src/modules/tracker.js |
Adds query-parameter handling and documentation. |
spec/src/modules/tracker.js |
Checks UI-library attribution in request URLs. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
joesurf
marked this pull request as draft
October 16, 2026 13:20
Author
|
Closing: the behavioural API rejects unknown fields, so a |
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
Our UI libraries (
cio-ui-asa,cio-ui-pia) let a customer pass in their owncioClient. Events then carry that client'sctag (e.g.ciojs-client-2.94.0), so you can't tell they came from the library. We usecto measure which customers are on our UI libraries, and those customers currently show up as custom UIs.This adds an optional
uiLibraryparameter that the library sets on each call, so it identifies the library regardless of whose client sent the event:uiLibraryon the agent tracker methods (trackAgentSubmit,trackAgentResultLoadStarted,trackAgentResultLoadFinished,trackAgentResultClick,trackAgentResultView,trackAgentSearchSubmit,trackAgentButtonClick) and on all ninetrackProductInsightsAgent*methods. The deprecatedtrackAssistant*methods delegate to the agent ones, so they support it too.ui_libraryquery parameter, e.g.ui_library=cio-ui-pia-1.4.0. It goes in the URL rather than the body so it appears in ALB logs, which only record the URL.cand everything else are unchanged. It's only sent when passed, so existing callers send exactly what they did before.tracker.d.tsupdated.Notes
ok, so CI confirms this.ui_libraryis a proposal; happy to rename it. I avoidedui_libbecauseuiis already the user ID parameter.constructorio-ui-piaandconstructorio-ui-asawill passuiLibraryon every tracking call once this is released. The agentic integrations dashboard will readui_libraryfirst and fall back to thecprefix.Test plan
uiLibraryand checksui_libraryin the request URL (22 tests).npm run lintclean;npm run compileandtsdpass.libwith a stubbedfetch:ui_libraryis in the URL and the client's owncis kept.uiLibraryisn't passed.🤖 Generated with Claude Code