You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the plugin as documented for a React SPA with router v6, the name for all page views is the page title ("React App" by default). This makes it difficult to track user progress through the application. I was able to solve this using the following telemetry initializer but this doesn't seem very elegant.
It would be great for developers to be able to specify how to obtain the page name rather than having to modify it after the fact with a telemetry initializer. Alternatively, if the above approach is the recommended method, adding it to the official documentation would be helpful.
The text was updated successfully, but these errors were encountered:
When I use the plugin as documented for a React SPA with router v6, the name for all page views is the page title ("React App" by default). This makes it difficult to track user progress through the application. I was able to solve this using the following telemetry initializer but this doesn't seem very elegant.
appInsights.addTelemetryInitializer((env) => { if(env.baseType === "PageviewData" || env.baseType === "PageviewPerformanceData") { env.baseData.name = window.location.pathname; } });
It would be great for developers to be able to specify how to obtain the page name rather than having to modify it after the fact with a telemetry initializer. Alternatively, if the above approach is the recommended method, adding it to the official documentation would be helpful.
The text was updated successfully, but these errors were encountered: