Repository navigation
Add Analytics page name callback support - #2808
Open
Radhika Gupta (rads-1996) wants to merge 1 commit into
Open
Radhika Gupta (rads-1996) wants to merge 1 commit into
Radhika Gupta (rads-1996) wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the Analytics page-name callback change.
No open issues 🎉
What changed in this PR
Adds an Analytics page-name callback so applications can derive names for manual and automatic SPA page views without changing the document title, addressing the use case in issue #1986.
Changes:
- Adds extension-scoped callbacks with explicit-name precedence, document-title fallback, and runtime configuration updates.
- Exports the callback interface through the Analytics and web SDK packages.
- Adds usage documentation and tests covering fallback behavior, SPA navigation, performance telemetry, and page-visit metrics.
| File | Description |
|---|---|
| RELEASES.md | Announces page-name callback support. |
| extensions/applicationinsights-analytics-js/Tests/Unit/src/AnalyticsPlugin.tests.ts | Tests callback behavior and telemetry integration. |
| extensions/applicationinsights-analytics-js/src/JavaScriptSDK/Interfaces/IAnalyticsConfig.ts | Defines and documents the callback configuration. |
| extensions/applicationinsights-analytics-js/src/JavaScriptSDK/AnalyticsPlugin.ts | Resolves page names and manages extension-scoped callbacks. |
| extensions/applicationinsights-analytics-js/src/applicationinsights-analytics-js.ts | Exports the callback interface from Analytics. |
| extensions/applicationinsights-analytics-js/README.md | Documents configuration and usage. |
| AISKU/src/applicationinsights-web.ts | Re-exports the callback interface from the web SDK. |
Review effort: Balanced
Radhika Gupta (rads-1996)
force-pushed
the
add-analytics-page-name-callback
branch
from
November 25, 2026 21:02
09ec20a to
8a836d0
Compare
| let callback = _extConfig && _extConfig.callback; | ||
| if (callback && isFunction(callback.pageName)) { | ||
| try { | ||
| let name = callback.pageName(); |
Contributor
There was a problem hiding this comment.
I reproduced this with the callback reading the current route. The new SPA test waits for the first page view before navigating again, so it misses this case. I didn’t find another blocker.
This branch has not been deployed
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.
Fixes #1986 and microsoft/applicationinsights-react-js#20