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
Description/Screenshot
I'm using snippet to setup AppInsights in nextjs app. I track pageView events manually by watching route changes.
So that I have enableAutoRouteTracking: false in my app Insights config.
But when using snippet interface it always sends initial pageView event. Due to that I get duplicates for initial pageView events.
Steps to Reproduce
Setup snippet with enableAutoRouteTracking = false
Open page
OS/Browser: OSX, Chrome
SDK Version [e.g. 22]: "@microsoft/applicationinsights-web": "^3.0.3",
How you initialized the SDK: snippet
Expected behavior
Snippet should not send pageView if enableAutoRouteTracking = false
Additional context
The text was updated successfully, but these errors were encountered:
VitaliyPotapov
changed the title
[BUG]: snippet sends pageView even if enableAutoRouteTracking = false
[BUG]: snippet sends pageView if enableAutoRouteTracking = false
Nov 21, 2023
Yes, this is by design so that the SDK completes initialization.
If you don't want this initial "pageview" then you can either not use the snippet, or add / include a telemetry initializer which will be called once the SDK has initialized (and is processing the backlog of queued events -- which will include this trackPageView) and then when you detect this just return false (to cause the event to be dropped).
The initial page view also includes a page view performace event and is the only trackPageview that will cause this performance event to be sent. The auto route tracking (generally) does not cause this event, the only exception is that when using npm packages the performance event is sent as part of the first trackPageview (which is also what happens here as part of this "queued" event).
Description/Screenshot
I'm using snippet to setup AppInsights in nextjs app. I track pageView events manually by watching route changes.
So that I have
enableAutoRouteTracking: false
in my app Insights config.But when using snippet interface it always sends initial pageView event. Due to that I get duplicates for initial pageView events.
Steps to Reproduce
enableAutoRouteTracking = false
Expected behavior
Snippet should not send
pageView
ifenableAutoRouteTracking = false
Additional context
The text was updated successfully, but these errors were encountered: