-
Notifications
You must be signed in to change notification settings - Fork 32
Remove initial route track persisting #85
Comments
The purpose of it being additive is because sometimes you'd want to set some initial context and then add more to it as per the application flow (e.g. user sign in). |
@hiraldesai Thank you - I actually found this previously while digging through the source code but I don't think it actually worked when implemented. Let me test and I'll report back. Thank you. |
Entered my app at You can also see that initially context has an object with key "refUri" initially, but then is removed once I clear context with Here is the corresponding analytics from App Insights As you can see, it wipes out the value initial page load to |
It seems to be added by the application-insights package's trackPageView only. ReactAI doesn't set this anywhere. |
Fair enough, just strange that it doesn't seem to be moving accurately with the router. The Here is my current configuration:
In the config on initialization I am setting some initial context so I know that is where my user is entering the app, and then removing the context immediately after loadAppInsights(). It's a little hacky, but this way I can at least see where my user enters the app, and rely on the |
Another thought I had is to go to The user should only see that render for a second unless they go directly to a page that doesn't exist, but instead of I'll keep playing and see if I can find a cleaner way. |
@yasso1am refUri is populated in ApplicationInsights SDK, is actually using document.referrer value, so it will be useful to understand how users are getting into your page from other sites not how they navigate your site. |
Not sure how to apply a "Question" label but that's what this is:
version = "react-appinsights": "^3.0.0-rc.6",
I really appreciate that the initial route is tracked upon entry of the app, however it appears this context is remaining for every future call in my custom dimensions.
You can see in this screenshot I enter at /login and localhost:3000/login persists in the custom dimensions even though I am never setting that.
Here is my helper class:
after calling
this.ai.loadAppInsights()
I tried callingreactAI.setContext({})
to remove any customDimensions but that did not help.Any suggestions?
Thank you.
The text was updated successfully, but these errors were encountered: